From b9467a4de6ab349b250cd732f528292fc069f0e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Mon, 16 Dec 2024 20:25:34 +0100 Subject: [PATCH 1/9] Move Toolbox assembly to the Runtime directory; fix InspectorUtility.SetIsEditorExpanded method --- .../Editor/Utilities/InspectorUtility.cs | 4 ++-- Assets/Editor Toolbox/README.md | 4 ++-- Assets/Editor Toolbox/{ => Runtime}/Toolbox.asmdef | 0 .../Editor Toolbox/{ => Runtime}/Toolbox.asmdef.meta | 0 Assets/Examples/Scenes/SampleScene.unity | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) rename Assets/Editor Toolbox/{ => Runtime}/Toolbox.asmdef (100%) rename Assets/Editor Toolbox/{ => Runtime}/Toolbox.asmdef.meta (100%) diff --git a/Assets/Editor Toolbox/Editor/Utilities/InspectorUtility.cs b/Assets/Editor Toolbox/Editor/Utilities/InspectorUtility.cs index 4e36831a..e3a92a1f 100644 --- a/Assets/Editor Toolbox/Editor/Utilities/InspectorUtility.cs +++ b/Assets/Editor Toolbox/Editor/Utilities/InspectorUtility.cs @@ -52,7 +52,7 @@ internal static bool GetIsEditorExpanded(Editor editor) /// internal static void SetIsEditorExpanded(Editor editor, bool value) { - InternalEditorUtility.SetIsInspectorExpanded(editor.target, true); + InternalEditorUtility.SetIsInspectorExpanded(editor.target, value); //NOTE: in older versions Editor's foldouts are based on the m_IsVisible field and the Awake() method #if !UNITY_2019_1_OR_NEWER const string isVisibleFieldName = "m_IsVisible"; @@ -60,7 +60,7 @@ internal static void SetIsEditorExpanded(Editor editor, bool value) BindingFlags.Instance | BindingFlags.NonPublic); if (isVisible != null) { - isVisible.SetValue(editor, true); + isVisible.SetValue(editor, value); } #endif } diff --git a/Assets/Editor Toolbox/README.md b/Assets/Editor Toolbox/README.md index c5d629df..c9ce2ee5 100644 --- a/Assets/Editor Toolbox/README.md +++ b/Assets/Editor Toolbox/README.md @@ -971,11 +971,11 @@ public void Usage() Allows to serialize folders in form of assets and retrieve direct paths in Runtime. ```csharp -public SerializedDirectory serializeDirectory; +public SerializedDirectory serializedDirectory; public void Usage() { - string path = serializeDirectory.DirectoryPath; + string path = serializedDirectory.DirectoryPath; } ``` diff --git a/Assets/Editor Toolbox/Toolbox.asmdef b/Assets/Editor Toolbox/Runtime/Toolbox.asmdef similarity index 100% rename from Assets/Editor Toolbox/Toolbox.asmdef rename to Assets/Editor Toolbox/Runtime/Toolbox.asmdef diff --git a/Assets/Editor Toolbox/Toolbox.asmdef.meta b/Assets/Editor Toolbox/Runtime/Toolbox.asmdef.meta similarity index 100% rename from Assets/Editor Toolbox/Toolbox.asmdef.meta rename to Assets/Editor Toolbox/Runtime/Toolbox.asmdef.meta diff --git a/Assets/Examples/Scenes/SampleScene.unity b/Assets/Examples/Scenes/SampleScene.unity index afd0d538..78ad7593 100644 --- a/Assets/Examples/Scenes/SampleScene.unity +++ b/Assets/Examples/Scenes/SampleScene.unity @@ -1828,7 +1828,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1220714192 MonoBehaviour: @@ -2207,7 +2207,7 @@ GameObject: - component: {fileID: 1438743619} - component: {fileID: 1438743618} m_Layer: 0 - m_Name: DecoratorDrawers [Sample] + m_Name: ToolboxDecoratorDrawers [Sample] m_TagString: Untagged m_Icon: {fileID: 2800000, guid: b105bf1fb7fe62e4baba0ffd7b433e7b, type: 3} m_NavMeshLayer: 0 @@ -2285,7 +2285,7 @@ GameObject: - component: {fileID: 1583836799} - component: {fileID: 1583836798} m_Layer: 0 - m_Name: Special & Others [Sample] + m_Name: Toolbox Special & Others [Sample] m_TagString: Untagged m_Icon: {fileID: 2800000, guid: b105bf1fb7fe62e4baba0ffd7b433e7b, type: 3} m_NavMeshLayer: 0 @@ -2336,7 +2336,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1584091011 GameObject: @@ -2456,7 +2456,7 @@ GameObject: - component: {fileID: 1670253092} - component: {fileID: 1670253093} m_Layer: 0 - m_Name: ConditionDrawers [Sample] + m_Name: ToolboxConditionDrawers [Sample] m_TagString: Untagged m_Icon: {fileID: 2800000, guid: b105bf1fb7fe62e4baba0ffd7b433e7b, type: 3} m_NavMeshLayer: 0 From 253d08bb92d53bcd1d4728cf1d72095d77b61477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Wed, 19 Feb 2025 17:25:04 +0100 Subject: [PATCH 2/9] Fix searching for private members in the base types --- .../Helpers/Extraction/FieldValueExtractor.cs | 2 +- .../Extraction/MethodValueExtractor.cs | 7 +- .../Extraction/PropertyValueExtractor.cs | 2 +- .../Decorator/EditorButtonAttributeDrawer.cs | 2 +- .../ReorderableListExposedAttributeDrawer.cs | 2 +- .../Editor/Utilities/ReflectionUtility.cs | 79 ++++++++++++++++--- 6 files changed, 75 insertions(+), 19 deletions(-) diff --git a/Assets/Editor Toolbox/Editor/Drawers/Helpers/Extraction/FieldValueExtractor.cs b/Assets/Editor Toolbox/Editor/Drawers/Helpers/Extraction/FieldValueExtractor.cs index 53d59da4..589c9764 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/Helpers/Extraction/FieldValueExtractor.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/Helpers/Extraction/FieldValueExtractor.cs @@ -11,7 +11,7 @@ public bool TryGetValue(string source, object declaringObject, out object value) } var type = declaringObject.GetType(); - var info = type.GetField(source, ReflectionUtility.allBindings); + var info = ReflectionUtility.GetField(type, source); if (info == null) { return false; diff --git a/Assets/Editor Toolbox/Editor/Drawers/Helpers/Extraction/MethodValueExtractor.cs b/Assets/Editor Toolbox/Editor/Drawers/Helpers/Extraction/MethodValueExtractor.cs index 652f67e2..166b001b 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/Helpers/Extraction/MethodValueExtractor.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/Helpers/Extraction/MethodValueExtractor.cs @@ -1,7 +1,4 @@ -using System; -using System.Reflection; - -namespace Toolbox.Editor.Drawers +namespace Toolbox.Editor.Drawers { public class MethodValueExtractor : IValueExtractor { @@ -14,7 +11,7 @@ public bool TryGetValue(string source, object declaringObject, out object value) } var type = declaringObject.GetType(); - var info = type.GetMethod(source, ReflectionUtility.allBindings, null, CallingConventions.Any, new Type[0], null); + var info = ReflectionUtility.GetMethod(type, source); if (info == null) { return false; diff --git a/Assets/Editor Toolbox/Editor/Drawers/Helpers/Extraction/PropertyValueExtractor.cs b/Assets/Editor Toolbox/Editor/Drawers/Helpers/Extraction/PropertyValueExtractor.cs index 933bda56..691a18e3 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/Helpers/Extraction/PropertyValueExtractor.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/Helpers/Extraction/PropertyValueExtractor.cs @@ -11,7 +11,7 @@ public bool TryGetValue(string source, object declaringObject, out object value) } var type = declaringObject.GetType(); - var info = type.GetProperty(source, ReflectionUtility.allBindings); + var info = ReflectionUtility.GetProperty(type, source); if (info == null) { return false; diff --git a/Assets/Editor Toolbox/Editor/Drawers/Toolbox/Decorator/EditorButtonAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/Toolbox/Decorator/EditorButtonAttributeDrawer.cs index fdc0d496..15eab5cd 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/Toolbox/Decorator/EditorButtonAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/Toolbox/Decorator/EditorButtonAttributeDrawer.cs @@ -10,7 +10,7 @@ public class EditorButtonAttributeDrawer : ToolboxDecoratorDrawer /// Returns of the searched method within the Editor . /// @@ -21,17 +48,17 @@ internal static MethodInfo GetEditorMethod(string classType, string methodName, return editorAssembly.GetType(classType).GetMethod(methodName, falgs); } - internal static MethodInfo GetObjectMethod(string methodName, SerializedObject serializedObject) + internal static MethodInfo GetMethod(string methodName, SerializedObject serializedObject) { - return GetObjectMethod(methodName, serializedObject.targetObjects); + return GetMethod(methodName, serializedObject.targetObjects); } - internal static MethodInfo GetObjectMethod(string methodName, params object[] targetObjects) + internal static MethodInfo GetMethod(string methodName, params object[] targetObjects) { - return GetObjectMethod(methodName, allBindings, targetObjects); + return GetMethod(methodName, allBindings, targetObjects); } - internal static MethodInfo GetObjectMethod(string methodName, BindingFlags bindingFlags, params object[] targetObjects) + internal static MethodInfo GetMethod(string methodName, BindingFlags bindingFlags, params object[] targetObjects) { if (targetObjects == null || targetObjects.Length == 0) { @@ -39,14 +66,24 @@ internal static MethodInfo GetObjectMethod(string methodName, BindingFlags bindi } var targetType = targetObjects[0].GetType(); - var methodInfo = GetObjectMethod(targetType, methodName, bindingFlags); + return GetMethod(targetType, methodName, bindingFlags); + } + + internal static MethodInfo GetMethod(Type targetType, string methodName) + { + return GetMethod(targetType, methodName, allBindings); + } + + internal static MethodInfo GetMethod(Type targetType, string methodName, BindingFlags bindingFlags) + { + var methodInfo = targetType.GetMethod(methodName, bindingFlags, null, CallingConventions.Any, new Type[0], null); if (methodInfo == null && bindingFlags.HasFlag(BindingFlags.NonPublic)) { //NOTE: if a method is not found and we searching for a private method we should look into parent classes var baseType = targetType.BaseType; while (baseType != null) { - methodInfo = GetObjectMethod(baseType, methodName, bindingFlags); + methodInfo = baseType.GetMethod(methodName, bindingFlags, null, CallingConventions.Any, new Type[0], null); if (methodInfo != null) { break; @@ -59,9 +96,31 @@ internal static MethodInfo GetObjectMethod(string methodName, BindingFlags bindi return methodInfo; } - internal static MethodInfo GetObjectMethod(Type targetType, string methodName, BindingFlags bindingFlags) + internal static PropertyInfo GetProperty(Type targetType, string propertyName) + { + return GetProperty(targetType, propertyName, allBindings); + } + + internal static PropertyInfo GetProperty(Type targetType, string propertyName, BindingFlags bindingFlags) { - return targetType.GetMethod(methodName, bindingFlags, null, CallingConventions.Any, new Type[0], null); + var property = targetType.GetProperty(propertyName, bindingFlags); + if (property == null && bindingFlags.HasFlag(BindingFlags.NonPublic)) + { + //NOTE: if a method is not found and we searching for a private method we should look into parent classes + Type baseType = targetType.BaseType; + while (baseType != null) + { + property = baseType.GetProperty(propertyName, bindingFlags); + if (property != null) + { + break; + } + + baseType = baseType.BaseType; + } + } + + return property; } /// @@ -70,7 +129,7 @@ internal static MethodInfo GetObjectMethod(Type targetType, string methodName, B internal static bool TryInvokeMethod(string methodName, SerializedObject serializedObject) { var targetObjects = serializedObject.targetObjects; - var method = GetObjectMethod(methodName, targetObjects); + var method = GetMethod(methodName, targetObjects); if (method == null) { return false; From 105bdb78f12c98134fe8ccc8ce0e5b14f3f23d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Wed, 19 Feb 2025 17:30:02 +0100 Subject: [PATCH 3/9] Move FolderData type to the runtime assembly --- .../Drawers/Internal/FolderDataDrawer.cs | 2 +- .../Editor/ToolboxEditorProject.cs | 2 +- .../Editor/ToolboxEditorSettings.cs | 2 +- .../{Editor => Runtime}/Folders.meta | 2 +- .../{Editor => Runtime}/Folders/FolderData.cs | 14 +---------- .../Folders/FolderData.cs.meta | 2 +- .../Runtime/Folders/FolderDataType.cs | 8 +++++++ .../Runtime/Folders/FolderDataType.cs.meta | 11 +++++++++ .../Runtime/Folders/FolderIconType.cs | 8 +++++++ .../Runtime/Folders/FolderIconType.cs.meta | 11 +++++++++ Packages/packages-lock.json | 24 +++++++------------ 11 files changed, 52 insertions(+), 34 deletions(-) rename Assets/Editor Toolbox/{Editor => Runtime}/Folders.meta (77%) rename Assets/Editor Toolbox/{Editor => Runtime}/Folders/FolderData.cs (92%) rename Assets/Editor Toolbox/{Editor => Runtime}/Folders/FolderData.cs.meta (83%) create mode 100644 Assets/Editor Toolbox/Runtime/Folders/FolderDataType.cs create mode 100644 Assets/Editor Toolbox/Runtime/Folders/FolderDataType.cs.meta create mode 100644 Assets/Editor Toolbox/Runtime/Folders/FolderIconType.cs create mode 100644 Assets/Editor Toolbox/Runtime/Folders/FolderIconType.cs.meta diff --git a/Assets/Editor Toolbox/Editor/Drawers/Internal/FolderDataDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/Internal/FolderDataDrawer.cs index 1634c939..920b80e3 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/Internal/FolderDataDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/Internal/FolderDataDrawer.cs @@ -3,7 +3,7 @@ namespace Toolbox.Editor.Drawers { - using Toolbox.Editor.Folders; + using Toolbox.Folders; [CustomPropertyDrawer(typeof(FolderData))] internal class FolderDataDrawer : PropertyDrawer diff --git a/Assets/Editor Toolbox/Editor/ToolboxEditorProject.cs b/Assets/Editor Toolbox/Editor/ToolboxEditorProject.cs index a4a9d5b8..6336879b 100644 --- a/Assets/Editor Toolbox/Editor/ToolboxEditorProject.cs +++ b/Assets/Editor Toolbox/Editor/ToolboxEditorProject.cs @@ -5,7 +5,7 @@ namespace Toolbox.Editor { - using Toolbox.Editor.Folders; + using Toolbox.Folders; /// /// Static GUI representation for the Project Overlay. diff --git a/Assets/Editor Toolbox/Editor/ToolboxEditorSettings.cs b/Assets/Editor Toolbox/Editor/ToolboxEditorSettings.cs index 7f623c03..28197497 100644 --- a/Assets/Editor Toolbox/Editor/ToolboxEditorSettings.cs +++ b/Assets/Editor Toolbox/Editor/ToolboxEditorSettings.cs @@ -6,8 +6,8 @@ namespace Toolbox.Editor { using Toolbox.Editor.Drawers; - using Toolbox.Editor.Folders; using Toolbox.Editor.Hierarchy; + using Toolbox.Folders; internal interface IToolboxGeneralSettings { } diff --git a/Assets/Editor Toolbox/Editor/Folders.meta b/Assets/Editor Toolbox/Runtime/Folders.meta similarity index 77% rename from Assets/Editor Toolbox/Editor/Folders.meta rename to Assets/Editor Toolbox/Runtime/Folders.meta index 81033450..aebcfcd3 100644 --- a/Assets/Editor Toolbox/Editor/Folders.meta +++ b/Assets/Editor Toolbox/Runtime/Folders.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: be549d804ac1aff4689632341de6835f +guid: c422f5efbb0f4d94297a48755fbe306c folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Editor Toolbox/Editor/Folders/FolderData.cs b/Assets/Editor Toolbox/Runtime/Folders/FolderData.cs similarity index 92% rename from Assets/Editor Toolbox/Editor/Folders/FolderData.cs rename to Assets/Editor Toolbox/Runtime/Folders/FolderData.cs index 221e1311..e5325bef 100644 --- a/Assets/Editor Toolbox/Editor/Folders/FolderData.cs +++ b/Assets/Editor Toolbox/Runtime/Folders/FolderData.cs @@ -3,20 +3,8 @@ using UnityEngine; using UnityEngine.Serialization; -namespace Toolbox.Editor.Folders +namespace Toolbox.Folders { - public enum FolderDataType - { - Path, - Name - } - - public enum FolderIconType - { - Custom, - Editor - } - [Serializable] public struct FolderData { diff --git a/Assets/Editor Toolbox/Editor/Folders/FolderData.cs.meta b/Assets/Editor Toolbox/Runtime/Folders/FolderData.cs.meta similarity index 83% rename from Assets/Editor Toolbox/Editor/Folders/FolderData.cs.meta rename to Assets/Editor Toolbox/Runtime/Folders/FolderData.cs.meta index 3bf8b975..67810eff 100644 --- a/Assets/Editor Toolbox/Editor/Folders/FolderData.cs.meta +++ b/Assets/Editor Toolbox/Runtime/Folders/FolderData.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4680b935459476d4d8ebb3425add6b9a +guid: 571656423e7c7024ea709ce9009cfe15 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Editor Toolbox/Runtime/Folders/FolderDataType.cs b/Assets/Editor Toolbox/Runtime/Folders/FolderDataType.cs new file mode 100644 index 00000000..501b092b --- /dev/null +++ b/Assets/Editor Toolbox/Runtime/Folders/FolderDataType.cs @@ -0,0 +1,8 @@ +namespace Toolbox.Folders +{ + public enum FolderDataType + { + Path, + Name + } +} \ No newline at end of file diff --git a/Assets/Editor Toolbox/Runtime/Folders/FolderDataType.cs.meta b/Assets/Editor Toolbox/Runtime/Folders/FolderDataType.cs.meta new file mode 100644 index 00000000..fc82e171 --- /dev/null +++ b/Assets/Editor Toolbox/Runtime/Folders/FolderDataType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d87c1403eec547b4f80d466b4c2dfa5b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Toolbox/Runtime/Folders/FolderIconType.cs b/Assets/Editor Toolbox/Runtime/Folders/FolderIconType.cs new file mode 100644 index 00000000..b935fcdc --- /dev/null +++ b/Assets/Editor Toolbox/Runtime/Folders/FolderIconType.cs @@ -0,0 +1,8 @@ +namespace Toolbox.Folders +{ + public enum FolderIconType + { + Custom, + Editor + } +} \ No newline at end of file diff --git a/Assets/Editor Toolbox/Runtime/Folders/FolderIconType.cs.meta b/Assets/Editor Toolbox/Runtime/Folders/FolderIconType.cs.meta new file mode 100644 index 00000000..1dc979be --- /dev/null +++ b/Assets/Editor Toolbox/Runtime/Folders/FolderIconType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ac05f3425c2d59b43a1161838d0f463a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 4ae6aadb..dcf65abf 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -10,7 +10,10 @@ "version": "1.0.0", "depth": 0, "source": "builtin", - "dependencies": {} + "dependencies": { + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.uielements": "1.0.0" + } }, "com.unity.analytics": { "version": "3.6.12", @@ -68,18 +71,18 @@ "url": "https://packages.unity.com" }, "com.unity.sysroot": { - "version": "1.0.0", + "version": "2.0.5", "depth": 1, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.sysroot.linux-x86_64": { - "version": "1.0.0", + "version": "2.0.4", "depth": 1, "source": "registry", "dependencies": { - "com.unity.sysroot": "1.0.0" + "com.unity.sysroot": "2.0.5" }, "url": "https://packages.unity.com" }, @@ -108,9 +111,9 @@ "depth": 0, "source": "registry", "dependencies": { + "com.unity.modules.audio": "1.0.0", "com.unity.modules.director": "1.0.0", "com.unity.modules.animation": "1.0.0", - "com.unity.modules.audio": "1.0.0", "com.unity.modules.particlesystem": "1.0.0" }, "url": "https://packages.unity.com" @@ -276,17 +279,6 @@ "version": "1.0.0", "depth": 0, "source": "builtin", - "dependencies": { - "com.unity.modules.ui": "1.0.0", - "com.unity.modules.imgui": "1.0.0", - "com.unity.modules.jsonserialize": "1.0.0", - "com.unity.modules.uielementsnative": "1.0.0" - } - }, - "com.unity.modules.uielementsnative": { - "version": "1.0.0", - "depth": 1, - "source": "builtin", "dependencies": { "com.unity.modules.ui": "1.0.0", "com.unity.modules.imgui": "1.0.0", From 7ac87ffb91187ffce82bcd69dc161e9e8072fa5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Wed, 19 Feb 2025 17:34:10 +0100 Subject: [PATCH 4/9] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c5d629df..c9ce2ee5 100644 --- a/README.md +++ b/README.md @@ -971,11 +971,11 @@ public void Usage() Allows to serialize folders in form of assets and retrieve direct paths in Runtime. ```csharp -public SerializedDirectory serializeDirectory; +public SerializedDirectory serializedDirectory; public void Usage() { - string path = serializeDirectory.DirectoryPath; + string path = serializedDirectory.DirectoryPath; } ``` From 5ee484fca7c954192c63e35433cefcaf2a30e69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Wed, 19 Feb 2025 22:11:04 +0100 Subject: [PATCH 5/9] Clear InLinedEditor after folding properties; improve displaying mixed values while using the ReferencePickerAttribute; improve footer position in the ReorderableList class --- .../InLineEditorAttributeDrawer.cs | 8 ++--- .../ReferencePickerAttributeDrawer.cs | 32 ++++++++++++++++++- .../Editor/Internal/ReorderableListBase.cs | 4 +++ Packages/manifest.json | 1 - Packages/packages-lock.json | 29 +++++++++-------- ProjectSettings/TimelineSettings.asset | 16 ++++++++++ 6 files changed, 70 insertions(+), 20 deletions(-) create mode 100644 ProjectSettings/TimelineSettings.asset diff --git a/Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/InLineEditorAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/InLineEditorAttributeDrawer.cs index 125e077b..93b8cf8e 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/InLineEditorAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/InLineEditorAttributeDrawer.cs @@ -46,7 +46,6 @@ static InLineEditorAttributeDrawer() private static readonly PropertyDataStorage storage; - private Editor GetTargetsEditor(SerializedProperty property, InLineEditorAttribute attribute) { var editor = storage.ReturnItem(property, attribute); @@ -108,7 +107,6 @@ private void DrawEditor(Editor editor, bool disableEditor, bool drawPreview, boo } } - /// /// Handles the property drawing process and tries to create a inlined version of the . /// @@ -151,15 +149,17 @@ protected override void OnGuiSafe(SerializedProperty property, GUIContent label, DrawEditor(editor, attribute); } } + else + { + storage.ClearItem(property); + } } - public override bool IsPropertyValid(SerializedProperty property) { return property.propertyType == SerializedPropertyType.ObjectReference; } - private static class Style { internal static readonly GUIStyle backgroundStyle; diff --git a/Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/ReferencePickerAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/ReferencePickerAttributeDrawer.cs index a854feb5..ab71df12 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/ReferencePickerAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/ReferencePickerAttributeDrawer.cs @@ -41,9 +41,38 @@ private Type GetParentType(ReferencePickerAttribute attribute, SerializedPropert return fieldType; } + private static Type GetCurrentManagedReferenceType(SerializedProperty property, out bool hasMixedValues) + { + var fullTypeName = property.managedReferenceFullTypename; + hasMixedValues = false; + TypeUtility.TryGetTypeFromManagedReferenceFullTypeName(fullTypeName, out var targetType); + + var currentSerializedObject = property.serializedObject; + if (currentSerializedObject.isEditingMultipleObjects) + { + var targets = currentSerializedObject.targetObjects; + foreach (var target in targets) + { + using (var tempSerializedObject = new SerializedObject(target)) + { + var tempProperty = tempSerializedObject.FindProperty(property.propertyPath); + if (tempProperty.managedReferenceFullTypename != fullTypeName) + { + hasMixedValues = true; + break; + } + } + } + } + + return targetType; + } + private void CreateTypeProperty(SerializedProperty property, Type parentType, ReferencePickerAttribute attribute, Rect position) { - TypeUtility.TryGetTypeFromManagedReferenceFullTypeName(property.managedReferenceFullTypename, out var currentType); + var currentType = GetCurrentManagedReferenceType(property, out var hasMixedValues); + var hadMixedValues = EditorGUI.showMixedValue; + EditorGUI.showMixedValue = hasMixedValues; typeField.OnGui(position, attribute.AddTextSearchField, (type) => { try @@ -70,6 +99,7 @@ private void CreateTypeProperty(SerializedProperty property, Type parentType, Re ToolboxEditorLog.LogWarning("Invalid attempt to update disposed property."); } }, currentType, parentType); + EditorGUI.showMixedValue = false; } private void UpdateTypeProperty(SerializedProperty property, Type targetType, ReferencePickerAttribute attribute) diff --git a/Assets/Editor Toolbox/Editor/Internal/ReorderableListBase.cs b/Assets/Editor Toolbox/Editor/Internal/ReorderableListBase.cs index b4c3e9bc..2c8f829b 100644 --- a/Assets/Editor Toolbox/Editor/Internal/ReorderableListBase.cs +++ b/Assets/Editor Toolbox/Editor/Internal/ReorderableListBase.cs @@ -334,6 +334,8 @@ protected virtual bool DoListFooter(Rect footerRect) return false; } + footerRect.yMax += Style.footerXOffset; + footerRect.yMin += Style.footerYOffset; //draw the background on repaint event if (Event.current.type == EventType.Repaint) { @@ -870,6 +872,8 @@ protected static class Style #else internal static readonly float lineHeight = 16.0f; #endif + internal static readonly float footerXOffset = 0.0f; + internal static readonly float footerYOffset = -1.0f; internal static readonly float footerWidth = 60.0f; internal static readonly float footerButtonWidth = 25.0f; internal static readonly float footerButtonHeight = 13.0f; diff --git a/Packages/manifest.json b/Packages/manifest.json index 9e4d1c2d..794f1ad1 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -7,7 +7,6 @@ "com.unity.editorcoroutines": "1.0.0", "com.unity.ide.rider": "3.0.18", "com.unity.ide.visualstudio": "2.0.17", - "com.unity.ide.vscode": "1.2.5", "com.unity.test-framework": "1.1.31", "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.6.4", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index dcf65abf..12bc5cc1 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -10,10 +10,7 @@ "version": "1.0.0", "depth": 0, "source": "builtin", - "dependencies": { - "com.unity.modules.tilemap": "1.0.0", - "com.unity.modules.uielements": "1.0.0" - } + "dependencies": {} }, "com.unity.analytics": { "version": "3.6.12", @@ -63,26 +60,19 @@ }, "url": "https://packages.unity.com" }, - "com.unity.ide.vscode": { - "version": "1.2.5", - "depth": 0, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" - }, "com.unity.sysroot": { - "version": "2.0.5", + "version": "1.0.0", "depth": 1, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.sysroot.linux-x86_64": { - "version": "2.0.4", + "version": "1.0.0", "depth": 1, "source": "registry", "dependencies": { - "com.unity.sysroot": "2.0.5" + "com.unity.sysroot": "1.0.0" }, "url": "https://packages.unity.com" }, @@ -279,6 +269,17 @@ "version": "1.0.0", "depth": 0, "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.uielementsnative": "1.0.0" + } + }, + "com.unity.modules.uielementsnative": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", "dependencies": { "com.unity.modules.ui": "1.0.0", "com.unity.modules.imgui": "1.0.0", diff --git a/ProjectSettings/TimelineSettings.asset b/ProjectSettings/TimelineSettings.asset new file mode 100644 index 00000000..cfaebd7a --- /dev/null +++ b/ProjectSettings/TimelineSettings.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3} + m_Name: + m_EditorClassIdentifier: + assetDefaultFramerate: 60 + m_DefaultFrameRate: 60 From 92d5047436227867811a5af29174c2118328479b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Sat, 22 Feb 2025 14:09:18 +0100 Subject: [PATCH 6/9] Fix AmbiguousMatchException while searching for overrided fields & properties; expose OnToolbarGuiRight callback --- .../Editor/ToolboxEditorToolbar.cs | 64 ++++++++++++++----- .../Editor/Utilities/ReflectionUtility.cs | 6 +- Assets/Examples/Editor/SampleToolbar.cs | 36 +++++++++-- 3 files changed, 82 insertions(+), 24 deletions(-) diff --git a/Assets/Editor Toolbox/Editor/ToolboxEditorToolbar.cs b/Assets/Editor Toolbox/Editor/ToolboxEditorToolbar.cs index bf5285f7..fff824c2 100644 --- a/Assets/Editor Toolbox/Editor/ToolboxEditorToolbar.cs +++ b/Assets/Editor Toolbox/Editor/ToolboxEditorToolbar.cs @@ -53,7 +53,7 @@ static ToolboxEditorToolbar() private static IEnumerator Initialize() { - while (ToolboxEditorToolbar.toolbar == null) + while (toolbar == null) { var toolbars = Resources.FindObjectsOfTypeAll(toolbarType); if (toolbars == null || toolbars.Length == 0) @@ -63,15 +63,15 @@ private static IEnumerator Initialize() } else { - ToolboxEditorToolbar.toolbar = toolbars[0]; + toolbar = toolbars[0]; } } #if UNITY_2021_1_OR_NEWER - var rootField = ToolboxEditorToolbar.toolbar.GetType().GetField("m_Root", BindingFlags.NonPublic | BindingFlags.Instance); - var root = rootField.GetValue(ToolboxEditorToolbar.toolbar) as VisualElement; - var toolbar = root.Q("ToolbarZoneLeftAlign"); + var rootField = toolbar.GetType().GetField("m_Root", BindingFlags.NonPublic | BindingFlags.Instance); + var root = rootField.GetValue(toolbar) as VisualElement; + var toolbarLeftZone = root.Q("ToolbarZoneLeftAlign"); var element = new VisualElement() { style = @@ -83,10 +83,25 @@ private static IEnumerator Initialize() var container = new IMGUIContainer(); container.style.flexGrow = 1; - container.onGUIHandler += OnGui; - + container.onGUIHandler += OnGuiLeft; element.Add(container); - toolbar.Add(element); + toolbarLeftZone.Add(element); + + var toolbarRightZone = root.Q("ToolbarZoneRightAlign"); + var rightElement = new VisualElement() + { + style = + { + flexGrow = 1, + flexDirection = FlexDirection.Row, + } + }; + + var rightContainer = new IMGUIContainer(); + rightContainer.style.flexGrow = 1; + rightContainer.onGUIHandler += OnGuiRight; + rightElement.Add(rightContainer); + toolbarRightZone.Add(rightElement); #else #if UNITY_2020_1_OR_NEWER var backend = guiBackend.GetValue(toolbar); @@ -101,15 +116,15 @@ private static IEnumerator Initialize() var container = elements[0] as IMGUIContainer; #endif var handler = onGuiHandler.GetValue(container) as Action; - handler -= OnGui; - handler += OnGui; + handler -= OnGuiLeft; + handler += OnGuiLeft; onGuiHandler.SetValue(container, handler); #endif } - private static void OnGui() + private static void OnGuiLeft() { - if (!IsToolbarAllowed || !IsToolbarValid) + if (!IsToolbarAllowed || !IsLeftToolbarValid) { return; } @@ -117,7 +132,7 @@ private static void OnGui() #if UNITY_2021_1_OR_NEWER using (new GUILayout.HorizontalScope()) { - OnToolbarGui.Invoke(); + OnToolbarGuiLeft(); } #else var screenWidth = EditorGUIUtility.currentViewWidth; @@ -139,12 +154,25 @@ private static void OnGui() { using (new GUILayout.HorizontalScope()) { - OnToolbarGui?.Invoke(); + OnToolbarGuiLeft(); } } #endif } + private static void OnGuiRight() + { + if (!IsToolbarAllowed || !IsRightToolbarValid) + { + return; + } + + using (new EditorGUILayout.HorizontalScope()) + { + OnToolbarGuiRight(); + } + } + public static void Repaint() { if (toolbar == null) @@ -156,11 +184,17 @@ public static void Repaint() } public static bool IsToolbarAllowed { get; set; } = true; - public static bool IsToolbarValid => toolbar != null && OnToolbarGui != null; + public static bool IsLeftToolbarValid => toolbar != null && OnToolbarGuiLeft != null; + public static bool IsRightToolbarValid => toolbar != null && OnToolbarGuiRight != null; public static float FromToolsOffset { get; set; } = 400.0f; public static float FromStripOffset { get; set; } = 150.0f; +#pragma warning disable 0067 + [Obsolete("Use OnToolbarGuiLeft instead")] public static event Action OnToolbarGui; +#pragma warning restore 0067 + public static event Action OnToolbarGuiLeft; + public static event Action OnToolbarGuiRight; private static class Style { diff --git a/Assets/Editor Toolbox/Editor/Utilities/ReflectionUtility.cs b/Assets/Editor Toolbox/Editor/Utilities/ReflectionUtility.cs index bab68128..4a52c74e 100644 --- a/Assets/Editor Toolbox/Editor/Utilities/ReflectionUtility.cs +++ b/Assets/Editor Toolbox/Editor/Utilities/ReflectionUtility.cs @@ -20,8 +20,9 @@ internal static FieldInfo GetField(Type targetType, string fieldName) internal static FieldInfo GetField(Type targetType, string fieldName, BindingFlags bindingFlags) { + bindingFlags |= BindingFlags.DeclaredOnly; var field = targetType.GetField(fieldName, bindingFlags); - if (field == null && bindingFlags.HasFlag(BindingFlags.NonPublic)) + if (field == null) { //NOTE: if a method is not found and we searching for a private method we should look into parent classes Type baseType = targetType.BaseType; @@ -103,8 +104,9 @@ internal static PropertyInfo GetProperty(Type targetType, string propertyName) internal static PropertyInfo GetProperty(Type targetType, string propertyName, BindingFlags bindingFlags) { + bindingFlags |= BindingFlags.DeclaredOnly; var property = targetType.GetProperty(propertyName, bindingFlags); - if (property == null && bindingFlags.HasFlag(BindingFlags.NonPublic)) + if (property == null) { //NOTE: if a method is not found and we searching for a private method we should look into parent classes Type baseType = targetType.BaseType; diff --git a/Assets/Examples/Editor/SampleToolbar.cs b/Assets/Examples/Editor/SampleToolbar.cs index dba275b9..d43e926c 100644 --- a/Assets/Examples/Editor/SampleToolbar.cs +++ b/Assets/Examples/Editor/SampleToolbar.cs @@ -10,7 +10,7 @@ public static class SampleToolbar /// /// This field will be used to exclude toolbar buttons for all scenes except this one. /// - private readonly static string mySampleSceneName = "SampleScene"; + private static readonly string mySampleSceneName = "SampleScene"; static SampleToolbar() { @@ -43,19 +43,18 @@ private static void ValidateFirstScene() /// private static void SceneOpenedCallback(Scene scene, OpenSceneMode mode) { - ToolboxEditorToolbar.OnToolbarGui -= OnToolbarGui; + ToolboxEditorToolbar.OnToolbarGuiLeft -= OnToolbarGuiLeft; + ToolboxEditorToolbar.OnToolbarGuiRight -= OnToolbarGuiRight; if (scene.name != mySampleSceneName) { return; } - ToolboxEditorToolbar.OnToolbarGui += OnToolbarGui; + ToolboxEditorToolbar.OnToolbarGuiLeft += OnToolbarGuiLeft; + ToolboxEditorToolbar.OnToolbarGuiRight += OnToolbarGuiRight; } - /// - /// Layout-based GUI call. - /// - private static void OnToolbarGui() + private static void OnToolbarGuiLeft() { GUILayout.FlexibleSpace(); if (GUILayout.Button("1", Style.commandLeftStyle)) @@ -79,6 +78,29 @@ private static void OnToolbarGui() } } + private static void OnToolbarGuiRight() + { + if (GUILayout.Button("1")) + { + Debug.Log("1"); + } + + if (GUILayout.Button("2")) + { + Debug.Log("2"); + } + + if (GUILayout.Button("3")) + { + Debug.Log("3"); + } + + if (GUILayout.Button("4")) + { + Debug.Log("4"); + } + } + private static class Style { internal static readonly GUIStyle commandMidStyle = new GUIStyle("CommandMid") From 43bace23964b67a1ba7fa22dd62f0aa7f1586678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Sat, 22 Feb 2025 14:23:19 +0100 Subject: [PATCH 7/9] Update: README.md, package.json, CHANGELOG.md --- Assets/Editor Toolbox/CHANGELOG.md | 13 ++++++++----- Assets/Editor Toolbox/README.md | 20 +++++++++++++++----- Assets/Editor Toolbox/package.json | 2 +- README.md | 20 +++++++++++++++----- 4 files changed, 39 insertions(+), 16 deletions(-) diff --git a/Assets/Editor Toolbox/CHANGELOG.md b/Assets/Editor Toolbox/CHANGELOG.md index 035bcd06..fcdec6f8 100644 --- a/Assets/Editor Toolbox/CHANGELOG.md +++ b/Assets/Editor Toolbox/CHANGELOG.md @@ -1,13 +1,16 @@ +## 0.14.0 [23.02.2025] + ## 0.13.2 [29.11.2024] ### Added: -- AnimationCurveSettingsAttribute +- OnToolbarGuiRight callback (ability to draw GUI elements on the right side of the toolbar container); OnToolbarGui replaced with the OnToolbarGuiLeft callback ### Changed: -- Possibility to use [EditorButton] and [DynamicHelp] in nested types -- For now SerializeReference properties without children will always be folded -- Fix exception while building labels for generic types without arguments -- Fix drawing SerializedDictionary if value or key types cannot be serialized +- Fix fetching private members from base classes in various cases (e.g. [EditorButton] or conditionals) +- Move FolderData to the Runtime assembly to fix issues caused by the Visual Scripting package +- Fix minor rendering issues caused by the ReoerdableList's footer position +- Fix clearing cached Editor instances in the [InLineEditor] (fix for the AudioClip still playing) +- Improve displaying [SerializeReference]-based properties in the multi-editing mode ## 0.13.1 [30.08.2024] diff --git a/Assets/Editor Toolbox/README.md b/Assets/Editor Toolbox/README.md index c9ce2ee5..2f92290f 100644 --- a/Assets/Editor Toolbox/README.md +++ b/Assets/Editor Toolbox/README.md @@ -738,11 +738,12 @@ To prevent issues after renaming types use `UnityEngine.Scripting.APIUpdating.Mo ```csharp [SerializeReference, ReferencePicker(TypeGrouping = TypeGrouping.ByFlatName)] public ISampleInterface var1; -[SerializeReference, ReferencePicker(ForceUninitializedInstance = true)] -public ISampleInterface var1; [SerializeReference, ReferencePicker(ParentType = typeof(ClassWithInterface2)] public ClassWithInterfaceBase var2; - +[SerializeReference, ReferencePicker(ForceUninitializedInstance = true)] +public ISampleInterface var3; +``` +```csharp public interface ISampleInterface { } [Serializable] @@ -1029,10 +1030,11 @@ public static class MyEditorUtility { static MyEditorUtility() { - ToolboxEditorToolbar.OnToolbarGui += OnToolbarGui; + ToolboxEditorToolbar.OnToolbarGuiLeft += OnToolbarGuiLeft; + ToolboxEditorToolbar.OnToolbarGuiRight += OnToolbarGuiRight; } - private static void OnToolbarGui() + private static void OnToolbarGuiLeft() { GUILayout.FlexibleSpace(); if (GUILayout.Button("1", Style.commandLeftStyle)) @@ -1056,6 +1058,14 @@ public static class MyEditorUtility Debug.Log("5"); } } + + private static void OnToolbarGuiRight() + { + if (GUILayout.Button("1")) + { + Debug.Log("1"); + } + } } ``` diff --git a/Assets/Editor Toolbox/package.json b/Assets/Editor Toolbox/package.json index 4c6cdc76..2d7ea422 100644 --- a/Assets/Editor Toolbox/package.json +++ b/Assets/Editor Toolbox/package.json @@ -1,7 +1,7 @@ { "name": "com.browar.editor-toolbox", "displayName": "Editor Toolbox", - "version": "0.13.2", + "version": "0.14.0", "unity": "2018.1", "description": "Tools, custom attributes, drawers, hierarchy overlay, and other extensions for the Unity Editor.", "keywords": [ diff --git a/README.md b/README.md index c9ce2ee5..2f92290f 100644 --- a/README.md +++ b/README.md @@ -738,11 +738,12 @@ To prevent issues after renaming types use `UnityEngine.Scripting.APIUpdating.Mo ```csharp [SerializeReference, ReferencePicker(TypeGrouping = TypeGrouping.ByFlatName)] public ISampleInterface var1; -[SerializeReference, ReferencePicker(ForceUninitializedInstance = true)] -public ISampleInterface var1; [SerializeReference, ReferencePicker(ParentType = typeof(ClassWithInterface2)] public ClassWithInterfaceBase var2; - +[SerializeReference, ReferencePicker(ForceUninitializedInstance = true)] +public ISampleInterface var3; +``` +```csharp public interface ISampleInterface { } [Serializable] @@ -1029,10 +1030,11 @@ public static class MyEditorUtility { static MyEditorUtility() { - ToolboxEditorToolbar.OnToolbarGui += OnToolbarGui; + ToolboxEditorToolbar.OnToolbarGuiLeft += OnToolbarGuiLeft; + ToolboxEditorToolbar.OnToolbarGuiRight += OnToolbarGuiRight; } - private static void OnToolbarGui() + private static void OnToolbarGuiLeft() { GUILayout.FlexibleSpace(); if (GUILayout.Button("1", Style.commandLeftStyle)) @@ -1056,6 +1058,14 @@ public static class MyEditorUtility Debug.Log("5"); } } + + private static void OnToolbarGuiRight() + { + if (GUILayout.Button("1")) + { + Debug.Log("1"); + } + } } ``` From 69e34d8ce1be1e11f57c2a61065a66e1b4ab745e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Sat, 22 Feb 2025 14:26:53 +0100 Subject: [PATCH 8/9] Update: CHANGELOG.md --- Assets/Editor Toolbox/CHANGELOG.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Assets/Editor Toolbox/CHANGELOG.md b/Assets/Editor Toolbox/CHANGELOG.md index fcdec6f8..07b14ecc 100644 --- a/Assets/Editor Toolbox/CHANGELOG.md +++ b/Assets/Editor Toolbox/CHANGELOG.md @@ -1,7 +1,5 @@ ## 0.14.0 [23.02.2025] -## 0.13.2 [29.11.2024] - ### Added: - OnToolbarGuiRight callback (ability to draw GUI elements on the right side of the toolbar container); OnToolbarGui replaced with the OnToolbarGuiLeft callback @@ -12,6 +10,17 @@ - Fix clearing cached Editor instances in the [InLineEditor] (fix for the AudioClip still playing) - Improve displaying [SerializeReference]-based properties in the multi-editing mode +## 0.13.2 [29.11.2024] + +### Added: +- AnimationCurveSettingsAttribute + +### Changed: +- Possibility to use [EditorButton] and [DynamicHelp] in nested types +- For now SerializeReference properties without children will always be folded +- Fix exception while building labels for generic types without arguments +- Fix drawing SerializedDictionary if value or key types cannot be serialized + ## 0.13.1 [30.08.2024] ### Changed: From 7e850c5c2f8346da5c5921991a5e8d4a5d3e218e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Sat, 22 Feb 2025 14:34:11 +0100 Subject: [PATCH 9/9] Update workflows --- .github/workflows/activation.yml | 2 +- .github/workflows/test.yml | 2 +- .github/workflows/upm-dev.yml | 2 +- .github/workflows/upm.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/activation.yml b/.github/workflows/activation.yml index 1d856e59..439e7092 100644 --- a/.github/workflows/activation.yml +++ b/.github/workflows/activation.yml @@ -12,7 +12,7 @@ jobs: uses: game-ci/unity-request-activation-file@v2 # Upload artifact (Unity_v20XX.X.XXXX.alf) - name: Expose as artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ steps.getManualLicenseFile.outputs.filePath }} path: ${{ steps.getManualLicenseFile.outputs.filePath }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 66cda1f3..b408643d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: testMode: ${{ matrix.testMode }} artifactsPath: ${{ matrix.testMode }}-artifacts checkName: ${{ matrix.testMode }} Test Results - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: Test results for ${{ matrix.testMode }} diff --git a/.github/workflows/upm-dev.yml b/.github/workflows/upm-dev.yml index 8e3b9997..e25a96f7 100644 --- a/.github/workflows/upm-dev.yml +++ b/.github/workflows/upm-dev.yml @@ -8,7 +8,7 @@ jobs: name: split upm branch runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: split upm branch diff --git a/.github/workflows/upm.yml b/.github/workflows/upm.yml index 286d4a45..59f3f282 100644 --- a/.github/workflows/upm.yml +++ b/.github/workflows/upm.yml @@ -8,7 +8,7 @@ jobs: name: split upm branch runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: split upm branch