From fbeef92c4df246cb75a020230acf60df9551b6f6 Mon Sep 17 00:00:00 2001 From: Favo Yang Date: Tue, 4 Aug 2020 14:33:14 +0800 Subject: [PATCH] fix: compile wrong naming bug (close #39) --- ...> AddressableImporterFilterOdinHandler.cs} | 32 +++++++++---------- ...ressableImporterFilterOdinHandler.cs.meta} | 0 .../AddressableImporterOdinHandler.cs | 18 +++++------ 3 files changed, 25 insertions(+), 25 deletions(-) rename Editor/OdinSupport/{AddressablesImporterFilterOdinHandler.cs => AddressableImporterFilterOdinHandler.cs} (95%) rename Editor/OdinSupport/{AddressablesImporterFilterOdinHandler.cs.meta => AddressableImporterFilterOdinHandler.cs.meta} (100%) diff --git a/Editor/OdinSupport/AddressablesImporterFilterOdinHandler.cs b/Editor/OdinSupport/AddressableImporterFilterOdinHandler.cs similarity index 95% rename from Editor/OdinSupport/AddressablesImporterFilterOdinHandler.cs rename to Editor/OdinSupport/AddressableImporterFilterOdinHandler.cs index afa792f..5cc88d8 100644 --- a/Editor/OdinSupport/AddressablesImporterFilterOdinHandler.cs +++ b/Editor/OdinSupport/AddressableImporterFilterOdinHandler.cs @@ -10,7 +10,7 @@ using UnityEditor; using UnityEngine; - public class AddressablesImporterFilterOdinHandler : ScriptableObject + public class AddressableImporterFilterOdinHandler : ScriptableObject { private AddressableImportSettings _importSettings; private PropertyTree _drawerTree; @@ -22,7 +22,7 @@ public class AddressablesImporterFilterOdinHandler : ScriptableObject [HideLabel] [OnValueChanged("OnFilterChanged")] private string _searchFilter; - + [SerializeField] [ListDrawerSettings( HideRemoveButton = true, @@ -39,13 +39,13 @@ public void Initialize(AddressableImportSettings importSettings) { _importSettings = importSettings; _drawerTree = PropertyTree.Create(this); - + _filters = new List>() { ValidateAddressableGroupName, ValidateRulePath, ValidateLabelsPath, }; - + _drawerTree.OnPropertyValueChanged += (property, index) => EditorUtility.SetDirty(_importSettings); } @@ -64,20 +64,20 @@ public void Draw() [Button] public void Save() => _importSettings.Save(); - + [Button] public void Documentation() => _importSettings.Documentation(); - + [Button] public void CleanEmptyGroup() => _importSettings.CleanEmptyGroup(); - + #region private methods private void OnFilterChanged() { - + } - + private bool ValidateRule(AddressableImportRule rule,string filter) { return string.IsNullOrEmpty(filter) || _filters.Any(x => x(rule,filter)); @@ -87,12 +87,12 @@ private bool ValidateAddressableGroupName(AddressableImportRule rule, string fil { return rule.groupName.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0; } - + private bool ValidateRulePath(AddressableImportRule rule, string filter) { return rule.path.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0; } - + private bool ValidateLabelsPath(AddressableImportRule rule, string filter) { return rule.labels.Any(x => x.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0); @@ -116,21 +116,21 @@ private void ApplyChanges() if(index < 0) continue; _importSettings.rules[index] = rules[i]; } - + } - + private void CustomAddFunction() { _importSettings.rules.Add(new AddressableImportRule()); _sourceChanged = true; } - + private void CustomRemoveIndexFunction(int index) { var removeResult = _importSettings.rules.Remove(rules[index]); _sourceChanged = true; } - + private void CustomRemoveElementFunction(AddressableImportRule item) { var index = rules.IndexOf(item); @@ -156,7 +156,7 @@ private void OnPropertyChanged(InspectorProperty property, int index) if (_importSettings == null) return; EditorUtility.SetDirty(_importSettings); } - + #endregion } #endif diff --git a/Editor/OdinSupport/AddressablesImporterFilterOdinHandler.cs.meta b/Editor/OdinSupport/AddressableImporterFilterOdinHandler.cs.meta similarity index 100% rename from Editor/OdinSupport/AddressablesImporterFilterOdinHandler.cs.meta rename to Editor/OdinSupport/AddressableImporterFilterOdinHandler.cs.meta diff --git a/Editor/OdinSupport/AddressableImporterOdinHandler.cs b/Editor/OdinSupport/AddressableImporterOdinHandler.cs index 87a024c..ab0c9a2 100644 --- a/Editor/OdinSupport/AddressableImporterOdinHandler.cs +++ b/Editor/OdinSupport/AddressableImporterOdinHandler.cs @@ -11,10 +11,10 @@ public class AddressableImporterOdinHandler : IDisposable { private AddressableImportSettings _settings; - private AddressablesImporterFilterOdinHandler _importRulesContainer; + private AddressableImporterFilterOdinHandler _importRulesContainer; private GUIContent _searchFieldLabel; private string _searchField; - + public void Initialize(AddressableImportSettings target) { _settings = target; @@ -24,7 +24,7 @@ public void Initialize(AddressableImportSettings target) public void Draw() { DrawInspectorTree(_searchField); - + EditorUtility.SetDirty(_settings); } @@ -37,9 +37,9 @@ public void Dispose() } } - private AddressablesImporterFilterOdinHandler CreateDrawer(AddressableImportSettings settings) + private AddressableImporterFilterOdinHandler CreateDrawer(AddressableImportSettings settings) { - _importRulesContainer = ScriptableObject.CreateInstance(); + _importRulesContainer = ScriptableObject.CreateInstance(); _importRulesContainer.Initialize(settings); return _importRulesContainer; } @@ -49,13 +49,13 @@ private void DrawInspectorTree(string filter) _importRulesContainer?.Draw(); } } - + #else - public class AddressablesImporterOdinHandler : IDisposable + public class AddressableImporterOdinHandler : IDisposable { - public void Initialize(AddressableImportSettings target) { } - + public void Initialize(AddressableImportSettings target) { } + public void Draw() { } public void Dispose() { }