From 88cfe10050afc8326ae97ca29ee6ba8c9fc36cbc Mon Sep 17 00:00:00 2001 From: Vladislav Panin Date: Sat, 29 Nov 2025 16:49:35 +0300 Subject: [PATCH 01/18] Update generator --- .../Aspid.UnityFastTools.Generators.Sample.csproj | 0 .../Aspid.UnityFastTools.Generators.Tests.csproj | 0 .../Aspid.UnityFastTools.Generators.sln | 6 +++--- .../Aspid.UnityFastTools.Generators.slnx | 12 ++++++++++++ .../Aspid.UnityFastTools.Generators.csproj | 2 +- .../Descriptions/General.cs | 0 .../ProfilerMarkers/Bodies/ExtensionClassBody.cs | 0 .../Generators/ProfilerMarkers/Data/MarkerCall.cs | 0 .../ProfilerMarkers/Data/MarkerCallMember.cs | 0 .../ProfilerMarkers/Data/MarkerCallType.cs | 0 .../ProfilerMarkers/ProfilerMarkersGenerator.cs | 0 .../Properties/launchSettings.json | 0 12 files changed, 16 insertions(+), 4 deletions(-) rename Aspid.UnityFastTools.Generators/{UnityFastToolsGenerators => }/Aspid.UnityFastTools.Generators.Sample/Aspid.UnityFastTools.Generators.Sample.csproj (100%) rename Aspid.UnityFastTools.Generators/{UnityFastToolsGenerators => }/Aspid.UnityFastTools.Generators.Tests/Aspid.UnityFastTools.Generators.Tests.csproj (100%) create mode 100644 Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.slnx rename Aspid.UnityFastTools.Generators/{UnityFastToolsGenerators => }/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.csproj (96%) rename Aspid.UnityFastTools.Generators/{UnityFastToolsGenerators => }/Aspid.UnityFastTools.Generators/Descriptions/General.cs (100%) rename Aspid.UnityFastTools.Generators/{UnityFastToolsGenerators => }/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Bodies/ExtensionClassBody.cs (100%) rename Aspid.UnityFastTools.Generators/{UnityFastToolsGenerators => }/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCall.cs (100%) rename Aspid.UnityFastTools.Generators/{UnityFastToolsGenerators => }/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCallMember.cs (100%) rename Aspid.UnityFastTools.Generators/{UnityFastToolsGenerators => }/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCallType.cs (100%) rename Aspid.UnityFastTools.Generators/{UnityFastToolsGenerators => }/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/ProfilerMarkersGenerator.cs (100%) rename Aspid.UnityFastTools.Generators/{UnityFastToolsGenerators => }/Aspid.UnityFastTools.Generators/Properties/launchSettings.json (100%) diff --git a/Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators.Sample/Aspid.UnityFastTools.Generators.Sample.csproj b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.Sample/Aspid.UnityFastTools.Generators.Sample.csproj similarity index 100% rename from Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators.Sample/Aspid.UnityFastTools.Generators.Sample.csproj rename to Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.Sample/Aspid.UnityFastTools.Generators.Sample.csproj diff --git a/Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators.Tests/Aspid.UnityFastTools.Generators.Tests.csproj b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.Tests/Aspid.UnityFastTools.Generators.Tests.csproj similarity index 100% rename from Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators.Tests/Aspid.UnityFastTools.Generators.Tests.csproj rename to Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.Tests/Aspid.UnityFastTools.Generators.Tests.csproj diff --git a/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.sln b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.sln index aa25b9e..c9716fe 100644 --- a/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.sln +++ b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.sln @@ -1,10 +1,10 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspid.UnityFastTools.Generators", "UnityFastToolsGenerators\Aspid.UnityFastTools.Generators\Aspid.UnityFastTools.Generators.csproj", "{CB9D8D51-7D86-4B84-A0DB-73E418962DA7}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspid.UnityFastTools.Generators", "Aspid.UnityFastTools.Generators\Aspid.UnityFastTools.Generators.csproj", "{CB9D8D51-7D86-4B84-A0DB-73E418962DA7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspid.UnityFastTools.Generators.Sample", "UnityFastToolsGenerators\Aspid.UnityFastTools.Generators.Sample\Aspid.UnityFastTools.Generators.Sample.csproj", "{2835DD81-D105-4C2E-AE03-BC7D064C29D1}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspid.UnityFastTools.Generators.Sample", "Aspid.UnityFastTools.Generators.Sample\Aspid.UnityFastTools.Generators.Sample.csproj", "{2835DD81-D105-4C2E-AE03-BC7D064C29D1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspid.UnityFastTools.Generators.Tests", "UnityFastToolsGenerators\Aspid.UnityFastTools.Generators.Tests\Aspid.UnityFastTools.Generators.Tests.csproj", "{F4953608-2F14-4B2E-B91C-B3FDFC81B180}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspid.UnityFastTools.Generators.Tests", "Aspid.UnityFastTools.Generators.Tests\Aspid.UnityFastTools.Generators.Tests.csproj", "{F4953608-2F14-4B2E-B91C-B3FDFC81B180}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.slnx b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.slnx new file mode 100644 index 0000000..5b22511 --- /dev/null +++ b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.slnx @@ -0,0 +1,12 @@ + + + Debug;Release + AnyCPU + + + + + + + + diff --git a/Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.csproj b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.csproj similarity index 96% rename from Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.csproj rename to Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.csproj index 74888a7..a20bf9d 100644 --- a/Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.csproj +++ b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators.csproj @@ -3,7 +3,7 @@ netstandard2.0 enable - 13 + 14 true UnityFastToolsGenerators diff --git a/Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Descriptions/General.cs b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Descriptions/General.cs similarity index 100% rename from Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Descriptions/General.cs rename to Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Descriptions/General.cs diff --git a/Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Bodies/ExtensionClassBody.cs b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Bodies/ExtensionClassBody.cs similarity index 100% rename from Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Bodies/ExtensionClassBody.cs rename to Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Bodies/ExtensionClassBody.cs diff --git a/Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCall.cs b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCall.cs similarity index 100% rename from Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCall.cs rename to Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCall.cs diff --git a/Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCallMember.cs b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCallMember.cs similarity index 100% rename from Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCallMember.cs rename to Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCallMember.cs diff --git a/Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCallType.cs b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCallType.cs similarity index 100% rename from Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCallType.cs rename to Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/Data/MarkerCallType.cs diff --git a/Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/ProfilerMarkersGenerator.cs b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/ProfilerMarkersGenerator.cs similarity index 100% rename from Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/ProfilerMarkersGenerator.cs rename to Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Generators/ProfilerMarkers/ProfilerMarkersGenerator.cs diff --git a/Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Properties/launchSettings.json b/Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Properties/launchSettings.json similarity index 100% rename from Aspid.UnityFastTools.Generators/UnityFastToolsGenerators/Aspid.UnityFastTools.Generators/Properties/launchSettings.json rename to Aspid.UnityFastTools.Generators/Aspid.UnityFastTools.Generators/Properties/launchSettings.json From 8a419b80d025601daa4279b7b9c8537af0991f44 Mon Sep 17 00:00:00 2001 From: Vladislav Panin Date: Thu, 25 Dec 2025 12:44:45 +0300 Subject: [PATCH 02/18] Fix bugs --- .../{Resources => }/Editor.meta | 0 .../{ => Editor}/Resources.meta | 0 .../Resources}/Aspid.UnityFastTools Icon.png | Bin .../Aspid.UnityFastTools Icon.png.meta | 0 .../Editor/VisualElementInspectorEditor.cs | 2 +- .../Editor/Extensions/EditorExtensions.cs | 31 +++++++++++++++++- .../SerializePropertyExtensions.SetValue.cs | 2 +- .../Source/Runtime/Enums/EnumValue.cs | 3 +- .../Source/Runtime/Enums/EnumValues.cs | 2 +- .../Extensions/HelpBoxExtensions.cs | 4 +-- .../Extensions/IStyleExtensions.cs | 2 ++ .../Extensions/VisualElementExtensions.cs | 7 ++++ 12 files changed, 46 insertions(+), 7 deletions(-) rename Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/{Resources => }/Editor.meta (100%) rename Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/{ => Editor}/Resources.meta (100%) rename Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/{Resources/Editor => Editor/Resources}/Aspid.UnityFastTools Icon.png (100%) rename Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/{Resources/Editor => Editor/Resources}/Aspid.UnityFastTools Icon.png.meta (100%) diff --git a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Resources/Editor.meta b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Editor.meta similarity index 100% rename from Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Resources/Editor.meta rename to Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Editor.meta diff --git a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Resources.meta b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Editor/Resources.meta similarity index 100% rename from Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Resources.meta rename to Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Editor/Resources.meta diff --git a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Resources/Editor/Aspid.UnityFastTools Icon.png b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Editor/Resources/Aspid.UnityFastTools Icon.png similarity index 100% rename from Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Resources/Editor/Aspid.UnityFastTools Icon.png rename to Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Editor/Resources/Aspid.UnityFastTools Icon.png diff --git a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Resources/Editor/Aspid.UnityFastTools Icon.png.meta b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Editor/Resources/Aspid.UnityFastTools Icon.png.meta similarity index 100% rename from Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Resources/Editor/Aspid.UnityFastTools Icon.png.meta rename to Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Editor/Resources/Aspid.UnityFastTools Icon.png.meta diff --git a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Samples/VisualElements/Scripts/Editor/VisualElementInspectorEditor.cs b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Samples/VisualElements/Scripts/Editor/VisualElementInspectorEditor.cs index f285b95..5395e34 100644 --- a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Samples/VisualElements/Scripts/Editor/VisualElementInspectorEditor.cs +++ b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Samples/VisualElements/Scripts/Editor/VisualElementInspectorEditor.cs @@ -11,7 +11,7 @@ public class VisualElementInspectorEditor : Editor { public override VisualElement CreateInspectorGUI() { - const string iconPath = "Editor/Aspid.UnityFastTools Icon"; + const string iconPath = "Aspid.UnityFastTools Icon"; var scriptName = target.GetScriptName(); var darkColor = new Color(0.15f, 0.15f, 0.15f); diff --git a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Editor/Extensions/EditorExtensions.cs b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Editor/Extensions/EditorExtensions.cs index 73fbebb..5015483 100644 --- a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Editor/Extensions/EditorExtensions.cs +++ b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Editor/Extensions/EditorExtensions.cs @@ -18,5 +18,34 @@ public static string GetScriptName(this Object obj) ? ObjectNames.GetInspectorTitle(obj) : ObjectNames.NicifyVariableName(targetType.Name); } + + public static string GetScriptNameWithIndex(this Component targetComponent) + { + if (targetComponent is null) return null; + + var type = targetComponent.GetType(); + var components = targetComponent.GetComponents(type); + + switch (components.Length) + { + case 0: + case 1: return targetComponent.GetScriptName(); + default: + { + var index = 0; + + foreach (var component in components) + { + if (component.GetType() != type) continue; + + index++; + if (component == targetComponent) + return $"{targetComponent.GetScriptName()} ({index})"; + } + + return targetComponent.GetScriptName(); + } + } + } } -} \ No newline at end of file +} diff --git a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Editor/SerializedProperties/SerializePropertyExtensions.SetValue.cs b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Editor/SerializedProperties/SerializePropertyExtensions.SetValue.cs index bac91c6..e12d334 100644 --- a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Editor/SerializedProperties/SerializePropertyExtensions.SetValue.cs +++ b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Editor/SerializedProperties/SerializePropertyExtensions.SetValue.cs @@ -482,7 +482,7 @@ public static T SetValueAndApply(this T property, Vector3Int value) public static T SetVector3Int(this T property, Vector3Int value) where T : SerializedProperty { - property.vector3Value = value; + property.vector3IntValue = value; return property; } diff --git a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Runtime/Enums/EnumValue.cs b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Runtime/Enums/EnumValue.cs index e2b9733..5a83777 100644 --- a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Runtime/Enums/EnumValue.cs +++ b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Runtime/Enums/EnumValue.cs @@ -34,7 +34,8 @@ internal void Initialize(Type type) } else { - throw new Exception($"[{nameof(EnumValue)}] [{nameof(Initialize)}]" + + // Not Exception. Because this is a visual error. + Debug.LogError($"[{nameof(EnumValue)}] [{nameof(Initialize)}]" + $"Couldn't parse key '{_key}' to Enum '{nameof(type)}'"); } } diff --git a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Runtime/Enums/EnumValues.cs b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Runtime/Enums/EnumValues.cs index e32a84c..6d070a5 100644 --- a/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Runtime/Enums/EnumValues.cs +++ b/Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Source/Runtime/Enums/EnumValues.cs @@ -21,7 +21,7 @@ public sealed class EnumValues : EnumValues, IEnumerable(this T helpBox, StyleLength value) + public static T SetHelpBoxFontSize(this T helpBox, StyleLength value) where T : HelpBox { helpBox.Q