diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index f597c7b..6a18fc5 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -98,7 +98,7 @@ LightmapSettings: m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 0 + m_UseShadowmask: 1 --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -5331,7 +5331,7 @@ PrefabInstance: - target: {fileID: 2746333758154926288, guid: 7e33cda9a5d8c3e478c6888db2b484ea, type: 3} propertyPath: m_AnchoredPosition.y - value: 0.000061035156 + value: 0.000289917 objectReference: {fileID: 0} - target: {fileID: 2746333758154926288, guid: 7e33cda9a5d8c3e478c6888db2b484ea, type: 3} @@ -5341,7 +5341,7 @@ PrefabInstance: - target: {fileID: 2746333758174583497, guid: 7e33cda9a5d8c3e478c6888db2b484ea, type: 3} propertyPath: m_AnchoredPosition.y - value: -0.000030517578 + value: 0.00025177002 objectReference: {fileID: 0} - target: {fileID: 2746333758174583497, guid: 7e33cda9a5d8c3e478c6888db2b484ea, type: 3} @@ -5481,7 +5481,7 @@ PrefabInstance: - target: {fileID: 2746333759616755060, guid: 7e33cda9a5d8c3e478c6888db2b484ea, type: 3} propertyPath: m_AnchoredPosition.y - value: 0.000015258789 + value: -0.00021362305 objectReference: {fileID: 0} - target: {fileID: 2746333759616755060, guid: 7e33cda9a5d8c3e478c6888db2b484ea, type: 3} diff --git a/Assets/Scripts/ViewModels/TagEditorModel.cs b/Assets/Scripts/ViewModels/TagEditorModel.cs index 4110f9b..fa8de06 100644 --- a/Assets/Scripts/ViewModels/TagEditorModel.cs +++ b/Assets/Scripts/ViewModels/TagEditorModel.cs @@ -79,6 +79,11 @@ private void SelectionChanged() private static bool IsValidEditorTag(string tag) => !tag.StartsWith("folder:") && !tag.StartsWith("collection:"); private static HashSet Filter(IReadOnlyCollection tags) => tags.Where(IsValidEditorTag).ToHashSet(); + protected override bool IsValidTag(string tagText) => + !string.IsNullOrWhiteSpace(tagText) + && IsValidEditorTag(tagText) + && Tags.Where(t => !t.IsPartial).All(tag => tag.Text != tagText); + private IEnumerable Hashes => Mode == Current ? new[] {_detailMenu.Current.Value.FileHash} : _detailMenu.Selection.Select(pi => pi.FileHash); diff --git a/Assets/Scripts/ViewModels/TagInputModelBase.cs b/Assets/Scripts/ViewModels/TagInputModelBase.cs index 829f006..d5cc710 100644 --- a/Assets/Scripts/ViewModels/TagInputModelBase.cs +++ b/Assets/Scripts/ViewModels/TagInputModelBase.cs @@ -60,9 +60,13 @@ private void SuggestionChosen(SuggestionModel suggestion) private bool AddTag(string tagText) { tagText = tagText?.Trim().ToLowerInvariant(); - if (!string.IsNullOrEmpty(tagText) && Tags.All(tag => tag.Text != tagText)) + if (IsValidTag(tagText)) { tagText = OnAddingTag(tagText); + + var sameTag = Tags.FirstOrDefault(t => t.Text == tagText); + if (sameTag != null) Tags.Remove(sameTag); + Tags.Add(new TagModel(tagText, RemoveTag)); return true; @@ -71,6 +75,11 @@ private bool AddTag(string tagText) return false; } + protected virtual bool IsValidTag(string tagText) + { + return !string.IsNullOrEmpty(tagText) && Tags.All(tag => tag.Text != tagText); + } + protected virtual string OnAddingTag(string tagText) => tagText; protected virtual bool CanPinCurrentInput()