From 2672b9d893e7dee732a0d9b8ad3e133131e86d88 Mon Sep 17 00:00:00 2001 From: uurha Date: Wed, 10 Apr 2024 17:09:15 +0000 Subject: [PATCH] Merge pull request #27 from techno-dwarf-works/feature/clean-up Refactoring --- Editor/BetterValidation.Editor.asmdef | 9 +++------ Editor/EditorAddons/Comparers.meta | 3 +++ .../GameObjectGroupingComparer.cs | 2 +- .../GameObjectGroupingComparer.cs.meta | 0 Editor/EditorAddons/Drawers/ValidationDrawer.cs | 12 ++++++------ Editor/EditorAddons/Iteration/Iterator.cs | 2 +- Editor/EditorAddons/Iteration/IteratorFilter.cs | 8 ++++---- .../PreBuildValidation/ValidationBuildProcess.cs | 2 -- .../Settings/BuildValidationStepsDrawer.cs | 14 ++++++++------ .../EditorAddons/Utility/GameObjectExtensions.cs | 3 ++- Editor/EditorAddons/Utility/ToolsGUIUtility.cs | 2 +- .../Utility/ValidationAttributeUtility.cs | 6 +++--- .../EditorAddons/Utility/ValidationExtensions.cs | 2 +- Editor/EditorAddons/Utility/ValidationUtility.cs | 3 ++- .../CollectionDrawing/CollectionDrawer.cs | 13 +++++++------ .../CollectionDrawing/DefaultDrawer.cs | 4 ++-- .../CollectionDrawing/GroupDictionaryDrawer.cs | 6 +++--- .../CollectionDrawing/ObjectGroupDrawer.cs | 1 - .../CollectionDrawing/TypeGroupDrawer.cs | 1 - .../EditorAddons/WindowModule/Pages/ButtonPage.cs | 4 ++-- .../EditorAddons/WindowModule/Pages/ResultPage.cs | 6 +++--- .../EditorAddons/WindowModule/ValidationWindow.cs | 2 +- .../Wrappers/DataValidationWrapper.cs | 15 ++++++++------- .../Wrappers/MissingComponentWrapper.cs | 2 +- .../Wrappers/MissingReferenceWrapper.cs | 8 ++++---- Editor/EditorAddons/Wrappers/NotNullWrapper.cs | 8 ++++---- Editor/EditorAddons/Wrappers/PrefabWrapper.cs | 6 +++--- .../Wrappers/RequireComponentWrapper.cs | 6 +++--- .../Wrappers/SceneReferenceWrapper.cs | 10 +++++----- Editor/EditorAddons/Wrappers/ValidationWrapper.cs | 4 ++-- Runtime/Attributes/ValidationAttribute.cs | 2 +- Runtime/BetterValidation.Runtime.asmdef | 4 ++-- package.json | 7 +++---- 33 files changed, 89 insertions(+), 88 deletions(-) create mode 100644 Editor/EditorAddons/Comparers.meta rename Editor/EditorAddons/{WindowModule => Comparers}/GameObjectGroupingComparer.cs (98%) rename Editor/EditorAddons/{WindowModule => Comparers}/GameObjectGroupingComparer.cs.meta (100%) diff --git a/Editor/BetterValidation.Editor.asmdef b/Editor/BetterValidation.Editor.asmdef index ce7e3b4..03a8134 100644 --- a/Editor/BetterValidation.Editor.asmdef +++ b/Editor/BetterValidation.Editor.asmdef @@ -3,15 +3,12 @@ "rootNamespace": "Better.Validation.EditorAddons", "references": [ "GUID:01df13aca8d01e24a911bcc3e8277031", - "GUID:443314a5a4e67c14a88ae223776b6554", - "GUID:1ac867a6259e45a1856740fe8f7623aa", - "GUID:28da8d3b12e3efa47928e0c9070f853d", - "GUID:19891d5296046644cbc12fcf3702cca3", - "GUID:a59e3daedde9ca94bba45364d4ead25f", "GUID:ecdd0819e3429eb44b13a432679a1135", "GUID:1862b35041b066d42ab4d3caf773657b", "GUID:af7fffdf1d83bc842b0f6e3a01efda16", - "GUID:441b78e90a9cf724ab41c6eed8c0b93d" + "GUID:441b78e90a9cf724ab41c6eed8c0b93d", + "GUID:8bd4b41f8da90144d9006c4d926c9679", + "GUID:55fbe2a01ca11514f94a66e7102c8895" ], "includePlatforms": [ "Editor" diff --git a/Editor/EditorAddons/Comparers.meta b/Editor/EditorAddons/Comparers.meta new file mode 100644 index 0000000..a1753d4 --- /dev/null +++ b/Editor/EditorAddons/Comparers.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3e3e24bde22b48448f08ae3b469460d7 +timeCreated: 1712763749 \ No newline at end of file diff --git a/Editor/EditorAddons/WindowModule/GameObjectGroupingComparer.cs b/Editor/EditorAddons/Comparers/GameObjectGroupingComparer.cs similarity index 98% rename from Editor/EditorAddons/WindowModule/GameObjectGroupingComparer.cs rename to Editor/EditorAddons/Comparers/GameObjectGroupingComparer.cs index 3fae560..77148fa 100644 --- a/Editor/EditorAddons/WindowModule/GameObjectGroupingComparer.cs +++ b/Editor/EditorAddons/Comparers/GameObjectGroupingComparer.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Better.EditorTools.EditorAddons.Comparers; +using Better.Commons.Runtime.Comparers; using UnityEngine; namespace Better.Validation.EditorAddons.WindowModule diff --git a/Editor/EditorAddons/WindowModule/GameObjectGroupingComparer.cs.meta b/Editor/EditorAddons/Comparers/GameObjectGroupingComparer.cs.meta similarity index 100% rename from Editor/EditorAddons/WindowModule/GameObjectGroupingComparer.cs.meta rename to Editor/EditorAddons/Comparers/GameObjectGroupingComparer.cs.meta diff --git a/Editor/EditorAddons/Drawers/ValidationDrawer.cs b/Editor/EditorAddons/Drawers/ValidationDrawer.cs index 6e835dd..aa61f9f 100644 --- a/Editor/EditorAddons/Drawers/ValidationDrawer.cs +++ b/Editor/EditorAddons/Drawers/ValidationDrawer.cs @@ -1,9 +1,9 @@ using System.Reflection; -using Better.EditorTools.EditorAddons.Attributes; -using Better.EditorTools.EditorAddons.Drawers.Base; -using Better.EditorTools.EditorAddons.Helpers; -using Better.EditorTools.EditorAddons.Helpers.Caching; -using Better.EditorTools.Runtime.Attributes; +using Better.Commons.EditorAddons.Drawers.Attributes; +using Better.Commons.EditorAddons.Drawers.Base; +using Better.Commons.EditorAddons.Drawers.Caching; +using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Drawers.Attributes; using Better.Validation.EditorAddons.Utility; using Better.Validation.EditorAddons.Wrappers; using Better.Validation.Runtime.Attributes; @@ -55,7 +55,7 @@ protected override void PostDraw(Rect position, SerializedProperty property, GUI if (!_validationResult.IsValid) { var (value, type) = _validationResult.Value; - DrawersHelper.HelpBox(value, type.GetIconType()); + ExtendedGUIUtility.HelpBox(value, type.GetIconType()); } } diff --git a/Editor/EditorAddons/Iteration/Iterator.cs b/Editor/EditorAddons/Iteration/Iterator.cs index 8faecb9..5709b70 100644 --- a/Editor/EditorAddons/Iteration/Iterator.cs +++ b/Editor/EditorAddons/Iteration/Iterator.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Better.Extensions.Runtime; +using Better.Commons.Runtime.Extensions; using Better.Validation.EditorAddons.ContextResolver; using Better.Validation.EditorAddons.Utility; using Better.Validation.EditorAddons.Wrappers; diff --git a/Editor/EditorAddons/Iteration/IteratorFilter.cs b/Editor/EditorAddons/Iteration/IteratorFilter.cs index f12c309..8868ebf 100644 --- a/Editor/EditorAddons/Iteration/IteratorFilter.cs +++ b/Editor/EditorAddons/Iteration/IteratorFilter.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.Text; -using Better.EditorTools.EditorAddons.Drawers.Base; -using Better.EditorTools.EditorAddons.Helpers.Caching; -using Better.Extensions.EditorAddons; -using Better.Extensions.Runtime; +using Better.Commons.EditorAddons.Drawers.Base; +using Better.Commons.EditorAddons.Drawers.Caching; +using Better.Commons.EditorAddons.Extensions; +using Better.Commons.Runtime.Extensions; using Better.Validation.EditorAddons.Utility; using Better.Validation.EditorAddons.Wrappers; using Better.Validation.Runtime.Attributes; diff --git a/Editor/EditorAddons/PreBuildValidation/ValidationBuildProcess.cs b/Editor/EditorAddons/PreBuildValidation/ValidationBuildProcess.cs index 2fbc636..8c17d71 100644 --- a/Editor/EditorAddons/PreBuildValidation/ValidationBuildProcess.cs +++ b/Editor/EditorAddons/PreBuildValidation/ValidationBuildProcess.cs @@ -2,14 +2,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using Better.Internal.Core.Runtime; using Better.Validation.EditorAddons.Settings; using Better.Validation.EditorAddons.WindowModule; using Better.Validation.Runtime.Attributes; using UnityEditor; using UnityEditor.Build; using UnityEditor.Build.Reporting; -using UnityEngine; namespace Better.Validation.EditorAddons.PreBuildValidation { diff --git a/Editor/EditorAddons/Settings/BuildValidationStepsDrawer.cs b/Editor/EditorAddons/Settings/BuildValidationStepsDrawer.cs index ffdfad3..6590a2f 100644 --- a/Editor/EditorAddons/Settings/BuildValidationStepsDrawer.cs +++ b/Editor/EditorAddons/Settings/BuildValidationStepsDrawer.cs @@ -1,9 +1,11 @@ using System; using System.Linq; -using Better.EditorTools.EditorAddons.Helpers; -using Better.EditorTools.EditorAddons.Helpers.DropDown; -using Better.Extensions.EditorAddons; -using Better.Extensions.Runtime; +using Better.Commons.EditorAddons.DropDown; +using Better.Commons.EditorAddons.Enums; +using Better.Commons.EditorAddons.Extensions; +using Better.Commons.EditorAddons.Helpers; +using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Extensions; using Better.Validation.EditorAddons.PreBuildValidation; using UnityEditor; using UnityEditorInternal; @@ -58,7 +60,7 @@ private void DrawElementCallback(Rect rect, int index, bool isActive, bool isFoc private void DrawButton(Rect rect, SerializedProperty serializedProperty, Type currentValue) { var typeName = currentValue == null ? NullName : currentValue.Name; - var content = DrawersHelper.GetIconGUIContent(IconType.GrayDropdown); + var content = IconType.GrayDropdown.GetIconGUIContent(); content.text = typeName; var buttonPosition = GetPopupPosition(rect); if (GUI.Button(buttonPosition, content, Styles.Button)) @@ -87,7 +89,7 @@ private DropdownCollection GenerateItemsTree(SerializedProperty serializedProper var guiContent = new GUIContent(typeName); if (guiContent.image == null && type == currentValue) { - guiContent.image = DrawersHelper.GetIcon(IconType.Checkmark); + guiContent.image = IconType.Checkmark.GetIcon(); } var item = new DropdownItem(guiContent, OnSelectItem, new Tuple(serializedProperty, type)); diff --git a/Editor/EditorAddons/Utility/GameObjectExtensions.cs b/Editor/EditorAddons/Utility/GameObjectExtensions.cs index 0b8fa0c..62c454d 100644 --- a/Editor/EditorAddons/Utility/GameObjectExtensions.cs +++ b/Editor/EditorAddons/Utility/GameObjectExtensions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; -using Better.Extensions.Runtime; +using Better.Commons.Runtime.Extensions; +using Better.Commons.Runtime.Utility; using UnityEditor; using UnityEngine; using Object = UnityEngine.Object; diff --git a/Editor/EditorAddons/Utility/ToolsGUIUtility.cs b/Editor/EditorAddons/Utility/ToolsGUIUtility.cs index 755e444..6f2f0cb 100644 --- a/Editor/EditorAddons/Utility/ToolsGUIUtility.cs +++ b/Editor/EditorAddons/Utility/ToolsGUIUtility.cs @@ -1,4 +1,4 @@ -using Better.EditorTools.EditorAddons.Helpers; +using Better.Commons.EditorAddons.Helpers; using UnityEditor; using UnityEngine; diff --git a/Editor/EditorAddons/Utility/ValidationAttributeUtility.cs b/Editor/EditorAddons/Utility/ValidationAttributeUtility.cs index 98941d0..8cc06a8 100644 --- a/Editor/EditorAddons/Utility/ValidationAttributeUtility.cs +++ b/Editor/EditorAddons/Utility/ValidationAttributeUtility.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; -using Better.EditorTools.EditorAddons.Comparers; -using Better.EditorTools.EditorAddons.Utilities; -using Better.EditorTools.EditorAddons.WrappersTypeCollection; +using Better.Commons.EditorAddons.Drawers.Utility; +using Better.Commons.EditorAddons.Drawers.WrappersTypeCollection; +using Better.Commons.Runtime.Comparers; using Better.Validation.EditorAddons.Wrappers; using Better.Validation.Runtime.Attributes; diff --git a/Editor/EditorAddons/Utility/ValidationExtensions.cs b/Editor/EditorAddons/Utility/ValidationExtensions.cs index 276efa9..8d24b69 100644 --- a/Editor/EditorAddons/Utility/ValidationExtensions.cs +++ b/Editor/EditorAddons/Utility/ValidationExtensions.cs @@ -1,5 +1,5 @@ using System; -using Better.EditorTools.EditorAddons.Helpers; +using Better.Commons.EditorAddons.Enums; using Better.Validation.Runtime.Attributes; diff --git a/Editor/EditorAddons/Utility/ValidationUtility.cs b/Editor/EditorAddons/Utility/ValidationUtility.cs index 072731f..58e931d 100644 --- a/Editor/EditorAddons/Utility/ValidationUtility.cs +++ b/Editor/EditorAddons/Utility/ValidationUtility.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; -using Better.Extensions.Runtime; +using Better.Commons.Runtime.Extensions; +using Better.Commons.Runtime.Utility; using UnityEditor; using UnityEditor.SceneManagement; using UnityEngine; diff --git a/Editor/EditorAddons/WindowModule/CollectionDrawing/CollectionDrawer.cs b/Editor/EditorAddons/WindowModule/CollectionDrawing/CollectionDrawer.cs index 52c9dec..dad164b 100644 --- a/Editor/EditorAddons/WindowModule/CollectionDrawing/CollectionDrawer.cs +++ b/Editor/EditorAddons/WindowModule/CollectionDrawing/CollectionDrawer.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; -using Better.EditorTools.EditorAddons.Helpers; +using Better.Commons.EditorAddons.Enums; +using Better.Commons.EditorAddons.Utility; using Better.Validation.EditorAddons.Utility; using UnityEditor; using UnityEngine; @@ -40,11 +41,11 @@ protected virtual void DrawBox(ValidationCommandData data) GUI.Box(verticalScore.rect, GUIContent.none, EditorStyles.helpBox); - EditorGUILayout.Space(DrawersHelper.SpaceHeight); + EditorGUILayout.Space(ExtendedGUIUtility.SpaceHeight); DrawLabel(data); - EditorGUILayout.Space(DrawersHelper.SpaceHeight); + EditorGUILayout.Space(ExtendedGUIUtility.SpaceHeight); var iconType = data.Type.GetIconType(); if (data.IsValid) { @@ -52,8 +53,8 @@ protected virtual void DrawBox(ValidationCommandData data) iconType = IconType.Checkmark; } - DrawersHelper.HelpBox(data.Result, iconType, false); - EditorGUILayout.Space(DrawersHelper.SpaceHeight); + ExtendedGUIUtility.HelpBox(data.Result, iconType, false); + EditorGUILayout.Space(ExtendedGUIUtility.SpaceHeight); } GUI.backgroundColor = bufferColor; @@ -75,7 +76,7 @@ protected virtual void DrawLabel(ValidationCommandData data) } EditorGUILayout.LabelField(csIcon); - EditorGUILayout.Space(DrawersHelper.SpaceHeight); + EditorGUILayout.Space(ExtendedGUIUtility.SpaceHeight); if (GUILayout.Button("Show")) { diff --git a/Editor/EditorAddons/WindowModule/CollectionDrawing/DefaultDrawer.cs b/Editor/EditorAddons/WindowModule/CollectionDrawing/DefaultDrawer.cs index 123e56f..4bd06a1 100644 --- a/Editor/EditorAddons/WindowModule/CollectionDrawing/DefaultDrawer.cs +++ b/Editor/EditorAddons/WindowModule/CollectionDrawing/DefaultDrawer.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using Better.EditorTools.EditorAddons.Helpers; +using Better.Commons.EditorAddons.Utility; using UnityEditor; namespace Better.Validation.EditorAddons.WindowModule.CollectionDrawing @@ -29,7 +29,7 @@ public override void DrawCollection() foreach (var data in _dataList) { DrawBox(data); - EditorGUILayout.Space(DrawersHelper.SpaceHeight); + EditorGUILayout.Space(ExtendedGUIUtility.SpaceHeight); } } diff --git a/Editor/EditorAddons/WindowModule/CollectionDrawing/GroupDictionaryDrawer.cs b/Editor/EditorAddons/WindowModule/CollectionDrawing/GroupDictionaryDrawer.cs index 168cca7..8de4072 100644 --- a/Editor/EditorAddons/WindowModule/CollectionDrawing/GroupDictionaryDrawer.cs +++ b/Editor/EditorAddons/WindowModule/CollectionDrawing/GroupDictionaryDrawer.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -using Better.EditorTools.EditorAddons.Helpers; -using Better.Extensions.Runtime; +using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Extensions; using Better.Validation.EditorAddons.Utility; using UnityEditor; @@ -62,7 +62,7 @@ public override void DrawCollection() foreach (var validationCommandData in value.Item2) { DrawBox(validationCommandData); - EditorGUILayout.Space(DrawersHelper.SpaceHeight); + EditorGUILayout.Space(ExtendedGUIUtility.SpaceHeight); } } diff --git a/Editor/EditorAddons/WindowModule/CollectionDrawing/ObjectGroupDrawer.cs b/Editor/EditorAddons/WindowModule/CollectionDrawing/ObjectGroupDrawer.cs index 3fc57aa..6ca05a0 100644 --- a/Editor/EditorAddons/WindowModule/CollectionDrawing/ObjectGroupDrawer.cs +++ b/Editor/EditorAddons/WindowModule/CollectionDrawing/ObjectGroupDrawer.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Linq; using Object = UnityEngine.Object; namespace Better.Validation.EditorAddons.WindowModule.CollectionDrawing diff --git a/Editor/EditorAddons/WindowModule/CollectionDrawing/TypeGroupDrawer.cs b/Editor/EditorAddons/WindowModule/CollectionDrawing/TypeGroupDrawer.cs index 5ee2d1a..8ab1a2f 100644 --- a/Editor/EditorAddons/WindowModule/CollectionDrawing/TypeGroupDrawer.cs +++ b/Editor/EditorAddons/WindowModule/CollectionDrawing/TypeGroupDrawer.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Linq; using Better.Validation.Runtime.Attributes; namespace Better.Validation.EditorAddons.WindowModule.CollectionDrawing diff --git a/Editor/EditorAddons/WindowModule/Pages/ButtonPage.cs b/Editor/EditorAddons/WindowModule/Pages/ButtonPage.cs index b7b5981..08d6cd1 100644 --- a/Editor/EditorAddons/WindowModule/Pages/ButtonPage.cs +++ b/Editor/EditorAddons/WindowModule/Pages/ButtonPage.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; -using Better.EditorTools.EditorAddons.Helpers; -using Better.Extensions.Runtime; +using Better.Commons.EditorAddons.Helpers; +using Better.Commons.Runtime.Extensions; using Better.Validation.EditorAddons.Utility; using UnityEditor; using UnityEngine; diff --git a/Editor/EditorAddons/WindowModule/Pages/ResultPage.cs b/Editor/EditorAddons/WindowModule/Pages/ResultPage.cs index 8f087ec..32557bc 100644 --- a/Editor/EditorAddons/WindowModule/Pages/ResultPage.cs +++ b/Editor/EditorAddons/WindowModule/Pages/ResultPage.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; -using Better.EditorTools.EditorAddons.Helpers; -using Better.Extensions.Runtime; +using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Extensions; using Better.Validation.EditorAddons.Utility; using Better.Validation.EditorAddons.WindowModule.CollectionDrawing; using UnityEditor; @@ -112,7 +112,7 @@ private void DrawCommandList() private static GUIStyle GetScrollStyle() { var style = new GUIStyle(); - var space = (int)DrawersHelper.SpaceHeight; + var space = (int)ExtendedGUIUtility.SpaceHeight; style.margin = new RectOffset(space, space, space, space); return style; } diff --git a/Editor/EditorAddons/WindowModule/ValidationWindow.cs b/Editor/EditorAddons/WindowModule/ValidationWindow.cs index 23bd4fb..054463f 100644 --- a/Editor/EditorAddons/WindowModule/ValidationWindow.cs +++ b/Editor/EditorAddons/WindowModule/ValidationWindow.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Better.Extensions.Runtime; +using Better.Commons.Runtime.Extensions; using UnityEditor; using UnityEngine; diff --git a/Editor/EditorAddons/Wrappers/DataValidationWrapper.cs b/Editor/EditorAddons/Wrappers/DataValidationWrapper.cs index bcfb4a1..e2c50c3 100644 --- a/Editor/EditorAddons/Wrappers/DataValidationWrapper.cs +++ b/Editor/EditorAddons/Wrappers/DataValidationWrapper.cs @@ -1,8 +1,9 @@ using System.Reflection; -using Better.EditorTools.EditorAddons.Helpers; -using Better.EditorTools.EditorAddons.Helpers.Caching; -using Better.Extensions.EditorAddons; -using Better.Extensions.Runtime; +using Better.Commons.EditorAddons.Drawers.Caching; +using Better.Commons.EditorAddons.Extensions; +using Better.Commons.EditorAddons.Helpers; +using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Extensions; using Better.Internal.Core.Runtime; using Better.Validation.Runtime.Attributes; @@ -17,7 +18,7 @@ public override CacheValue Validate() var propertyContainer = Property.GetPropertyContainer(); var method = propertyContainer.GetType().GetMethod(att.MethodName, Defines.MethodFlags); - var methodName = DrawersHelper.BeautifyFormat(att.MethodName); + var methodName = ExtendedGUIUtility.BeautifyFormat(att.MethodName); if (method == null) { return GetNotValidCache($"Method with name {methodName} not found"); @@ -33,7 +34,7 @@ public override CacheValue Validate() if (parameterInfo.ParameterType != fieldCache.Type) { return GetNotValidCache( - $"Method with name {methodName} has parameter of type {DrawersHelper.BeautifyFormat(parameterInfo.ParameterType.Name)}. But used on field of type {DrawersHelper.BeautifyFormat(fieldCache.Type.Name)}"); + $"Method with name {methodName} has parameter of type {ExtendedGUIUtility.BeautifyFormat(parameterInfo.ParameterType.Name)}. But used on field of type {ExtendedGUIUtility.BeautifyFormat(fieldCache.Type.Name)}"); } if (method.IsStatic) @@ -59,7 +60,7 @@ private CacheValue InvokeMethod(MethodInfo method, CachedFieldInfo field { var name = fieldCache.FieldInfo.FieldType.IsArrayOrList() ? Property.GetArrayPath() : propertyContainer.GetType().Name; return GetNotValidCache( - $"Validation failed of {DrawersHelper.BeautifyFormat(fieldCache.FieldInfo.Name)} in {DrawersHelper.BeautifyFormat(name)}"); + $"Validation failed of {ExtendedGUIUtility.BeautifyFormat(fieldCache.FieldInfo.Name)} in {ExtendedGUIUtility.BeautifyFormat(name)}"); } } else if (method.ReturnType == typeof(string)) diff --git a/Editor/EditorAddons/Wrappers/MissingComponentWrapper.cs b/Editor/EditorAddons/Wrappers/MissingComponentWrapper.cs index 8d82c91..9d92a54 100644 --- a/Editor/EditorAddons/Wrappers/MissingComponentWrapper.cs +++ b/Editor/EditorAddons/Wrappers/MissingComponentWrapper.cs @@ -1,4 +1,4 @@ -using Better.EditorTools.EditorAddons.Helpers.Caching; +using Better.Commons.EditorAddons.Drawers.Caching; using Better.Validation.Runtime.Attributes; using UnityEngine; diff --git a/Editor/EditorAddons/Wrappers/MissingReferenceWrapper.cs b/Editor/EditorAddons/Wrappers/MissingReferenceWrapper.cs index 86cd7fc..ccb1a74 100644 --- a/Editor/EditorAddons/Wrappers/MissingReferenceWrapper.cs +++ b/Editor/EditorAddons/Wrappers/MissingReferenceWrapper.cs @@ -1,6 +1,6 @@ -using Better.EditorTools.EditorAddons.Helpers; -using Better.EditorTools.EditorAddons.Helpers.Caching; -using Better.Extensions.Runtime; +using Better.Commons.EditorAddons.Drawers.Caching; +using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Extensions; using UnityEditor; namespace Better.Validation.EditorAddons.Wrappers @@ -11,7 +11,7 @@ public override CacheValue Validate() { if (Property.objectReferenceValue.IsNullOrDestroyed()) { - var fieldName = DrawersHelper.BeautifyFormat(Property.displayName); + var fieldName = ExtendedGUIUtility.BeautifyFormat(Property.displayName); if (Property.objectReferenceInstanceIDValue != 0) { return GetNotValidCache($"Object in {fieldName} field is missing reference"); diff --git a/Editor/EditorAddons/Wrappers/NotNullWrapper.cs b/Editor/EditorAddons/Wrappers/NotNullWrapper.cs index 0963a9c..1c665d3 100644 --- a/Editor/EditorAddons/Wrappers/NotNullWrapper.cs +++ b/Editor/EditorAddons/Wrappers/NotNullWrapper.cs @@ -1,6 +1,6 @@ -using Better.EditorTools.EditorAddons.Helpers; -using Better.EditorTools.EditorAddons.Helpers.Caching; -using Better.Extensions.Runtime; +using Better.Commons.EditorAddons.Drawers.Caching; +using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Extensions; using UnityEditor; namespace Better.Validation.EditorAddons.Wrappers @@ -11,7 +11,7 @@ public override CacheValue Validate() { if (Property.objectReferenceValue.IsNullOrDestroyed()) { - var fieldName = DrawersHelper.BeautifyFormat(Property.displayName); + var fieldName = ExtendedGUIUtility.BeautifyFormat(Property.displayName); if (Property.objectReferenceInstanceIDValue != 0) { return GetNotValidCache($"Object in {fieldName} field is missing reference"); diff --git a/Editor/EditorAddons/Wrappers/PrefabWrapper.cs b/Editor/EditorAddons/Wrappers/PrefabWrapper.cs index 8c993b5..7ff8f7c 100644 --- a/Editor/EditorAddons/Wrappers/PrefabWrapper.cs +++ b/Editor/EditorAddons/Wrappers/PrefabWrapper.cs @@ -1,5 +1,5 @@ -using Better.EditorTools.EditorAddons.Helpers; -using Better.EditorTools.EditorAddons.Helpers.Caching; +using Better.Commons.EditorAddons.Drawers.Caching; +using Better.Commons.EditorAddons.Utility; using UnityEditor; namespace Better.Validation.EditorAddons.Wrappers @@ -17,7 +17,7 @@ public override CacheValue Validate() var obj = Property.objectReferenceValue; if (!PrefabUtility.IsPartOfPrefabAsset(obj)) { - var str = DrawersHelper.BeautifyFormat(Property.displayName); + var str = ExtendedGUIUtility.BeautifyFormat(Property.displayName); if (!PrefabUtility.IsPartOfNonAssetPrefabInstance(obj)) { return GetNotValidCache($"Object in {str} field is not prefab"); diff --git a/Editor/EditorAddons/Wrappers/RequireComponentWrapper.cs b/Editor/EditorAddons/Wrappers/RequireComponentWrapper.cs index f570503..27525a4 100644 --- a/Editor/EditorAddons/Wrappers/RequireComponentWrapper.cs +++ b/Editor/EditorAddons/Wrappers/RequireComponentWrapper.cs @@ -1,6 +1,6 @@ using System; -using Better.EditorTools.EditorAddons.Helpers; -using Better.EditorTools.EditorAddons.Helpers.Caching; +using Better.Commons.EditorAddons.Drawers.Caching; +using Better.Commons.EditorAddons.Utility; using Better.Validation.Runtime.Attributes; using UnityEditor; using UnityEngine; @@ -51,7 +51,7 @@ public override CacheValue Validate() if (!obj) { - return GetNotValidCache($"Reference of {DrawersHelper.BeautifyFormat(_attributeData.RequiredType.Name)} not found"); + return GetNotValidCache($"Reference of {ExtendedGUIUtility.BeautifyFormat(_attributeData.RequiredType.Name)} not found"); } EditorUtility.SetDirty(targetObject); diff --git a/Editor/EditorAddons/Wrappers/SceneReferenceWrapper.cs b/Editor/EditorAddons/Wrappers/SceneReferenceWrapper.cs index 2687a93..4bace79 100644 --- a/Editor/EditorAddons/Wrappers/SceneReferenceWrapper.cs +++ b/Editor/EditorAddons/Wrappers/SceneReferenceWrapper.cs @@ -1,6 +1,6 @@ -using Better.EditorTools.EditorAddons.Helpers; -using Better.EditorTools.EditorAddons.Helpers.Caching; -using Better.Extensions.Runtime; +using Better.Commons.EditorAddons.Drawers.Caching; +using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Extensions; using UnityEditor; using UnityEngine; @@ -30,7 +30,7 @@ private CacheValue ValidateNotPrefabContext(Object obj, Object target) if (isTargetInScene && !isObjectInScene) { - var str = DrawersHelper.BeautifyFormat(Property.displayName); + var str = ExtendedGUIUtility.BeautifyFormat(Property.displayName); return GetNotValidCache($"Object in {str} field is not scene object"); } @@ -65,7 +65,7 @@ private CacheValue ValueTuple(Object obj, Object target) if (!equals) { return GetNotValidCache( - $"Object in {DrawersHelper.BeautifyFormat(Property.displayName)} field is not part of {DrawersHelper.BeautifyFormat(target.name)} prefab"); + $"Object in {ExtendedGUIUtility.BeautifyFormat(Property.displayName)} field is not part of {ExtendedGUIUtility.BeautifyFormat(target.name)} prefab"); } return GetClearCache(); diff --git a/Editor/EditorAddons/Wrappers/ValidationWrapper.cs b/Editor/EditorAddons/Wrappers/ValidationWrapper.cs index 1e5795b..55e28ad 100644 --- a/Editor/EditorAddons/Wrappers/ValidationWrapper.cs +++ b/Editor/EditorAddons/Wrappers/ValidationWrapper.cs @@ -1,5 +1,5 @@ -using Better.EditorTools.EditorAddons.Helpers.Caching; -using Better.EditorTools.EditorAddons.Utilities; +using Better.Commons.EditorAddons.Drawers.Caching; +using Better.Commons.EditorAddons.Drawers.Utility; using Better.Validation.Runtime.Attributes; namespace Better.Validation.EditorAddons.Wrappers diff --git a/Runtime/Attributes/ValidationAttribute.cs b/Runtime/Attributes/ValidationAttribute.cs index fc8e342..aa3662c 100644 --- a/Runtime/Attributes/ValidationAttribute.cs +++ b/Runtime/Attributes/ValidationAttribute.cs @@ -1,6 +1,6 @@ using System; using System.Diagnostics; -using Better.EditorTools.Runtime.Attributes; +using Better.Commons.Runtime.Drawers.Attributes; using Better.Internal.Core.Runtime; namespace Better.Validation.Runtime.Attributes diff --git a/Runtime/BetterValidation.Runtime.asmdef b/Runtime/BetterValidation.Runtime.asmdef index bda634e..efb9feb 100644 --- a/Runtime/BetterValidation.Runtime.asmdef +++ b/Runtime/BetterValidation.Runtime.asmdef @@ -2,8 +2,8 @@ "name": "BetterValidation.Runtime", "rootNamespace": "Better.Validation.Runtime", "references": [ - "GUID:a59e3daedde9ca94bba45364d4ead25f", - "GUID:01df13aca8d01e24a911bcc3e8277031" + "GUID:01df13aca8d01e24a911bcc3e8277031", + "GUID:8bd4b41f8da90144d9006c4d926c9679" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/package.json b/package.json index f5a0c0b..dd04c2d 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,13 @@ { "name": "com.uurha.bettervalidation", "displayName": "Better Validation", - "version": "1.5.1", + "version": "1.6.0", "unity": "2021.3", "description": " ", "dependencies": { - "com.uurha.bettereditortools": "1.5.25", "com.tdw.better.internal.core": "0.0.2", - "com.tdw.better.projectsettings": "0.0.2", - "com.tdw.better.singletons" : "0.0.8" + "com.tdw.better.projectsettings": "0.1.1", + "com.tdw.better.commons" : "0.0.2" }, "author": { "name": "Better Plugins",