diff --git a/Editor/Code/CSharpPreviewWindow/CSharpPreviewWindow.cs b/Editor/Code/CSharpPreviewWindow/CSharpPreviewWindow.cs index b87cc135..b88d73eb 100644 --- a/Editor/Code/CSharpPreviewWindow/CSharpPreviewWindow.cs +++ b/Editor/Code/CSharpPreviewWindow/CSharpPreviewWindow.cs @@ -46,17 +46,54 @@ public static void Open() window = win; } + private IGraph SelectedGraph; + private void OnEnable() { window = this; Selection.selectionChanged += OnSelectionChanged; OnSelectionChanged(); UpdateCodeDisplay(); + + GraphWindow.activeContextChanged += ActiveContextChanged; + + var activeContext = GraphWindow.activeContext; + if (activeContext != null) + { + ActiveContextChanged(activeContext); + } } private void OnDisable() { Selection.selectionChanged -= OnSelectionChanged; + if (SelectedGraph != null) + { + SelectedGraph.elements.CollectionChanged -= WatchElements; + } + GraphWindow.activeContextChanged -= ActiveContextChanged; + } + + private void ActiveContextChanged(IGraphContext context) + { + if (context == null) return; + + if (SelectedGraph != null) + { + SelectedGraph.elements.CollectionChanged -= WatchElements; + } + + SelectedGraph = context.graph; + + SelectedGraph.elements.CollectionChanged += WatchElements; + } + + private void WatchElements() + { + if (!Serialization.isSerializing) + RefreshPreview(); + else + EditorApplication.delayCall += () => RefreshPreview(); } private void OnSelectionChanged() diff --git a/Editor/Code/Descriptors/Nodes/AssetFieldUnitDescriptor.cs b/Editor/Code/Descriptors/Nodes/AssetFieldUnitDescriptor.cs index c49d5670..1e8fede7 100644 --- a/Editor/Code/Descriptors/Nodes/AssetFieldUnitDescriptor.cs +++ b/Editor/Code/Descriptors/Nodes/AssetFieldUnitDescriptor.cs @@ -17,22 +17,34 @@ public AssetFieldUnitDescriptor(AssetFieldUnit target) : base(target) protected override string DefinedSurtitle() { - return target.field.parentAsset.title; + if (target.field) + return target.field.parentAsset.title; + else + return base.DefinedSurtitle(); } protected override EditorTexture DefinedIcon() { - return target.field.type.Icon(); + if (target.field) + return target.field.type.Icon(); + else + return BoltCore.Icons.errorState; } protected override string DefinedTitle() { - return target.field.parentAsset.title + "." + target.field.FieldName; + if (target.field) + return target.field.parentAsset.title + "." + target.field.FieldName; + else + return "No Field Assigned"; } protected override string DefinedShortTitle() { - return target.field.FieldName; + if (target.field) + return target.field.FieldName; + else + return base.DefinedShortTitle(); } } diff --git a/Editor/Code/Editors/ClassAssetEditor.cs b/Editor/Code/Editors/ClassAssetEditor.cs index c51c60d1..32f7ba42 100644 --- a/Editor/Code/Editors/ClassAssetEditor.cs +++ b/Editor/Code/Editors/ClassAssetEditor.cs @@ -8,6 +8,7 @@ using UnityObject = UnityEngine.Object; using System.Reflection; using System.Runtime.CompilerServices; +using UnityEngine.Assemblies; namespace Unity.VisualScripting.Community.CSharp { @@ -45,7 +46,12 @@ protected override void OnExtendedVerticalHeaderGUI() private void GetAllInheritableTypes() { - inheritTypes ??= AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes()).Where(t => +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else + Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif + inheritTypes ??= assemblies.SelectMany(a => a.GetTypes()).Where(t => t.Is().Inheritable() && !NameUtility.TypeHasSpecialName(t) ).ToArray(); diff --git a/Editor/Code/Editors/DelegateAssetEditor.cs b/Editor/Code/Editors/DelegateAssetEditor.cs index 8a6cb685..b23a08dd 100644 --- a/Editor/Code/Editors/DelegateAssetEditor.cs +++ b/Editor/Code/Editors/DelegateAssetEditor.cs @@ -7,6 +7,7 @@ using Unity.VisualScripting.Community.Libraries.CSharp; using System.Linq; using System.Reflection; +using UnityEngine.Assemblies; namespace Unity.VisualScripting.Community.CSharp { @@ -40,7 +41,11 @@ static Type[] BuildDelegateTypeCache() { List list = new List(); +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int a = 0; a < assemblies.Length; a++) { diff --git a/Editor/Code/Editors/InterfaceAssetEditor.cs b/Editor/Code/Editors/InterfaceAssetEditor.cs index 2d61a1f7..c7372058 100644 --- a/Editor/Code/Editors/InterfaceAssetEditor.cs +++ b/Editor/Code/Editors/InterfaceAssetEditor.cs @@ -10,6 +10,7 @@ using ParameterModifier = Unity.VisualScripting.Community.Libraries.CSharp.ParameterModifier; using System; using System.Collections; +using UnityEngine.Assemblies; namespace Unity.VisualScripting.Community.CSharp { @@ -43,7 +44,13 @@ protected override void OnEnable() } shouldUpdate = true; - allTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(assembly => assembly.GetTypes()).ToArray(); +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else + Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif + + allTypes = assemblies.SelectMany(assembly => assembly.GetTypes()).ToArray(); CacheConstrainedAttributes(); } diff --git a/Editor/Code/Editors/MemberTypeAssetEditor.cs b/Editor/Code/Editors/MemberTypeAssetEditor.cs index 80a16923..a3d524b3 100644 --- a/Editor/Code/Editors/MemberTypeAssetEditor.cs +++ b/Editor/Code/Editors/MemberTypeAssetEditor.cs @@ -8,6 +8,7 @@ using Unity.VisualScripting.Community.Utility; using UnityEditor; using UnityEngine; +using UnityEngine.Assemblies; using ParameterModifier = Unity.VisualScripting.Community.Libraries.CSharp.ParameterModifier; namespace Unity.VisualScripting.Community.CSharp @@ -19,7 +20,7 @@ public abstract class MemberTypeAssetEditor AttributeParameters; protected Metadata attributes; @@ -712,7 +713,13 @@ protected override void OnEnable() if (Target.icon == null) Target.icon = DefaultIcon(); - allTypes = AppDomain.CurrentDomain.GetAssemblies() +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else + Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif + + allTypes = assemblies .SelectMany(assembly => assembly.GetTypes()).ToArray(); CacheConstrainedAttributes(); diff --git a/Editor/Code/Generators/BaseGraphGenerator.cs b/Editor/Code/Generators/BaseGraphGenerator.cs index 51621e2e..ef3a4933 100644 --- a/Editor/Code/Generators/BaseGraphGenerator.cs +++ b/Editor/Code/Generators/BaseGraphGenerator.cs @@ -437,7 +437,7 @@ private void GenerateEventMethods(ClassGenerator @class) if (i != 0) writer.NewLine(); WriteMethodBody(unit, data, inner); } - }); + }).NewLine(); } if (focusFalseUnits.Count > 0) @@ -452,7 +452,7 @@ private void GenerateEventMethods(ClassGenerator @class) if (i != 0) writer.NewLine(); WriteMethodBody(unit, data, inner); } - }); + }).NewLine(); } }); @@ -478,7 +478,7 @@ private void GenerateEventMethods(ClassGenerator @class) if (i != 0) writer.NewLine(); WriteMethodBody(unit, data, inner); } - }); + }).NewLine(); } if (pauseFalseUnits.Count > 0) @@ -493,7 +493,7 @@ private void GenerateEventMethods(ClassGenerator @class) if (i != 0) writer.NewLine(); WriteMethodBody(unit, data, inner); } - }); + }).NewLine(); } }); @@ -553,7 +553,6 @@ Unit is OnApplicationResume || specialUnitCode = GenerateSpecialUnitCode(@class, false); } #endif - if (isCoroutine) { string coroutineMethodName = GetMethodName(unit, true); @@ -588,7 +587,7 @@ Unit is OnApplicationResume || if (!methodBodies.TryGetValue(unityMethodName, out var unityMethod)) { - unityMethod = MethodGenerator.Method(AccessModifier.Private, MethodModifier.None, typeof(void), unityMethodName); + unityMethod = MethodGenerator.Method(generator?.AccessModifier ?? AccessModifier.Private, MethodModifier.None, typeof(void), unityMethodName); unityMethod.SetOwner(Unit); if (Unit is BoltNamedAnimationEvent || Unit is BoltAnimationEvent || Unit is BoltUnityEvent) { @@ -656,7 +655,7 @@ Unit is OnApplicationResume || if (!methodBodies.TryGetValue(unityMethodName, out var method)) { - method = MethodGenerator.Method(AccessModifier.Private, MethodModifier.None, typeof(void), unityMethodName); + method = MethodGenerator.Method(generator?.AccessModifier ?? AccessModifier.Private, MethodModifier.None, typeof(void), unityMethodName); method.SetOwner(Unit); if (Unit is BoltNamedAnimationEvent || Unit is BoltAnimationEvent || Unit is BoltUnityEvent) { diff --git a/Editor/Code/Generators/GameObjectGenerator.cs b/Editor/Code/Generators/GameObjectGenerator.cs index 98158aa4..5d778dae 100644 --- a/Editor/Code/Generators/GameObjectGenerator.cs +++ b/Editor/Code/Generators/GameObjectGenerator.cs @@ -11,7 +11,6 @@ namespace Unity.VisualScripting.Community.CSharp { - [Serializable] [CodeGenerator(typeof(GameObject))] public sealed class GameObjectGenerator : BaseGraphGenerator { diff --git a/Editor/Code/Generators/Nodes/Collections/AddListItemGenerator.cs b/Editor/Code/Generators/Nodes/Collections/AddListItemGenerator.cs index 22baf500..0dbd123f 100644 --- a/Editor/Code/Generators/Nodes/Collections/AddListItemGenerator.cs +++ b/Editor/Code/Generators/Nodes/Collections/AddListItemGenerator.cs @@ -1,7 +1,3 @@ -using Unity.VisualScripting; -using System; -using Unity.VisualScripting.Community.Libraries.CSharp; - namespace Unity.VisualScripting.Community.CSharp { [NodeGenerator(typeof(AddListItem))] diff --git a/Editor/Code/Generators/Nodes/Control/CooldownGenerator.cs b/Editor/Code/Generators/Nodes/Control/CooldownGenerator.cs index 6cf79b3d..d81cda3c 100644 --- a/Editor/Code/Generators/Nodes/Control/CooldownGenerator.cs +++ b/Editor/Code/Generators/Nodes/Control/CooldownGenerator.cs @@ -41,6 +41,14 @@ protected override void GenerateControlInternal(ControlInput input, ControlGener return; } + if (input == Unit.reset) + { + writer.WriteIndented(); + writer.InvokeMember(variableName.VariableHighlight(), "ResetCooldown"); + writer.WriteEnd(EndWriteOptions.LineEnd); + return; + } + if (!data.scopeGeneratorData.TryGetValue(Unit.enter, out _)) { data.scopeGeneratorData.Add(Unit.enter, true); @@ -66,12 +74,6 @@ protected override void GenerateControlInternal(ControlInput input, ControlGener writer.Action(() => GenerateValue(Unit.unscaledTime, data, writer))); writer.WriteEnd(EndWriteOptions.LineEnd); } - else if (input == Unit.reset) - { - writer.WriteIndented(); - writer.InvokeMember(variableName.VariableHighlight(), "ResetCooldown"); - writer.WriteEnd(EndWriteOptions.LineEnd); - } GenerateActionMethod(Unit.exitReady, data, writer); GenerateActionMethod(Unit.exitNotReady, data, writer); diff --git a/Editor/Code/Generators/Nodes/Control/ForEachGenerator.cs b/Editor/Code/Generators/Nodes/Control/ForEachGenerator.cs index 57b775ad..06a70518 100644 --- a/Editor/Code/Generators/Nodes/Control/ForEachGenerator.cs +++ b/Editor/Code/Generators/Nodes/Control/ForEachGenerator.cs @@ -48,6 +48,8 @@ protected override void GenerateControlInternal(ControlInput input, ControlGener variableName = data.AddLocalNameInScope("item", typeof(object), true); } + data.CreateSymbol(Unit, elementType); + writer.WriteIndented("foreach ".ControlHighlight()); writer.Parentheses(w => { @@ -96,20 +98,58 @@ protected override void GenerateControlInternal(ControlInput input, ControlGener protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) { + var expectedType = data.GetExpectedType(); + if (output == Unit.currentItem) { if (!data.ContainsNameInAncestorScope(variableName)) { - writer.WriteErrorDiagnostic($"{variableName}, can only be used inside the loop.", $"Could not find or access {variableName}"); + writer.WriteErrorDiagnostic($"{variableName}, can only be used inside the loop.", $"Could not find or access {variableName}", WriteOptions.IndentedNewLineAfter); return; } + if (Unit.dictionary) { writer.GetMember(variableName.VariableHighlight(), "Value"); + + if (expectedType == null) return; + + if (data.TryGetSymbol(Unit, out var symbol)) + { + var type = symbol.Type; + if (type.IsGenericType) + { + var itemType = type.GetGenericArguments()[1]; + + if (expectedType.IsAssignableFrom(itemType)) + data.MarkExpectedTypeMet(resolvedAs: itemType); + } + else if (type == typeof(DictionaryEntry)) + { + if (expectedType.IsAssignableFrom(typeof(object))) + data.MarkExpectedTypeMet(resolvedAs: typeof(object)); + } + else if (expectedType.IsAssignableFrom(type)) + { + data.MarkExpectedTypeMet(resolvedAs: type); + } + } } else { writer.Write(variableName.VariableHighlight()); + + if (expectedType == null) return; + + if (data.TryGetSymbol(Unit, out var symbol)) + { + var type = symbol.Type; + + if (expectedType.IsAssignableFrom(type)) + { + data.MarkExpectedTypeMet(resolvedAs: type); + } + } } return; @@ -117,16 +157,47 @@ protected override void GenerateValueInternal(ValueOutput output, ControlGenerat if (output == Unit.currentKey) { + if (!data.ContainsNameInAncestorScope(variableName)) { - writer.WriteErrorDiagnostic($"{variableName}, can only be used inside the loop.", $"Could not find or access {variableName}"); + writer.WriteErrorDiagnostic($"{variableName}, can only be used inside the loop.", $"Could not find or access {variableName}", WriteOptions.IndentedNewLineAfter); return; } + writer.GetMember(variableName.VariableHighlight(), "Key"); + + if (expectedType == null) return; + + if (data.TryGetSymbol(Unit, out var symbol)) + { + var type = symbol.Type; + if (type.IsGenericType) + { + var itemType = type.GetGenericArguments()[0]; + + if (expectedType.IsAssignableFrom(itemType)) + data.MarkExpectedTypeMet(resolvedAs: itemType); + } + else if (type == typeof(DictionaryEntry)) + { + if (expectedType.IsAssignableFrom(typeof(object))) + data.MarkExpectedTypeMet(resolvedAs: typeof(object)); + } + else if (expectedType.IsAssignableFrom(type)) + { + data.MarkExpectedTypeMet(resolvedAs: type); + } + } + return; } writer.Write(currentIndex.VariableHighlight()); + + if (expectedType != null && expectedType.IsAssignableFrom(typeof(int))) + { + data.MarkExpectedTypeMet(resolvedAs: typeof(int)); + } } protected override void GenerateValueInternal(ValueInput input, ControlGenerationData data, CodeWriter writer) diff --git a/Editor/Code/Generators/Nodes/Control/SwitchOnIntegerGenerator.cs b/Editor/Code/Generators/Nodes/Control/SwitchOnIntegerGenerator.cs index d611f859..d0a33a22 100644 --- a/Editor/Code/Generators/Nodes/Control/SwitchOnIntegerGenerator.cs +++ b/Editor/Code/Generators/Nodes/Control/SwitchOnIntegerGenerator.cs @@ -60,15 +60,15 @@ protected override void GenerateControlInternal(ControlInput input, ControlGener data.SetHasBroke(false); if (values[i].Value.hasValidConnection) { - data.NewScope(); - GenerateChildControl(values[i].Value, data, writer); - data.ExitScope(); + using (writer.IndentedScope(data)) + { + GenerateChildControl(values[i].Value, data, writer); + } } if ((data.MustBreak && !data.HasBroke) || (data.MustReturn && !data.HasReturned)) { - writer.WriteIndented(); - writer.Write("break".ControlHighlight()); + writer.WriteIndented("break".ControlHighlight(), 1); writer.Write(";"); writer.NewLine(); } @@ -84,15 +84,15 @@ protected override void GenerateControlInternal(ControlInput input, ControlGener data.SetHasBroke(false); if (Unit.@default.hasValidConnection) { - data.NewScope(); - GenerateChildControl(Unit.@default, data, writer); - data.ExitScope(); + using (writer.IndentedScope(data)) + { + GenerateChildControl(Unit.@default, data, writer); + } } if ((data.MustBreak && !data.HasBroke) || (data.MustReturn && !data.HasReturned)) { - writer.WriteIndented(); - writer.Write("break".ControlHighlight()); + writer.WriteIndented("break".ControlHighlight(), 1); writer.Write(";"); writer.NewLine(); } diff --git a/Editor/Code/Generators/Nodes/Control/TriggerReturnEventGenerator.cs b/Editor/Code/Generators/Nodes/Control/TriggerReturnEventGenerator.cs index b689a184..cc4f216f 100644 --- a/Editor/Code/Generators/Nodes/Control/TriggerReturnEventGenerator.cs +++ b/Editor/Code/Generators/Nodes/Control/TriggerReturnEventGenerator.cs @@ -144,7 +144,6 @@ protected override void GenerateControlInternal(ControlInput input, ControlGener public IEnumerable GetRequiredVariables(ControlGenerationData data) { - name = data.AddLocalNameInScope(name, typeof(object)); var field = FieldGenerator.Field(AccessModifier.Private, FieldModifier.None, typeof(object), name); yield return field; } diff --git a/Editor/Code/Generators/Nodes/Control/TryCatchGenerator.cs b/Editor/Code/Generators/Nodes/Control/TryCatchGenerator.cs index 5517a56d..7760acc2 100644 --- a/Editor/Code/Generators/Nodes/Control/TryCatchGenerator.cs +++ b/Editor/Code/Generators/Nodes/Control/TryCatchGenerator.cs @@ -33,7 +33,7 @@ protected override void GenerateControlInternal(ControlInput input, ControlGener if (!Unit.@catch.hasValidConnection && !Unit.@finally.hasValidConnection) { using (writer.CodeDiagnosticScope("Catch or Finally requires connection", CodeDiagnosticKind.Warning)) - writer.Error("Expected catch or finally block"); + writer.Error("Expected catch or finally block", WriteOptions.IndentedNewLineAfter); return; } diff --git a/Editor/Code/Generators/Nodes/Control/WaitForManualPressGenerator.cs b/Editor/Code/Generators/Nodes/Control/WaitForManualPressGenerator.cs index 8323ab04..eb782092 100644 --- a/Editor/Code/Generators/Nodes/Control/WaitForManualPressGenerator.cs +++ b/Editor/Code/Generators/Nodes/Control/WaitForManualPressGenerator.cs @@ -36,7 +36,7 @@ protected override void GenerateControlInternal(ControlInput input, ControlGener public IEnumerable GetRequiredMethods(ControlGenerationData data) { var method = MethodGenerator.Method(AccessModifier.Private, MethodModifier.None, typeof(void), data.AddMethodName("WaitForPress")); - method.Body(w => w.Write($"{Name.VariableHighlight()} = {"false".ConstructHighlight()};").NewLine()); + method.Body(w => w.WriteIndented($"{Name.VariableHighlight()} = {"false".ConstructHighlight()};").NewLine()); var attribute = AttributeGenerator.Attribute(); attribute.AddParameter($"Trigger_{Name}"); method.AddAttribute(attribute); diff --git a/Editor/Code/Generators/Nodes/Events/CustomEvent/ChannelEventGenerator.cs b/Editor/Code/Generators/Nodes/Events/CustomEvent/ChannelEventGenerator.cs index 263d18d0..6f882472 100644 --- a/Editor/Code/Generators/Nodes/Events/CustomEvent/ChannelEventGenerator.cs +++ b/Editor/Code/Generators/Nodes/Events/CustomEvent/ChannelEventGenerator.cs @@ -5,7 +5,7 @@ using UnityEngine; using Unity.VisualScripting.Community.Utility; using Unity.VisualScripting.Community.Libraries.Humility; - +using static Unity.VisualScripting.Round; namespace Unity.VisualScripting.Community.CSharp { [NodeGenerator(typeof(ChannelEvent))] @@ -34,7 +34,8 @@ public override void GenerateAwakeCode(ControlGenerationData data, CodeWriter wr GetNormalCode(data, writer); } } - writer.Write(");"); + writer.NewLine(); + writer.Write("});", WriteOptions.IndentedNewLineAfter); } private void GetCoroutineCode(ControlGenerationData data, CodeWriter writer) diff --git a/Editor/Code/Generators/Nodes/Events/DefinedEvent/DefinedEventNodeGenerator.cs b/Editor/Code/Generators/Nodes/Events/DefinedEvent/DefinedEventNodeGenerator.cs index 8d4d978c..e2834917 100644 --- a/Editor/Code/Generators/Nodes/Events/DefinedEvent/DefinedEventNodeGenerator.cs +++ b/Editor/Code/Generators/Nodes/Events/DefinedEvent/DefinedEventNodeGenerator.cs @@ -1,11 +1,8 @@ using System; using Unity.VisualScripting.Community.Libraries.CSharp; using System.Collections.Generic; -using Unity.VisualScripting; -using UnityEngine; using Unity.VisualScripting.Community.Utility; using System.Linq; -using Unity.VisualScripting.Community.Libraries.Humility; using System.Collections; namespace Unity.VisualScripting.Community.CSharp @@ -99,7 +96,6 @@ public IEnumerable GetRequiredMethods(ControlGenerationData dat public IEnumerable GetRequiredVariables(ControlGenerationData data) { - eventVariableName = data.AddLocalNameInScope(eventVariableName); var field = FieldGenerator.Field(AccessModifier.Private, FieldModifier.None, typeof(IDisposable), eventVariableName); yield return field; } diff --git a/Editor/Code/Generators/Nodes/Events/DefinedEvent/GlobalDefinedEventNodeGenerator.cs b/Editor/Code/Generators/Nodes/Events/DefinedEvent/GlobalDefinedEventNodeGenerator.cs index f68cf096..4538b253 100644 --- a/Editor/Code/Generators/Nodes/Events/DefinedEvent/GlobalDefinedEventNodeGenerator.cs +++ b/Editor/Code/Generators/Nodes/Events/DefinedEvent/GlobalDefinedEventNodeGenerator.cs @@ -97,7 +97,6 @@ public IEnumerable GetRequiredMethods(ControlGenerationData dat public IEnumerable GetRequiredVariables(ControlGenerationData data) { - eventVariableName = data.AddLocalNameInScope(eventVariableName); var field = FieldGenerator.Field(AccessModifier.Private, FieldModifier.None, typeof(IDisposable), eventVariableName); yield return field; } diff --git a/Editor/Code/Generators/Nodes/Events/Listeners/OnEveryXSecondsGenerator.cs b/Editor/Code/Generators/Nodes/Events/Listeners/OnEveryXSecondsGenerator.cs index 3eb16823..2a757e3c 100644 --- a/Editor/Code/Generators/Nodes/Events/Listeners/OnEveryXSecondsGenerator.cs +++ b/Editor/Code/Generators/Nodes/Events/Listeners/OnEveryXSecondsGenerator.cs @@ -42,7 +42,6 @@ public override void GenerateUpdateCode(ControlGenerationData data, CodeWriter w public IEnumerable GetRequiredVariables(ControlGenerationData data) { - name = data.AddLocalNameInScope(name.LegalMemberName(), typeof(OnEveryXSecondsLogic)); var variable = FieldGenerator.Field(AccessModifier.Private, FieldModifier.None, typeof(OnEveryXSecondsLogic), name); variable.Default(new OnEveryXSecondsLogic()); variable.SetNewlineLiteral(false); diff --git a/Editor/Code/Generators/Nodes/Events/Listeners/OnRetrievedGenerator.cs b/Editor/Code/Generators/Nodes/Events/Listeners/OnRetrievedGenerator.cs index 9609f5e9..46fc0144 100644 --- a/Editor/Code/Generators/Nodes/Events/Listeners/OnRetrievedGenerator.cs +++ b/Editor/Code/Generators/Nodes/Events/Listeners/OnRetrievedGenerator.cs @@ -30,8 +30,10 @@ protected override void GenerateValueInternal(ValueOutput output, ControlGenerat public override void GenerateAwakeCode(ControlGenerationData data, CodeWriter writer) { + if (!Unit.trigger.hasValidConnection) return; + writer.WriteIndented(); - writer.InvokeMember(typeof(EventBus), "Register", new CodeWriter.TypeParameter[] { typeof(PoolData) }, + writer.InvokeMember(typeof(EventBus), "Register", new CodeWriter.TypeParameter[] { typeof(PoolData) }, writer.Action(() => writer.GetMember(typeof(CommunityEvents), "OnRetrieved")), writer.Action(() => writer.Write(methodName.VariableHighlight())) ); @@ -50,7 +52,8 @@ public IEnumerable GetRequiredMethods(ControlGenerationData dat methodName = data.AddMethodName(methodName); var method = MethodGenerator.Method(AccessModifier.Private, MethodModifier.None, typeof(void), methodName); method.AddParameter(ParameterGenerator.Parameter("args", typeof(PoolData), ParameterModifier.None)); - method.Body(writer => { + method.Body(writer => + { writer.WriteIndented("if".ControlHighlight()); writer.Write(" ("); writer.GetMember("args".VariableHighlight(), "pool"); diff --git a/Editor/Code/Generators/Nodes/Events/Listeners/OnReturnedGenerator.cs b/Editor/Code/Generators/Nodes/Events/Listeners/OnReturnedGenerator.cs index 7af9c849..5479c56c 100644 --- a/Editor/Code/Generators/Nodes/Events/Listeners/OnReturnedGenerator.cs +++ b/Editor/Code/Generators/Nodes/Events/Listeners/OnReturnedGenerator.cs @@ -30,8 +30,10 @@ protected override void GenerateValueInternal(ValueOutput output, ControlGenerat public override void GenerateAwakeCode(ControlGenerationData data, CodeWriter writer) { + if (!Unit.trigger.hasValidConnection) return; + writer.WriteIndented(); - writer.InvokeMember(typeof(EventBus), "Register", new CodeWriter.TypeParameter[] { typeof(PoolData) }, + writer.InvokeMember(typeof(EventBus), "Register", new CodeWriter.TypeParameter[] { typeof(PoolData) }, writer.Action(() => writer.GetMember(typeof(CommunityEvents), "OnReturned")), writer.Action(() => writer.Write(methodName.VariableHighlight())) ); @@ -50,7 +52,8 @@ public IEnumerable GetRequiredMethods(ControlGenerationData dat methodName = data.AddMethodName(methodName); var method = MethodGenerator.Method(AccessModifier.Private, MethodModifier.None, typeof(void), methodName); method.AddParameter(ParameterGenerator.Parameter("args", typeof(PoolData), ParameterModifier.None)); - method.Body(writer => { + method.Body(writer => + { writer.WriteIndented("if".ControlHighlight()); writer.Write(" ("); writer.GetMember("args".VariableHighlight(), "pool"); diff --git a/Editor/Code/Generators/Nodes/Events/ReturnEventGenerator.cs b/Editor/Code/Generators/Nodes/Events/ReturnEventGenerator.cs index 0b786a0b..9ecace7f 100644 --- a/Editor/Code/Generators/Nodes/Events/ReturnEventGenerator.cs +++ b/Editor/Code/Generators/Nodes/Events/ReturnEventGenerator.cs @@ -76,15 +76,24 @@ protected override void GenerateCode(ControlInput input, ControlGenerationData d public IEnumerable GetRequiredMethods(ControlGenerationData data) { name = data.AddMethodName(name); - var method = MethodGenerator.Method(AccessModifier.Private, MethodModifier.None, typeof(void), name); - method.AddParameter(ParameterGenerator.Parameter("args", typeof(ReturnEventArg), ParameterModifier.None)); + var runnerMethod = MethodGenerator.Method(AccessModifier.Private, MethodModifier.None, typeof(void), name); + runnerMethod.AddParameter(ParameterGenerator.Parameter("args", typeof(ReturnEventArg), ParameterModifier.None)); data.AddLocalNameInScope("args"); - method.Body(writer => + runnerMethod.Body(writer => { writer.WriteIndented(Unit.coroutine ? $"StartCoroutine({name}({"args".VariableHighlight()}))" : Name + $"({"args".VariableHighlight()})"); writer.Write(";"); writer.NewLine(); }); + yield return runnerMethod; + + var method = MethodGenerator.Method(AccessModifier.Private, MethodModifier.None, typeof(void), Name); + method.AddParameter(ParameterGenerator.Parameter("args", typeof(ReturnEventArg), ParameterModifier.None)); + data.AddLocalNameInScope("args"); + method.Body(writer => + { + GenerateCode(null, data, writer); + }); yield return method; } } diff --git a/Editor/Code/Generators/Nodes/Events/UnityEvents/OnKeysPressedGenerator.cs b/Editor/Code/Generators/Nodes/Events/UnityEvents/OnKeysPressedGenerator.cs index 007d84aa..b64f70c8 100644 --- a/Editor/Code/Generators/Nodes/Events/UnityEvents/OnKeysPressedGenerator.cs +++ b/Editor/Code/Generators/Nodes/Events/UnityEvents/OnKeysPressedGenerator.cs @@ -61,7 +61,6 @@ protected override void GenerateCode(ControlInput input, ControlGenerationData d public IEnumerable GetRequiredVariables(ControlGenerationData data) { - name = data.AddLocalNameInScope(name.LegalMemberName(), typeof(OnMultiKeyPressLogic)); var variable = FieldGenerator.Field(AccessModifier.Private, FieldModifier.None, typeof(OnMultiKeyPressLogic), name); variable.Default(new OnMultiKeyPressLogic()); variable.SetNewlineLiteral(false); diff --git a/Editor/Code/Generators/Nodes/Inherited/Asset/Methods/AssetMethodCallUnitGenerator.cs b/Editor/Code/Generators/Nodes/Inherited/Asset/Methods/AssetMethodCallUnitGenerator.cs index 8bbf1c8a..0a072fad 100644 --- a/Editor/Code/Generators/Nodes/Inherited/Asset/Methods/AssetMethodCallUnitGenerator.cs +++ b/Editor/Code/Generators/Nodes/Inherited/Asset/Methods/AssetMethodCallUnitGenerator.cs @@ -90,7 +90,7 @@ private void GenerateArguments(CodeWriter writer, ControlGenerationData data) if (!input.hasValidConnection || (input.hasValidConnection && !input.connection.source.unit.IsValidRefUnit())) { - writer.Error($"{input.key.Replace("%", "")} needs connection to a Get Variable or Get Member unit"); + writer.Error($"{input.key.Replace("%", "")} needs connection to a Get Variable or a Settable Get Member unit"); continue; } diff --git a/Editor/Code/Generators/Nodes/Inherited/Base/Methods/BaseMethodCallGenerator.cs b/Editor/Code/Generators/Nodes/Inherited/Base/Methods/BaseMethodCallGenerator.cs index 3be5abc5..d1c9d85a 100644 --- a/Editor/Code/Generators/Nodes/Inherited/Base/Methods/BaseMethodCallGenerator.cs +++ b/Editor/Code/Generators/Nodes/Inherited/Base/Methods/BaseMethodCallGenerator.cs @@ -96,7 +96,7 @@ private void GenerateArguments(CodeWriter writer, ControlGenerationData data) if (!input.hasValidConnection || (input.hasValidConnection && !input.connection.source.unit.IsValidRefUnit())) { - writer.Error($"{input.key.Replace("%", "")} needs connection to a Get Variable or Get Member unit"); + writer.Error($"{input.key.Replace("%", "")} needs connection to a Get Variable or a Settable Get Member unit"); continue; } diff --git a/Editor/Code/Generators/Nodes/Inherited/Inherited/Methods/InheritedMethodCallGenerator.cs b/Editor/Code/Generators/Nodes/Inherited/Inherited/Methods/InheritedMethodCallGenerator.cs index a517351a..44b9f8f0 100644 --- a/Editor/Code/Generators/Nodes/Inherited/Inherited/Methods/InheritedMethodCallGenerator.cs +++ b/Editor/Code/Generators/Nodes/Inherited/Inherited/Methods/InheritedMethodCallGenerator.cs @@ -96,7 +96,7 @@ private void GenerateArguments(CodeWriter writer, ControlGenerationData data) if (!input.hasValidConnection || (input.hasValidConnection && !input.connection.source.unit.IsValidRefUnit())) { - writer.Error($"{input.key.Replace("%", "")} needs connection to a Get Variable or Get Member unit"); + writer.Error($"{input.key.Replace("%", "")} needs connection to a Get Variable or a Settable Get Member unit"); continue; } diff --git a/Editor/Code/Generators/Nodes/Logic/AndGenerator.cs b/Editor/Code/Generators/Nodes/Logic/AndGenerator.cs index a47385e7..75155a90 100644 --- a/Editor/Code/Generators/Nodes/Logic/AndGenerator.cs +++ b/Editor/Code/Generators/Nodes/Logic/AndGenerator.cs @@ -1,25 +1,12 @@ -using Unity.VisualScripting; -using Unity.VisualScripting.Community.Libraries.CSharp; - -namespace Unity.VisualScripting.Community.CSharp +namespace Unity.VisualScripting.Community.CSharp { [NodeGenerator(typeof(And))] - public sealed class AndGenerator : NodeGenerator + public sealed class AndGenerator : LogicalOperatorGenerator { - public AndGenerator(And unit) : base(unit) - { - } - - protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) - { - if (output == Unit.result) - { - writer.Write("("); - GenerateValue(Unit.a, data, writer); - writer.Write(" && "); - GenerateValue(Unit.b, data, writer); - writer.Write(")"); - } - } + public AndGenerator(And unit) : base(unit) { } + protected override ValueInput LeftInput => Unit.a; + protected override ValueInput RightInput => Unit.b; + protected override ValueOutput OutputPort => Unit.result; + protected override string OperatorToken => " && "; } } \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Logic/BinaryOperatorGenerator.cs b/Editor/Code/Generators/Nodes/Logic/BinaryOperatorGenerator.cs new file mode 100644 index 00000000..f633a2c6 --- /dev/null +++ b/Editor/Code/Generators/Nodes/Logic/BinaryOperatorGenerator.cs @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Unity.VisualScripting; +using Unity.VisualScripting.Community.Libraries.CSharp; +using UnityEngine; + +namespace Unity.VisualScripting.Community.CSharp +{ + public abstract class BinaryComparisonGenerator : NodeGenerator where TUnit : Unit + { + protected BinaryComparisonGenerator(TUnit unit) : base(unit) + { + } + + protected abstract ValueInput LeftInput { get; } + protected abstract ValueInput RightInput { get; } + protected abstract ValueOutput OutputPort { get; } + protected abstract string OperatorToken { get; } + protected abstract string OperatorMethodName { get; } + + private static readonly List NumericOrder = new List + { + typeof(int), typeof(long), typeof(float), typeof(double), typeof(decimal) + }; + + #region Custom Operator Lookup Caching + private static readonly HashSet<(Type Left, Type Right, string Method)> KnownOperators = new HashSet<(Type Left, Type Right, string Method)>(); + private static readonly HashSet<(Type Left, Type Right, string Method)> MissingOperators = new HashSet<(Type Left, Type Right, string Method)>(); + #endregion + + protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) + { + if (output == OutputPort) + { + var leftSourceType = GetSourceType(LeftInput, data, writer, false); + var rightSourceType = GetSourceType(RightInput, data, writer, false); + + var comparisonType = InferComparisonType(leftSourceType, rightSourceType); + + writer.Write("("); + + using (data.Expect(comparisonType)) + { + GenerateValue(LeftInput, data, writer); + } + + writer.Write(OperatorToken); + + using (data.Expect(comparisonType)) + { + GenerateValue(RightInput, data, writer); + } + + writer.Write(")"); + } + } + + protected override void GenerateValueInternal(ValueInput input, ControlGenerationData data, CodeWriter writer) + { + if (input == LeftInput || input == RightInput) + { + if (input.hasValidConnection) + { + if (input.type != typeof(object)) + { + Type actualSourceType = GetSourceType(input, data, writer, false); + Type expectedType = data.GetExpectedType(); + + if (expectedType != null && actualSourceType != null) + { + bool isStandardCsharpAssignment = expectedType.IsAssignableFrom(actualSourceType); + + ConversionUtility.ConversionType conversionType = ConversionUtility.GetRequiredConversion(actualSourceType, expectedType); + + bool isCsharpExpressionSafe = conversionType == ConversionUtility.ConversionType.Identity || + conversionType == ConversionUtility.ConversionType.Upcast || + conversionType == ConversionUtility.ConversionType.NumericImplicit || + conversionType == ConversionUtility.ConversionType.UserDefinedImplicit; + + bool naturallyCompatible = isStandardCsharpAssignment || isCsharpExpressionSafe; + + if (!naturallyCompatible) + { + writer.Write($"({writer.GetTypeNameHighlighted(expectedType)})"); + GenerateConnectedValue(input, data, writer, false); + return; + } + } + } + + GenerateConnectedValue(input, data, writer); + return; + } + + using (writer.BeginNode(input.unit as Unit)) + { + if (input.hasDefaultValue) + { + WriteDefaultValue(input, data, writer); + return; + } + + writer.Write($"/* \"{input.key} Requires Input\" */".ErrorHighlight()); + } + } + } + + private Type InferComparisonType(Type left, Type right) + { + if (left == null && right == null) return typeof(float); + if (left == null) left = typeof(object); + if (right == null) right = typeof(object); + + if (HasCustomOperator(left, right, OperatorMethodName)) return left; + if (HasCustomOperator(right, left, OperatorMethodName)) return right; + + if (left == typeof(object) && right != typeof(object)) return right; + if (right == typeof(object) && left != typeof(object)) return left; + if (left == typeof(object) && right == typeof(object)) return typeof(float); + + int leftIndex = NumericOrder.IndexOf(left); + int rightIndex = NumericOrder.IndexOf(right); + + if (leftIndex >= 0 && rightIndex >= 0) + { + return leftIndex >= rightIndex ? left : right; + } + + return left; + } + + private static bool HasCustomOperator(Type left, Type right, string methodName) + { + if (left == null || right == null || string.IsNullOrEmpty(methodName)) return false; + + var lookupKey = (left, right, methodName); + if (KnownOperators.Contains(lookupKey)) return true; + if (MissingOperators.Contains(lookupKey)) return false; + + var op = left.GetMethods(BindingFlags.Public | BindingFlags.Static) + .FirstOrDefault(m => m.Name == methodName && m.GetParameters().Length == 2 && + m.GetParameters()[0].ParameterType == left && + m.GetParameters()[1].ParameterType == right); + + if (op != null) + { + KnownOperators.Add(lookupKey); + return true; + } + + MissingOperators.Add(lookupKey); + return false; + } + } +} \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Logic/BinaryOperatorGenerator.cs.meta b/Editor/Code/Generators/Nodes/Logic/BinaryOperatorGenerator.cs.meta new file mode 100644 index 00000000..85f61478 --- /dev/null +++ b/Editor/Code/Generators/Nodes/Logic/BinaryOperatorGenerator.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 37ebe2b5ce6a79641b4c558b9becca7d \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Logic/EqualGenerator.cs b/Editor/Code/Generators/Nodes/Logic/EqualGenerator.cs index 0e1ee3e2..9bcfba16 100644 --- a/Editor/Code/Generators/Nodes/Logic/EqualGenerator.cs +++ b/Editor/Code/Generators/Nodes/Logic/EqualGenerator.cs @@ -6,64 +6,13 @@ namespace Unity.VisualScripting.Community.CSharp { [NodeGenerator(typeof(Equal))] - public sealed class EqualGenerator : NodeGenerator + public sealed class EqualGenerator : BinaryComparisonGenerator { - public EqualGenerator(Equal unit) : base(unit) - { - } - - protected override void GenerateValueInternal(ValueInput input, ControlGenerationData data, CodeWriter writer) - { - if (input == Unit.a) - { - if (Unit.a.hasValidConnection) - { - IDisposable expectScope = null; - if (Unit.b.hasValidConnection && NodeGeneration.IsSourceLiteral(Unit.b, out var type)) - { - expectScope = data.Expect(type); - } - - GenerateConnectedValue(Unit.a, data, writer, false); - - expectScope?.Dispose(); - return; - } - } - - if (input == Unit.b) - { - if (Unit.b.hasAnyConnection) - { - IDisposable expectScope = null; - if (Unit.a.hasValidConnection && NodeGeneration.IsSourceLiteral(Unit.a, out var type)) - { - expectScope = data.Expect(type); - } - - GenerateConnectedValue(Unit.b, data, writer, false); - - expectScope?.Dispose(); - return; - } - else if (Unit.numeric) - { - writer.Object(Unit.defaultValues["b"]); - return; - } - } - - base.GenerateValueInternal(input, data, writer); - } - - protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) - { - if (output == Unit.comparison) - { - GenerateValue(Unit.a, data, writer); - writer.Write(" == "); - GenerateValue(Unit.b, data, writer); - } - } + public EqualGenerator(Equal unit) : base(unit) { } + protected override ValueInput LeftInput => Unit.a; + protected override ValueInput RightInput => Unit.b; + protected override ValueOutput OutputPort => Unit.comparison; + protected override string OperatorToken => " == "; + protected override string OperatorMethodName => "op_Equality"; } } \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Logic/ExclusiveOrGenerator.cs b/Editor/Code/Generators/Nodes/Logic/ExclusiveOrGenerator.cs index d5659967..4bd977fc 100644 --- a/Editor/Code/Generators/Nodes/Logic/ExclusiveOrGenerator.cs +++ b/Editor/Code/Generators/Nodes/Logic/ExclusiveOrGenerator.cs @@ -1,25 +1,16 @@ -using Unity.VisualScripting; -using Unity.VisualScripting.Community.Libraries.CSharp; - -namespace Unity.VisualScripting.Community.CSharp +namespace Unity.VisualScripting.Community.CSharp { [NodeGenerator(typeof(ExclusiveOr))] - public sealed class ExclusiveOrGenerator : NodeGenerator + public sealed class ExclusiveOrGenerator : BinaryComparisonGenerator { public ExclusiveOrGenerator(ExclusiveOr unit) : base(unit) { } - protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) - { - if (output == Unit.result) - { - writer.Write("("); - GenerateValue(Unit.a, data, writer); - writer.Write(" ^ "); - GenerateValue(Unit.b, data, writer); - writer.Write(")"); - } - } + protected override ValueInput LeftInput => Unit.a; + protected override ValueInput RightInput => Unit.b; + protected override ValueOutput OutputPort => Unit.result; + protected override string OperatorToken => " ^ "; + protected override string OperatorMethodName => "op_ExclusiveOr"; } } \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Logic/GreaterGenerator.cs b/Editor/Code/Generators/Nodes/Logic/GreaterGenerator.cs index e47129f1..50123467 100644 --- a/Editor/Code/Generators/Nodes/Logic/GreaterGenerator.cs +++ b/Editor/Code/Generators/Nodes/Logic/GreaterGenerator.cs @@ -1,24 +1,13 @@ -using Unity.VisualScripting; -using Unity.VisualScripting.Community.Libraries.CSharp; -using Unity.VisualScripting.Community.Libraries.Humility; - -namespace Unity.VisualScripting.Community.CSharp +namespace Unity.VisualScripting.Community.CSharp { [NodeGenerator(typeof(Greater))] - public sealed class GreaterGenerator : NodeGenerator + public sealed class GreaterGenerator : BinaryComparisonGenerator { - public GreaterGenerator(Greater unit) : base(unit) - { - } - - protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) - { - if (output == Unit.comparison) - { - GenerateValue(Unit.a, data, writer); - writer.Write(" > "); - GenerateValue(Unit.b, data, writer); - } - } + public GreaterGenerator(Greater unit) : base(unit) { } + protected override ValueInput LeftInput => Unit.a; + protected override ValueInput RightInput => Unit.b; + protected override ValueOutput OutputPort => Unit.comparison; + protected override string OperatorToken => " > "; + protected override string OperatorMethodName => "op_GreaterThan"; } } \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Logic/GreaterOrEqualGenerator.cs b/Editor/Code/Generators/Nodes/Logic/GreaterOrEqualGenerator.cs index e0c335c4..3c9689de 100644 --- a/Editor/Code/Generators/Nodes/Logic/GreaterOrEqualGenerator.cs +++ b/Editor/Code/Generators/Nodes/Logic/GreaterOrEqualGenerator.cs @@ -1,24 +1,13 @@ -using Unity.VisualScripting; -using Unity.VisualScripting.Community.Libraries.CSharp; -using Unity.VisualScripting.Community.Libraries.Humility; - -namespace Unity.VisualScripting.Community.CSharp +namespace Unity.VisualScripting.Community.CSharp { [NodeGenerator(typeof(GreaterOrEqual))] - public sealed class GreaterOrEqualGenerator : NodeGenerator + public sealed class GreaterOrEqualGenerator : BinaryComparisonGenerator { - public GreaterOrEqualGenerator(GreaterOrEqual unit) : base(unit) - { - } - - protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) - { - if (output == Unit.comparison) - { - GenerateValue(Unit.a, data, writer); - writer.Write(" >= "); - GenerateValue(Unit.b, data, writer); - } - } + public GreaterOrEqualGenerator(GreaterOrEqual unit) : base(unit) { } + protected override ValueInput LeftInput => Unit.a; + protected override ValueInput RightInput => Unit.b; + protected override ValueOutput OutputPort => Unit.comparison; + protected override string OperatorToken => " >= "; + protected override string OperatorMethodName => "op_GreaterThanOrEqual"; } } \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Logic/LessGenerator.cs b/Editor/Code/Generators/Nodes/Logic/LessGenerator.cs index a969f9e4..5464bc29 100644 --- a/Editor/Code/Generators/Nodes/Logic/LessGenerator.cs +++ b/Editor/Code/Generators/Nodes/Logic/LessGenerator.cs @@ -1,24 +1,13 @@ -using Unity.VisualScripting; -using Unity.VisualScripting.Community.Libraries.CSharp; -using Unity.VisualScripting.Community.Libraries.Humility; - -namespace Unity.VisualScripting.Community.CSharp +namespace Unity.VisualScripting.Community.CSharp { [NodeGenerator(typeof(Less))] - public sealed class LessGenerator : NodeGenerator + public sealed class LessGenerator : BinaryComparisonGenerator { - public LessGenerator(Less unit) : base(unit) - { - } - - protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) - { - if (output == Unit.comparison) - { - GenerateValue(Unit.a, data, writer); - writer.Write(" < "); - GenerateValue(Unit.b, data, writer); - } - } + public LessGenerator(Less unit) : base(unit) { } + protected override ValueInput LeftInput => Unit.a; + protected override ValueInput RightInput => Unit.b; + protected override ValueOutput OutputPort => Unit.comparison; + protected override string OperatorToken => " < "; + protected override string OperatorMethodName => "op_LessThan"; } } \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Logic/LessOrEqualGenerator.cs b/Editor/Code/Generators/Nodes/Logic/LessOrEqualGenerator.cs index 9e23639a..7e166d21 100644 --- a/Editor/Code/Generators/Nodes/Logic/LessOrEqualGenerator.cs +++ b/Editor/Code/Generators/Nodes/Logic/LessOrEqualGenerator.cs @@ -1,24 +1,13 @@ -using Unity.VisualScripting; -using Unity.VisualScripting.Community.Libraries.CSharp; -using Unity.VisualScripting.Community.Libraries.Humility; - -namespace Unity.VisualScripting.Community.CSharp +namespace Unity.VisualScripting.Community.CSharp { - [NodeGenerator(typeof(LessOrEqual))] - public sealed class LessOrEqualGenerator : NodeGenerator +[NodeGenerator(typeof(LessOrEqual))] + public sealed class LessOrEqualGenerator : BinaryComparisonGenerator { - public LessOrEqualGenerator(LessOrEqual unit) : base(unit) - { - } - - protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) - { - if (output == Unit.comparison) - { - GenerateValue(Unit.a, data, writer); - writer.Write(" <= "); - GenerateValue(Unit.b, data, writer); - } - } + public LessOrEqualGenerator(LessOrEqual unit) : base(unit) { } + protected override ValueInput LeftInput => Unit.a; + protected override ValueInput RightInput => Unit.b; + protected override ValueOutput OutputPort => Unit.comparison; + protected override string OperatorToken => " <= "; + protected override string OperatorMethodName => "op_LessThanOrEqual"; } } \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Logic/LiteralGenerator.cs b/Editor/Code/Generators/Nodes/Logic/LiteralGenerator.cs index b0184730..72deb317 100644 --- a/Editor/Code/Generators/Nodes/Logic/LiteralGenerator.cs +++ b/Editor/Code/Generators/Nodes/Logic/LiteralGenerator.cs @@ -15,7 +15,7 @@ public LiteralGenerator(Literal unit) : base(unit) public override IEnumerable GetNamespaces() { - var @namespace = Unit.type?.Namespace ?? Unit.value.GetType().Namespace; + var @namespace = Unit.type?.Namespace ?? Unit.value?.GetType().Namespace; if (!string.IsNullOrEmpty(@namespace)) yield return @namespace; diff --git a/Editor/Code/Generators/Nodes/Logic/LogicalOperatorGenerator.cs b/Editor/Code/Generators/Nodes/Logic/LogicalOperatorGenerator.cs new file mode 100644 index 00000000..b99ebc59 --- /dev/null +++ b/Editor/Code/Generators/Nodes/Logic/LogicalOperatorGenerator.cs @@ -0,0 +1,56 @@ +using System; + +namespace Unity.VisualScripting.Community.CSharp +{ + public abstract class LogicalOperatorGenerator : NodeGenerator where TUnit : Unit + { + protected LogicalOperatorGenerator(TUnit unit) : base(unit) { } + + protected abstract ValueInput LeftInput { get; } + protected abstract ValueInput RightInput { get; } + protected abstract ValueOutput OutputPort { get; } + protected abstract string OperatorToken { get; } + + protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) + { + if (output == OutputPort) + { + writer.Write("("); + using (data.Expect(typeof(bool))) + { + GenerateValue(LeftInput, data, writer); + } + writer.Write(OperatorToken); + using (data.Expect(typeof(bool))) + { + GenerateValue(RightInput, data, writer); + } + writer.Write(")"); + } + } + + protected override void GenerateValueInternal(ValueInput input, ControlGenerationData data, CodeWriter writer) + { + if (input == LeftInput || input == RightInput) + { + if (input.hasValidConnection) + { + Type actualSourceType = GetSourceType(input, data, writer, false); + if (actualSourceType != null && actualSourceType != typeof(bool)) + { + writer.Write(writer.GetTypeNameHighlighted(typeof(bool))); + } + GenerateConnectedValue(input, data, writer); + return; + } + + if (input.hasDefaultValue) + { + WriteDefaultValue(input, data, writer); + return; + } + writer.Write("false"); + } + } + } +} \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Logic/LogicalOperatorGenerator.cs.meta b/Editor/Code/Generators/Nodes/Logic/LogicalOperatorGenerator.cs.meta new file mode 100644 index 00000000..ee401a19 --- /dev/null +++ b/Editor/Code/Generators/Nodes/Logic/LogicalOperatorGenerator.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 02f0dcddc8734af4ba061036aeedcaa1 \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Logic/NotEqualGenerator.cs b/Editor/Code/Generators/Nodes/Logic/NotEqualGenerator.cs index aa3524da..758cdac2 100644 --- a/Editor/Code/Generators/Nodes/Logic/NotEqualGenerator.cs +++ b/Editor/Code/Generators/Nodes/Logic/NotEqualGenerator.cs @@ -1,71 +1,13 @@ -using System; -using Unity.VisualScripting; -using Unity.VisualScripting.Community.Libraries.CSharp; -using Unity.VisualScripting.Community.Libraries.Humility; - -namespace Unity.VisualScripting.Community.CSharp +namespace Unity.VisualScripting.Community.CSharp { [NodeGenerator(typeof(NotEqual))] - public sealed class NotEqualGenerator : NodeGenerator + public sealed class NotEqualGenerator : BinaryComparisonGenerator { - public NotEqualGenerator(NotEqual unit) : base(unit) - { - } - - protected override void GenerateValueInternal(ValueInput input, ControlGenerationData data, CodeWriter writer) - { - if (input == Unit.a) - { - if (Unit.a.hasAnyConnection) - { - IDisposable expectScope = null; - if (Unit.b.hasValidConnection && Unit.b.GetPesudoSource()?.unit is Literal literal) - { - expectScope = data.Expect(literal.type); - } - base.GenerateValueInternal(Unit.a, data, writer); - if (Unit.b.hasValidConnection && Unit.b.GetPesudoSource()?.unit is Literal) - { - expectScope?.Dispose(); - } - return; - } - } - - if (input == Unit.b) - { - if (Unit.b.hasAnyConnection) - { - IDisposable expectScope = null; - if (Unit.a.hasValidConnection && Unit.a.GetPesudoSource()?.unit is Literal literal) - { - expectScope = data.Expect(literal.type); - } - base.GenerateValueInternal(Unit.b, data, writer); - if (Unit.a.hasValidConnection && Unit.a.GetPesudoSource()?.unit is Literal) - { - expectScope?.Dispose(); - } - return; - } - else if (Unit.numeric) - { - writer.Object(Unit.defaultValues["b"]); - return; - } - } - - base.GenerateValueInternal(input, data, writer); - } - - protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) - { - if (output == Unit.comparison) - { - GenerateValue(Unit.a, data, writer); - writer.Write(" != "); - GenerateValue(Unit.b, data, writer); - } - } + public NotEqualGenerator(NotEqual unit) : base(unit) { } + protected override ValueInput LeftInput => Unit.a; + protected override ValueInput RightInput => Unit.b; + protected override ValueOutput OutputPort => Unit.comparison; + protected override string OperatorToken => " != "; + protected override string OperatorMethodName => "op_Inequality"; } } \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Logic/OrGenerator.cs b/Editor/Code/Generators/Nodes/Logic/OrGenerator.cs index 35880825..796f26d0 100644 --- a/Editor/Code/Generators/Nodes/Logic/OrGenerator.cs +++ b/Editor/Code/Generators/Nodes/Logic/OrGenerator.cs @@ -4,22 +4,12 @@ namespace Unity.VisualScripting.Community.CSharp { [NodeGenerator(typeof(Or))] - public sealed class OrGenerator : NodeGenerator + public sealed class OrGenerator : LogicalOperatorGenerator { - public OrGenerator(Or unit) : base(unit) - { - } - - protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) - { - if (output == Unit.result) - { - writer.Write("("); - GenerateValue(Unit.a, data, writer); - writer.Write(" || "); - GenerateValue(Unit.b, data, writer); - writer.Write(")"); - } - } + public OrGenerator(Or unit) : base(unit) { } + protected override ValueInput LeftInput => Unit.a; + protected override ValueInput RightInput => Unit.b; + protected override ValueOutput OutputPort => Unit.result; + protected override string OperatorToken => " || "; } } \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Math/Round/BaseRoundGenerator.cs b/Editor/Code/Generators/Nodes/Math/Round/BaseRoundGenerator.cs index ca7dee1c..54a7568d 100644 --- a/Editor/Code/Generators/Nodes/Math/Round/BaseRoundGenerator.cs +++ b/Editor/Code/Generators/Nodes/Math/Round/BaseRoundGenerator.cs @@ -11,7 +11,7 @@ public BaseRoundGenerator(Unit unit) : base(unit) { } public override IEnumerable GetNamespaces() { - yield return $"{"static".ConstructHighlight()} Unity.VisualScripting.{"Round".TypeHighlight()}<{"float".ConstructHighlight()}` {"float".ConstructHighlight()}>"; + yield return $"{"static".ConstructHighlight()} Unity.VisualScripting.{"Round".TypeHighlight()}<{"float".ConstructHighlight()}, {"float".ConstructHighlight()}>"; } protected override void GenerateValueInternal(ValueOutput output, ControlGenerationData data, CodeWriter writer) diff --git a/Editor/Code/Generators/Nodes/Members/GetMemberGenerator.cs b/Editor/Code/Generators/Nodes/Members/GetMemberGenerator.cs index b30aea34..e28fb67a 100644 --- a/Editor/Code/Generators/Nodes/Members/GetMemberGenerator.cs +++ b/Editor/Code/Generators/Nodes/Members/GetMemberGenerator.cs @@ -13,7 +13,8 @@ public GetMemberGenerator(GetMember unit) : base(unit) public override IEnumerable GetNamespaces() { - yield return Unit.member.pseudoDeclaringType.Namespace; + if (Unit.member != null) + yield return Unit.member.pseudoDeclaringType.Namespace; yield return "Unity.VisualScripting"; } @@ -33,20 +34,7 @@ protected override void GenerateValueInternal(ValueOutput output, ControlGenerat return; } - string name; - - if (Unit.member.isField) - { - name = Unit.member.fieldInfo.Name; - } - else if (Unit.member.isProperty) - { - name = Unit.member.name; - } - else - { - name = Unit.member.ToDeclarer().ToString(); // I don't think this should be possible through normal usage. - } + string name = Unit.member.name; if (!typeof(Component).IsAssignableFrom(Unit.member.pseudoDeclaringType)) { diff --git a/Editor/Code/Generators/Nodes/Members/InvokeMemberGenerator.cs b/Editor/Code/Generators/Nodes/Members/InvokeMemberGenerator.cs index f323bc09..0c8f367e 100644 --- a/Editor/Code/Generators/Nodes/Members/InvokeMemberGenerator.cs +++ b/Editor/Code/Generators/Nodes/Members/InvokeMemberGenerator.cs @@ -1,6 +1,3 @@ -using Unity; -using Unity.VisualScripting; -using Unity.VisualScripting.Community; using System.Linq; using Unity.VisualScripting.Community.Libraries.CSharp; using System.Collections.Generic; @@ -15,13 +12,16 @@ namespace Unity.VisualScripting.Community.CSharp public sealed class InvokeMemberGenerator : LocalVariableGenerator { private InvokeMember Unit => unit as InvokeMember; - private Dictionary outputNames; + private Dictionary outputNames = new Dictionary(); public InvokeMemberGenerator(InvokeMember unit) : base(unit) { } public override IEnumerable GetNamespaces() { + if (Unit.member == null) + yield break; + if (!Unit.member.isReflected) yield break; @@ -39,7 +39,7 @@ protected override void GenerateControlInternal(ControlInput input, ControlGener { if (!Unit.member.isReflected) return; - outputNames = new Dictionary(); + bool hasResultConnection = Unit.result != null && Unit.result.hasValidConnection; if (hasResultConnection) @@ -98,7 +98,7 @@ protected override void GenerateControlInternal(ControlInput input, ControlGener if (!hasResultConnection) writer.WriteIndented(); GenerateValue(Unit.target, data, writer); - writer.Write(Unit.target.GetComponent(writer, GetSourceType(Unit.target, data, writer), Unit.target.type, true, true)); + writer.Write(Unit.target.GetComponent(writer, GetSourceType(Unit.target, data, writer), true, true)); } writer.Dot(); @@ -269,6 +269,8 @@ private void GenerateArguments(CodeWriter writer, ControlGenerationData data) { outputNames.Add(outValue, "&" + name); } + + continue; } if (input == null) @@ -287,7 +289,7 @@ private void GenerateArguments(CodeWriter writer, ControlGenerationData data) if (!input.hasValidConnection || (input.hasValidConnection && !input.connection.source.unit.IsValidRefUnit())) { - writer.Error($"{input.key.Replace("%", "")} needs connection to a Get Variable or Get Member unit"); + writer.Error($"{input.key.Replace("%", "")} needs connection to a Get Variable or a Settable Get Member unit"); continue; } diff --git a/Editor/Code/Generators/Nodes/Members/SetMemberGenerator.cs b/Editor/Code/Generators/Nodes/Members/SetMemberGenerator.cs index 7b43af5d..d9e7e016 100644 --- a/Editor/Code/Generators/Nodes/Members/SetMemberGenerator.cs +++ b/Editor/Code/Generators/Nodes/Members/SetMemberGenerator.cs @@ -17,7 +17,8 @@ public SetMemberGenerator(SetMember unit) : base(unit) public override IEnumerable GetNamespaces() { - yield return Unit.member.pseudoDeclaringType.Namespace; + if (Unit.member != null) + yield return Unit.member.pseudoDeclaringType.Namespace; } protected override void GenerateControlInternal(ControlInput input, ControlGenerationData data, CodeWriter writer) diff --git a/Editor/Code/Generators/Nodes/NodeGeneration.cs b/Editor/Code/Generators/Nodes/NodeGeneration.cs index 5bcaf4c1..4ceb38ab 100644 --- a/Editor/Code/Generators/Nodes/NodeGeneration.cs +++ b/Editor/Code/Generators/Nodes/NodeGeneration.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; using Unity.VisualScripting.Community.Libraries.CSharp; -using Unity.VisualScripting.Community.Libraries.Humility; +using System.Reflection; using UnityEngine; #if VISUAL_SCRIPTING_1_7 using SUnit = Unity.VisualScripting.SubgraphUnit; @@ -89,6 +89,11 @@ public static string GetComponentCode(Type type, CodeWriter writer, bool include } } + public static string GetComponent(this ValueInput input, CodeWriter writer, Type sourceType, bool includeDot, bool includeParentheses) + { + return GetComponent(input, writer, sourceType, input.type, includeDot, includeParentheses); + } + public static string GetComponent(this ValueInput input, CodeWriter writer, Type sourceType, Type requiredType, bool includeDot, bool includeParentheses) { if (requiredType == typeof(GameObject) || !typeof(Component).IsStrictlyAssignableFrom(requiredType)) @@ -280,11 +285,41 @@ public static bool IsSourceLiteral(ValueInput valueInput, out Type sourceType) public static bool IsValidRefUnit(this Unit unit) { - return unit is GetVariable || (unit is AssetFieldUnit fieldUnit && fieldUnit.actionDirection == ActionDirection.Get) || (unit is InheritedFieldUnit inheritedField && inheritedField.actionDirection == ActionDirection.Get); + // Check if it's private would be the proper way to check this as well, + // but since you can compile the graph you are working on and use those members as a GetMember unit, + // there is no way to check if the current graph is part of the same type so private would fail even though it's valid. + // So we allow it then let the compiled script errors tell you it's invalid. + return unit is GetVariable || + (unit is GetMember getMember && getMember.member.isSettable) || + (unit is AssetFieldUnit fieldUnit && fieldUnit.actionDirection == ActionDirection.Get && !IsReadonly(fieldUnit.field)) || + (unit is InheritedFieldUnit inheritedField && inheritedField.actionDirection == ActionDirection.Get && inheritedField.member.isSettable); } + public static bool IsValidRefUnit(this IUnit unit) { return IsValidRefUnit(unit as Unit); } + + public static bool IsReadonly(FieldDeclaration declaration) + { + if (declaration.isProperty) + { + return false; + } + + return (declaration.fieldModifier & FieldModifier.Readonly) != 0; + } + + public static bool IsPrivate(Member member) + { + switch (member.info) + { + case FieldInfo f: return f.IsPrivate; + case PropertyInfo p: return p.GetScope() == AccessModifier.Private; + case MethodInfo m: return m.IsPrivate; + case ConstructorInfo c: return c.IsPrivate; + default: throw new InvalidOperationException(); + } + } } } \ No newline at end of file diff --git a/Editor/Code/Generators/Nodes/Variables/GetVariableGenerator.cs b/Editor/Code/Generators/Nodes/Variables/GetVariableGenerator.cs index d2cb2afd..306ed090 100644 --- a/Editor/Code/Generators/Nodes/Variables/GetVariableGenerator.cs +++ b/Editor/Code/Generators/Nodes/Variables/GetVariableGenerator.cs @@ -69,7 +69,10 @@ private void GenerateConnected(ControlGenerationData data, CodeWriter writer, st case VariableKind.Object: writer.Write(variablesType + ".Object("); - GenerateValue(Unit.@object, data, writer); + using (data.Expect(typeof(GameObject))) + { + GenerateValue(Unit.@object, data, writer); + } writer.Write(")"); ResolveVariableTypeSafe(VisualScripting.Variables.Object(GetTarget(data)), name, data); break; @@ -184,8 +187,10 @@ private void WriteObject(ControlGenerationData data, CodeWriter writer) writer.Write("gameObject".VariableHighlight()); return; } - - GenerateValue(Unit.@object, data, writer); + using (data.Expect(typeof(GameObject))) + { + GenerateValue(Unit.@object, data, writer); + } } private void ResolveVariableTypeSafe(VariableDeclarations declarations, string name, ControlGenerationData data) diff --git a/Editor/Code/Generators/Nodes/Variables/IsVariableDefinedGenerator.cs b/Editor/Code/Generators/Nodes/Variables/IsVariableDefinedGenerator.cs index e7c39ebc..c7d45af2 100644 --- a/Editor/Code/Generators/Nodes/Variables/IsVariableDefinedGenerator.cs +++ b/Editor/Code/Generators/Nodes/Variables/IsVariableDefinedGenerator.cs @@ -25,10 +25,10 @@ protected override void GenerateValueInternal(ValueOutput output, ControlGenerat { switch (Unit.kind) { - case VariableKind.Flow: - case VariableKind.Graph: - writer.Error($"{Unit.kind} Variables do not support connected names"); - break; + case VariableKind.Flow or VariableKind.Graph: + using (writer.CodeDiagnosticScope($"{Unit.kind} Variables cannot use IsDefined yet.", CodeDiagnosticKind.Error)) + writer.Error($"Could not generate {Unit.kind} Variable"); + return; case VariableKind.Object: writer.InvokeMember(writer.GetTypeNameHighlighted(typeof(VisualScripting.Variables)), "Object", writer.Action(() => GenerateValue(Unit.@object, data, writer))); break; diff --git a/Editor/Code/Options/CodeOptions.cs b/Editor/Code/Options/CodeOptions.cs index 6eae20fb..a0163a93 100644 --- a/Editor/Code/Options/CodeOptions.cs +++ b/Editor/Code/Options/CodeOptions.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using Unity.VisualScripting.Community.Libraries.Humility; using System.Reflection; +using UnityEngine.Assemblies; +using System.Linq; namespace Unity.VisualScripting.Community { @@ -55,8 +57,11 @@ private static IEnumerable DelegateMemberOptions() private static IEnumerable DelegateOptions() { - List result = new List(); +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { diff --git a/Editor/Code/Resources/as_32.png.meta b/Editor/Code/Resources/as_32.png.meta index 6f806e9a..490d088b 100644 --- a/Editor/Code/Resources/as_32.png.meta +++ b/Editor/Code/Resources/as_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: cba0860cc006bc240bcd4779dde2d62e TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -2974064338877788879 + second: as_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: as_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 13d4806bd300ab6d0800000000000000 + internalID: -2974064338877788879 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/binary_save_32.png.meta b/Editor/Code/Resources/binary_save_32.png.meta index fb9fe2d2..edaa99bd 100644 --- a/Editor/Code/Resources/binary_save_32.png.meta +++ b/Editor/Code/Resources/binary_save_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 8c40bba553c175947a0987482c3ba4bd TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 2362337395451753064 + second: binary_save_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: binary_save_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 862f58f4855b8c020800000000000000 + internalID: 2362337395451753064 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/class_16.png.meta b/Editor/Code/Resources/class_16.png.meta index f0417380..361a988b 100644 --- a/Editor/Code/Resources/class_16.png.meta +++ b/Editor/Code/Resources/class_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: bd2d069c488e09e429c95e9643376a13 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 5136859307506328807 + second: class_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: class_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 7e4e21de25ac94740800000000000000 + internalID: 5136859307506328807 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/class_32.png.meta b/Editor/Code/Resources/class_32.png.meta index 25e0f863..b56816e1 100644 --- a/Editor/Code/Resources/class_32.png.meta +++ b/Editor/Code/Resources/class_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 29f1a2d001dd6c2478b4f37041e5c63b TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 1535742641561579498 + second: class_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: class_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: aefa2b8bbcd005510800000000000000 + internalID: 1535742641561579498 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/class_variable_32.png.meta b/Editor/Code/Resources/class_variable_32.png.meta index 19b0882f..f549c7f5 100644 --- a/Editor/Code/Resources/class_variable_32.png.meta +++ b/Editor/Code/Resources/class_variable_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 596b8a49e60fb444181b8ca86a472a26 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -8309915453151023779 + second: class_variable_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: class_variable_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: d5d67655cef3dac80800000000000000 + internalID: -8309915453151023779 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/code_32.png.meta b/Editor/Code/Resources/code_32.png.meta index cf975cd4..9f38b93a 100644 --- a/Editor/Code/Resources/code_32.png.meta +++ b/Editor/Code/Resources/code_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 53b4e8a29acc8d64985064ab6100190c TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 3063646189919389351 + second: code_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: code_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 7a6cf935af1448a20800000000000000 + internalID: 3063646189919389351 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/compilation_16.png.meta b/Editor/Code/Resources/compilation_16.png.meta index 23052f61..b689c1d8 100644 --- a/Editor/Code/Resources/compilation_16.png.meta +++ b/Editor/Code/Resources/compilation_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 9c418f00c6d78ac4daa7036bb45a8912 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -3905950659805225713 + second: compilation_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: compilation_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: f0d5b1cc1964bc9c0800000000000000 + internalID: -3905950659805225713 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/constructor_32.png.meta b/Editor/Code/Resources/constructor_32.png.meta index 57d9f71b..ce1b1e53 100644 --- a/Editor/Code/Resources/constructor_32.png.meta +++ b/Editor/Code/Resources/constructor_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: bf905c1471bef9548a9bf65b5738fbca TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 9169414421814644406 + second: constructor_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: constructor_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 6be0b92c5dd404f70800000000000000 + internalID: 9169414421814644406 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/continue_32.png.meta b/Editor/Code/Resources/continue_32.png.meta index fee497d8..75a0e44a 100644 --- a/Editor/Code/Resources/continue_32.png.meta +++ b/Editor/Code/Resources/continue_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 7484ce1f2a21dbd44aca2fae4f464416 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -196547203969103588 + second: continue_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: continue_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: c1943ddfb59b54df0800000000000000 + internalID: -196547203969103588 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/contract_32.png.meta b/Editor/Code/Resources/contract_32.png.meta index dca385bb..d35e230e 100644 --- a/Editor/Code/Resources/contract_32.png.meta +++ b/Editor/Code/Resources/contract_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 18e678980dbaf9c49b89d258a4e47ba6 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -3224015561185298376 + second: contract_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: contract_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 838f73dbdeef143d0800000000000000 + internalID: -3224015561185298376 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/enum_16.png.meta b/Editor/Code/Resources/enum_16.png.meta index 67c81465..c1f12f53 100644 --- a/Editor/Code/Resources/enum_16.png.meta +++ b/Editor/Code/Resources/enum_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: d96a6e03619cfc74fb9c87b3104b492f TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -6371018459737012709 + second: enum_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: enum_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: b164be947789597a0800000000000000 + internalID: -6371018459737012709 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/enum_32.png.meta b/Editor/Code/Resources/enum_32.png.meta index d0d7f2b3..64e59e7a 100644 --- a/Editor/Code/Resources/enum_32.png.meta +++ b/Editor/Code/Resources/enum_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 79dcc1d10c1d1694e8f88d4c72d953a0 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -8076274204019171322 + second: enum_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: enum_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 60069c0c66f4bef80800000000000000 + internalID: -8076274204019171322 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/event_16.png.meta b/Editor/Code/Resources/event_16.png.meta index 6fef7daf..73a7424a 100644 --- a/Editor/Code/Resources/event_16.png.meta +++ b/Editor/Code/Resources/event_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 8a783a49c7381764ab40d55f0c501eb7 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -3645374015234541781 + second: event_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: event_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: b27718ca5a7096dc0800000000000000 + internalID: -3645374015234541781 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/explorer_16.png.meta b/Editor/Code/Resources/explorer_16.png.meta index 62b02746..f326ed4b 100644 --- a/Editor/Code/Resources/explorer_16.png.meta +++ b/Editor/Code/Resources/explorer_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 668135398b43cac43b5a59f7ea4d6b62 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -1006366326623650487 + second: explorer_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: explorer_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 94dbeab682ba802f0800000000000000 + internalID: -1006366326623650487 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/flow_16.png.meta b/Editor/Code/Resources/flow_16.png.meta index 76e62d87..d4e6e072 100644 --- a/Editor/Code/Resources/flow_16.png.meta +++ b/Editor/Code/Resources/flow_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 1a212c8fa3a5ceb4aba702d1178432b8 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 4213229522146096564 + second: flow_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: flow_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 4b5f4b08de5687a30800000000000000 + internalID: 4213229522146096564 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/flow_32.png.meta b/Editor/Code/Resources/flow_32.png.meta index 837f9a2a..f8e5a124 100644 --- a/Editor/Code/Resources/flow_32.png.meta +++ b/Editor/Code/Resources/flow_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 7e38ff706c25aac429f210852e2daee7 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 376803717093765276 + second: flow_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: flow_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: c90bb6bfbfcaa3500800000000000000 + internalID: 376803717093765276 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/flow_reroute_32.png.meta b/Editor/Code/Resources/flow_reroute_32.png.meta index 0d89c020..86e4784d 100644 --- a/Editor/Code/Resources/flow_reroute_32.png.meta +++ b/Editor/Code/Resources/flow_reroute_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: cf8d5592b2e666148ac82544ae57a450 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -8517231580325672670 + second: flow_reroute_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: flow_reroute_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 22903f00107bcc980800000000000000 + internalID: -8517231580325672670 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/getter_32.png.meta b/Editor/Code/Resources/getter_32.png.meta index 611cc7ae..55adb816 100644 --- a/Editor/Code/Resources/getter_32.png.meta +++ b/Editor/Code/Resources/getter_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: a10814ea315f4614db7834be49856a01 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 5618935849903165937 + second: getter_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: getter_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 1f19f2592687afd40800000000000000 + internalID: 5618935849903165937 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/interface_16.png.meta b/Editor/Code/Resources/interface_16.png.meta index 14c9b7fe..dde8bff0 100644 --- a/Editor/Code/Resources/interface_16.png.meta +++ b/Editor/Code/Resources/interface_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 04da9586950244049b1047e96b1b8249 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 8552085680574846951 + second: interface_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: interface_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 7e75e579d9c1fa670800000000000000 + internalID: 8552085680574846951 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/interface_32.png.meta b/Editor/Code/Resources/interface_32.png.meta index 275dcedc..2ce28d24 100644 --- a/Editor/Code/Resources/interface_32.png.meta +++ b/Editor/Code/Resources/interface_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 45d6ab60acb0b1c4cace40b6f4fac1e8 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 6994543792497559194 + second: interface_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: interface_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: a960bb5458c911160800000000000000 + internalID: 6994543792497559194 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/invoke_32.png.meta b/Editor/Code/Resources/invoke_32.png.meta index 7825c102..cebea2d0 100644 --- a/Editor/Code/Resources/invoke_32.png.meta +++ b/Editor/Code/Resources/invoke_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 8a52683073358d14389b10a3a0d2c7c4 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 2471359966844614171 + second: invoke_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: invoke_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: b16f4e7cbc80c4220800000000000000 + internalID: 2471359966844614171 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/is_unit@32x.png.meta b/Editor/Code/Resources/is_unit@32x.png.meta index 78933f91..776eb3b0 100644 --- a/Editor/Code/Resources/is_unit@32x.png.meta +++ b/Editor/Code/Resources/is_unit@32x.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 04a768f038c59d14b8ee87ad38c89836 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 8586246596241852132 + second: is_unit@32x_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: is_unit@32x_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 4e607e299c9782770800000000000000 + internalID: 8586246596241852132 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/label_unit@32x.png.meta b/Editor/Code/Resources/label_unit@32x.png.meta index 8d808cf8..6e51d425 100644 --- a/Editor/Code/Resources/label_unit@32x.png.meta +++ b/Editor/Code/Resources/label_unit@32x.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 7d5284d198d006c45a56b53326215692 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -6632537290234030704 + second: label_unit@32x_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: label_unit@32x_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 0959118a97e74f3a0800000000000000 + internalID: -6632537290234030704 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/lock_32.png.meta b/Editor/Code/Resources/lock_32.png.meta index e35ad03d..2036dce9 100644 --- a/Editor/Code/Resources/lock_32.png.meta +++ b/Editor/Code/Resources/lock_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 275dd874966b848469dd2ca028143d36 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 9143276424040641426 + second: lock_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: lock_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 293752ae67173ee70800000000000000 + internalID: 9143276424040641426 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/method_16.png.meta b/Editor/Code/Resources/method_16.png.meta index 99159161..721b8e6c 100644 --- a/Editor/Code/Resources/method_16.png.meta +++ b/Editor/Code/Resources/method_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 15d4c6956094dc64fbb29142b53422ee TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 5599691170854187044 + second: method_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: method_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 420b7a2937916bd40800000000000000 + internalID: 5599691170854187044 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/multi_array_32.png.meta b/Editor/Code/Resources/multi_array_32.png.meta index 2dc11832..64b08d7e 100644 --- a/Editor/Code/Resources/multi_array_32.png.meta +++ b/Editor/Code/Resources/multi_array_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 7bd2d24859e5a9743af050431badd5f8 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 5489744347939934782 + second: multi_array_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: multi_array_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: e321ba6066d7f2c40800000000000000 + internalID: 5489744347939934782 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/object_32.png.meta b/Editor/Code/Resources/object_32.png.meta index adb36f60..1fbfe673 100644 --- a/Editor/Code/Resources/object_32.png.meta +++ b/Editor/Code/Resources/object_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 31dd71f2d367974449cc07e1d6917732 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -7875068625388908043 + second: object_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: object_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 5f1ded12fc226b290800000000000000 + internalID: -7875068625388908043 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/okay_32.png.meta b/Editor/Code/Resources/okay_32.png.meta index 102ea7b3..b21db3db 100644 --- a/Editor/Code/Resources/okay_32.png.meta +++ b/Editor/Code/Resources/okay_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 8c84a5927ced61b438f239e2afa19b9a TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -1704864146449301323 + second: okay_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: okay_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 5b00790771b1758e0800000000000000 + internalID: -1704864146449301323 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/override_16.png.meta b/Editor/Code/Resources/override_16.png.meta index dbe71aa2..58222a18 100644 --- a/Editor/Code/Resources/override_16.png.meta +++ b/Editor/Code/Resources/override_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 47812b89c01f16246891efb73e867deb TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 3518903816916485032 + second: override_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: override_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 8a3c216a068a5d030800000000000000 + internalID: 3518903816916485032 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/override_32.png.meta b/Editor/Code/Resources/override_32.png.meta index be6b049b..d7d108f8 100644 --- a/Editor/Code/Resources/override_32.png.meta +++ b/Editor/Code/Resources/override_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 02e22fdf19b338a43aeb32aa4f84cda6 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 7199202538712889505 + second: override_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: override_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 1a87212e094b8e360800000000000000 + internalID: 7199202538712889505 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/parameters_16.png.meta b/Editor/Code/Resources/parameters_16.png.meta index bd5e2c6d..106745ea 100644 --- a/Editor/Code/Resources/parameters_16.png.meta +++ b/Editor/Code/Resources/parameters_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 65582e8c2e7ec44408c35953a15e0313 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 1038617144704090744 + second: parameters_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: parameters_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 872c7bf4ac8e96e00800000000000000 + internalID: 1038617144704090744 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/processor_directiv_32.png.meta b/Editor/Code/Resources/processor_directiv_32.png.meta index 297b6978..aa708970 100644 --- a/Editor/Code/Resources/processor_directiv_32.png.meta +++ b/Editor/Code/Resources/processor_directiv_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 6583501ae5a9d3d40a4550de97747803 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -5450258548678501539 + second: processor_directiv_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: processor_directiv_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: d5b5bf70abacc54b0800000000000000 + internalID: -5450258548678501539 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/property_16.png.meta b/Editor/Code/Resources/property_16.png.meta index ac5a943e..6ea65a0d 100644 --- a/Editor/Code/Resources/property_16.png.meta +++ b/Editor/Code/Resources/property_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 6104b93d330962d468964058e77a0c75 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 7281534350393190472 + second: property_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: property_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 848adf699e43d0560800000000000000 + internalID: 7281534350393190472 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/property_32.png.meta b/Editor/Code/Resources/property_32.png.meta index d1605239..65908a75 100644 --- a/Editor/Code/Resources/property_32.png.meta +++ b/Editor/Code/Resources/property_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 2ec21077c38a5ad4b92276cf488d82d6 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -4757325441937551645 + second: property_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: property_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 3ee426847b59afdb0800000000000000 + internalID: -4757325441937551645 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/return_32.png.meta b/Editor/Code/Resources/return_32.png.meta index 6634b0d2..ec3bc150 100644 --- a/Editor/Code/Resources/return_32.png.meta +++ b/Editor/Code/Resources/return_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 4caec0881d844ec4297f7a5cebb6c9a9 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -5105985045981200661 + second: return_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: return_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: bee75d147a5e329b0800000000000000 + internalID: -5105985045981200661 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/return_event_32.png.meta b/Editor/Code/Resources/return_event_32.png.meta index 83627a5a..3f978176 100644 --- a/Editor/Code/Resources/return_event_32.png.meta +++ b/Editor/Code/Resources/return_event_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 7144e68c03aaa02418796fa667a81cdf TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -5359066103771397743 + second: return_event_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: return_event_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 1918edca5c5c0a5b0800000000000000 + internalID: -5359066103771397743 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/scope_32.png.meta b/Editor/Code/Resources/scope_32.png.meta index 877197ad..ef8da163 100644 --- a/Editor/Code/Resources/scope_32.png.meta +++ b/Editor/Code/Resources/scope_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: d24b1a8dd533c184fa9215ded750abe9 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -6546716132187997596 + second: scope_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: scope_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 46a7d9f1d546525a0800000000000000 + internalID: -6546716132187997596 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/search_16.png.meta b/Editor/Code/Resources/search_16.png.meta index c5fd8d2e..c97371a6 100644 --- a/Editor/Code/Resources/search_16.png.meta +++ b/Editor/Code/Resources/search_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: b259c174df5052349b85574e0408475e TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 8026130318790402131 + second: search_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: search_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 350ae7c200b826f60800000000000000 + internalID: 8026130318790402131 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/setter_32.png.meta b/Editor/Code/Resources/setter_32.png.meta index 972a0eb6..ab5b7725 100644 --- a/Editor/Code/Resources/setter_32.png.meta +++ b/Editor/Code/Resources/setter_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 79d7d5c730b6a6f478422461cd4ee297 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 367228414500777997 + second: setter_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: setter_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: d00bfbd1c48a81500800000000000000 + internalID: 367228414500777997 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/settings_16.png.meta b/Editor/Code/Resources/settings_16.png.meta index 46a771b8..7660b1f9 100644 --- a/Editor/Code/Resources/settings_16.png.meta +++ b/Editor/Code/Resources/settings_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: eb8a65860caf4a345a893c87e6e374d6 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -8636448100172555334 + second: settings_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: settings_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: abb1e14f53c252880800000000000000 + internalID: -8636448100172555334 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/special_16.png.meta b/Editor/Code/Resources/special_16.png.meta index c2079bbc..a4d38841 100644 --- a/Editor/Code/Resources/special_16.png.meta +++ b/Editor/Code/Resources/special_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: f4f12ea5d5ab4f241ae3f6d3090c4195 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 289408947559574598 + second: special_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: special_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 64cab1a87ef240400800000000000000 + internalID: 289408947559574598 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/special_32.png.meta b/Editor/Code/Resources/special_32.png.meta index f9ae858a..2961bb49 100644 --- a/Editor/Code/Resources/special_32.png.meta +++ b/Editor/Code/Resources/special_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 7ac2c54beb0be724d8931e9ef1e44a9f TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 5368657271316963625 + second: special_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: special_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 9216aa9085d418a40800000000000000 + internalID: 5368657271316963625 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/struct_16.png.meta b/Editor/Code/Resources/struct_16.png.meta index e2859f0c..fba086f9 100644 --- a/Editor/Code/Resources/struct_16.png.meta +++ b/Editor/Code/Resources/struct_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 53f108032e0452c43ab28994e3327f73 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -8733804332081731744 + second: struct_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: struct_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 0672080db3b4bc680800000000000000 + internalID: -8733804332081731744 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/struct_32.png.meta b/Editor/Code/Resources/struct_32.png.meta index 28a84745..2c8106a5 100644 --- a/Editor/Code/Resources/struct_32.png.meta +++ b/Editor/Code/Resources/struct_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 2a08cdec3b7e6624eba19e89870c7b81 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -2215051505936915184 + second: struct_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: struct_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 015af65246e8241e0800000000000000 + internalID: -2215051505936915184 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/this_32.png.meta b/Editor/Code/Resources/this_32.png.meta index 0bd4e5af..9a5f5609 100644 --- a/Editor/Code/Resources/this_32.png.meta +++ b/Editor/Code/Resources/this_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 4f05b31edbae2e6429a2629bf1f3470c TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -2545678536355756488 + second: this_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: this_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 836cd28dbdeebacd0800000000000000 + internalID: -2545678536355756488 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/value_reroute_32.png.meta b/Editor/Code/Resources/value_reroute_32.png.meta index afbb91cd..e5c4d32c 100644 --- a/Editor/Code/Resources/value_reroute_32.png.meta +++ b/Editor/Code/Resources/value_reroute_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 0f2312eb9f6aecb4e85b6944732e079e TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 2269922962888023226 + second: value_reroute_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: value_reroute_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: abc517e78e2608f10800000000000000 + internalID: 2269922962888023226 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/variables_16.png.meta b/Editor/Code/Resources/variables_16.png.meta index 0fbcb462..8acea5ce 100644 --- a/Editor/Code/Resources/variables_16.png.meta +++ b/Editor/Code/Resources/variables_16.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 74e323c3a9752134d97aff1d6ac23a7b TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 6656259282790846734 + second: variables_16_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: variables_16_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: e0115a32d88cf5c50800000000000000 + internalID: 6656259282790846734 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/variables_32.png.meta b/Editor/Code/Resources/variables_32.png.meta index b47fe0a4..a99c059d 100644 --- a/Editor/Code/Resources/variables_32.png.meta +++ b/Editor/Code/Resources/variables_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: af3d67be75152844d9844b5d36fa8bf2 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 7787394597205538194 + second: variables_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: variables_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 2957b347022621c60800000000000000 + internalID: 7787394597205538194 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/void_32.png.meta b/Editor/Code/Resources/void_32.png.meta index 97e86c1c..1e0dce44 100644 --- a/Editor/Code/Resources/void_32.png.meta +++ b/Editor/Code/Resources/void_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: d0f060cf261f19348a0173d8557abfba TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 5964369887719219110 + second: void_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: void_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 6af5a82ffc2b5c250800000000000000 + internalID: 5964369887719219110 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Resources/warning_32.png.meta b/Editor/Code/Resources/warning_32.png.meta index 770cb66d..5d2181e8 100644 --- a/Editor/Code/Resources/warning_32.png.meta +++ b/Editor/Code/Resources/warning_32.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 9217f53738d1fa049a4f46d583a567d2 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -4963630885801615908 + second: warning_32_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: warning_32_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: cdd13aff104ad1bb0800000000000000 + internalID: -4963630885801615908 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Code/Widgets/Delegates/BindDelegateNodeWidget.cs b/Editor/Code/Widgets/Delegates/BindDelegateNodeWidget.cs index 1572df12..c22f060b 100644 --- a/Editor/Code/Widgets/Delegates/BindDelegateNodeWidget.cs +++ b/Editor/Code/Widgets/Delegates/BindDelegateNodeWidget.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System; using System.Reflection; +using UnityEngine.Assemblies; +using System.Linq; namespace Unity.VisualScripting.Community { @@ -37,7 +39,11 @@ protected override void DrawHeaderAddon() GenericMenu menu = new GenericMenu(); List result = new List(); +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { diff --git a/Editor/Code/Widgets/Delegates/DelegateInvokeNodeWidget.cs b/Editor/Code/Widgets/Delegates/DelegateInvokeNodeWidget.cs index a88afb0c..fa42ea86 100644 --- a/Editor/Code/Widgets/Delegates/DelegateInvokeNodeWidget.cs +++ b/Editor/Code/Widgets/Delegates/DelegateInvokeNodeWidget.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System; using System.Reflection; +using UnityEngine.Assemblies; +using System.Linq; namespace Unity.VisualScripting.Community { @@ -36,7 +38,11 @@ protected override void DrawHeaderAddon() GenericMenu menu = new GenericMenu(); List result = new List(); +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { diff --git a/Editor/Code/Widgets/Delegates/DelegateNodeWidget.cs b/Editor/Code/Widgets/Delegates/DelegateNodeWidget.cs index 1a682b59..1a48a10a 100644 --- a/Editor/Code/Widgets/Delegates/DelegateNodeWidget.cs +++ b/Editor/Code/Widgets/Delegates/DelegateNodeWidget.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System; using System.Reflection; +using UnityEngine.Assemblies; +using System.Linq; namespace Unity.VisualScripting.Community { @@ -35,7 +37,11 @@ protected override void DrawHeaderAddon() GenericMenu menu = new GenericMenu(); List result = new List(); +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { diff --git a/Editor/Code/Widgets/Delegates/UnbindDelegateNodeWidget.cs b/Editor/Code/Widgets/Delegates/UnbindDelegateNodeWidget.cs index 44b12aac..26de2f23 100644 --- a/Editor/Code/Widgets/Delegates/UnbindDelegateNodeWidget.cs +++ b/Editor/Code/Widgets/Delegates/UnbindDelegateNodeWidget.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System; using System.Reflection; +using UnityEngine.Assemblies; +using System.Linq; namespace Unity.VisualScripting.Community { @@ -36,7 +38,11 @@ protected override void DrawHeaderAddon() GenericMenu menu = new GenericMenu(); List result = new List(); +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { diff --git a/Editor/Internal/AOTMethodsPrebuilder.cs b/Editor/Internal/AOTMethodsPrebuilder.cs index 683e6df7..47b7c8a6 100644 --- a/Editor/Internal/AOTMethodsPrebuilder.cs +++ b/Editor/Internal/AOTMethodsPrebuilder.cs @@ -11,6 +11,8 @@ using Unity.VisualScripting.Community.Libraries.CSharp; using ParameterModifier = Unity.VisualScripting.Community.Libraries.CSharp.ParameterModifier; using Unity.VisualScripting.Community.CSharp; +using UnityEngine.Assemblies; +using System.Reflection; namespace Unity.VisualScripting.Community { @@ -114,7 +116,13 @@ private List GetTypesForAOTMethods() { List types = new List(); - var allTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(assembly => assembly.GetTypes().Where(type => typeof(UnityEventBase).IsAssignableFrom(type))).ToList(); +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else + Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif + + var allTypes = assemblies.SelectMany(assembly => assembly.GetTypes().Where(type => typeof(UnityEventBase).IsAssignableFrom(type))).ToList(); int count = allTypes.Count; for (int i = 0; i < count; i++) diff --git a/Editor/Internal/Patches/GraphGUI/GraphGUIFloatingToolbar.cs b/Editor/Internal/Patches/GraphGUI/GraphGUIFloatingToolbar.cs index d62b2c16..e03834b7 100644 --- a/Editor/Internal/Patches/GraphGUI/GraphGUIFloatingToolbar.cs +++ b/Editor/Internal/Patches/GraphGUI/GraphGUIFloatingToolbar.cs @@ -10,133 +10,104 @@ namespace Unity.VisualScripting.Community { internal static class GraphGUIFloatingToolbar { - public const float FloatingToolbarButtonSize = 28; + private static readonly Color BackgroundColor = EditorGUIUtility.isProSkin ? new Color32(56, 56, 56, 255) : new Color32(194, 194, 194, 255); + private static readonly Color HoverColor = EditorGUIUtility.isProSkin ? new Color32(76, 76, 76, 255) : new Color32(214, 214, 214, 255); + private static readonly Color ActiveColor = EditorGUIUtility.isProSkin ? new Color32(88, 88, 88, 255) : new Color32(150, 150, 150, 255); + private static readonly Color ActiveHoverColor = EditorGUIUtility.isProSkin ? new Color32(108, 108, 108, 255) : new Color32(130, 130, 130, 255); + private static readonly Color BorderColor = EditorGUIUtility.isProSkin ? new Color32(26, 26, 26, 255) : new Color32(164, 164, 164, 255); private static bool previousDeveloperMode = BoltCore.Configuration.developerMode; + private enum ButtonPosition + { + Left, + Middle, + Right, + All + } + public static void Build(VisualElement root, GraphWindow window) { var state = GraphGUIState.Get(window); + if (state.FloatingToolbar != null) return; - if (state.FloatingToolbar != null) - return; - - var toolbar = CreateFloatingToolbar(window); + var toolbar = CreateToolbarContainer(window); state.FloatingToolbar = toolbar; - toolbar.style.flexDirection = FlexDirection.Row; - toolbar.style.alignItems = Align.FlexEnd; - toolbar.style.justifyContent = Justify.SpaceBetween; - toolbar.style.flexShrink = 0; - void RebuildToolbar() { toolbar.Clear(); var reference = window.reference; if (reference == null || !reference.isValid) return; + var canvas = reference.Context().canvas; - toolbar.style.width = GraphGUIUtilities.GetCanvasToolbarWidth(canvas); - ToolbarButton errorButton = null; - errorButton = CreateFloatingButton(EditorGUIUtility.IconContent("console.erroricon").image, "Clear Errors", () => - { - var reference = window.reference; - foreach (var ed in reference.debugData.elementsData.Where(e => e.runtimeException != null)) - { - ed.runtimeException = null; - } - }, () => - { - // A bit hacky but using this so I do not need to add another IMGUI container just to detect the developer mode change - if (previousDeveloperMode != BoltCore.Configuration.developerMode) - { - previousDeveloperMode = BoltCore.Configuration.developerMode; - errorButton.schedule.Execute(() => RebuildToolbar()); - return; - } - - var reference = window.reference; - var erroredElementsDebugData = ListPool.New(); - - foreach (var elementDebugData in reference?.debugData?.elementsData ?? Enumerable.Empty()) - { - if (elementDebugData.runtimeException != null) - { - erroredElementsDebugData.Add(elementDebugData); - } - } - - if (erroredElementsDebugData.Count > 0) - { - errorButton.style.opacity = 1; - errorButton.SetEnabled(true); - } - else - { - errorButton.style.opacity = 0; - errorButton.SetEnabled(false); - } - - erroredElementsDebugData.Free(); - }); - toolbar.Add(errorButton); + toolbar.style.width = StyleKeyword.Auto; + + var errorSection = CreateSection("ErrorSection"); + errorSection.Add(CreateErrorButton(window)); + toolbar.Add(errorSection); if (canvas is FlowCanvas flowCanvas) { - var relationsButton = CreateToggleButton(EditorGUIUtility.IconContent("UnityEditor.Graphs.AnimatorControllerTool").image, "Port Relations", flowCanvas.showRelations, v => flowCanvas.showRelations = v); - var valuesButton = CreateToggleButton(EditorGUIUtility.IconContent("UnityEditor.InspectorWindow").image, "Flow Values", BoltFlow.Configuration.showConnectionValues, v => { BoltFlow.Configuration.showConnectionValues = v; BoltFlow.Configuration.Save(); }); - var dimButton = CreateToggleButton(EditorGUIUtility.IconContent("animationvisibilitytoggleoff").image, "Dim Nodes", BoltCore.Configuration.dimInactiveNodes, v => { BoltCore.Configuration.dimInactiveNodes = v; BoltCore.Configuration.Save(); }); - var carryButton = CreateToggleButton(BoltCore.Icons.window?[IconSize.Small], "Carry Children", BoltCore.Configuration.carryChildren, v => { BoltCore.Configuration.carryChildren = v; BoltCore.Configuration.Save(); }); - - toolbar.Add(relationsButton); - toolbar.Add(valuesButton); - toolbar.Add(dimButton); - toolbar.Add(carryButton); + var flowSection = CreateSection("CanvasSection"); + flowSection.Add(CreateToggle(EditorGUIUtility.IconContent("UnityEditor.Graphs.AnimatorControllerTool").image, "Port Relations", flowCanvas.showRelations, v => flowCanvas.showRelations = v, ButtonPosition.Left)); + flowSection.Add(CreateToggle(EditorGUIUtility.IconContent("UnityEditor.InspectorWindow").image, "Flow Values", BoltFlow.Configuration.showConnectionValues, v => { BoltFlow.Configuration.showConnectionValues = v; BoltFlow.Configuration.Save(); }, ButtonPosition.Middle)); + flowSection.Add(CreateDimNodesToggle(ButtonPosition.Middle)); + flowSection.Add(CreateToggle(BoltCore.Icons.window?[IconSize.Small], "Carry Children", BoltCore.Configuration.carryChildren, v => { BoltCore.Configuration.carryChildren = v; BoltCore.Configuration.Save(); }, ButtonPosition.Right)); + toolbar.Add(flowSection); } - else if (canvas is StateCanvas stateCanvas) + else if (canvas is StateCanvas) { - var dimButton = CreateToggleButton(EditorGUIUtility.IconContent("animationvisibilitytoggleoff").image, "Dim States", BoltCore.Configuration.dimInactiveNodes, v => { BoltCore.Configuration.dimInactiveNodes = v; BoltFlow.Configuration.Save(); }); - toolbar.Add(dimButton); + var stateSection = CreateSection("CanvasSection"); + stateSection.Add(CreateDimNodesToggle(ButtonPosition.All)); + toolbar.Add(stateSection); } - toolbar.Add(CreateEnumButton(PathUtil.Load("Align", CommunityEditorPath.Fundamentals)?[IconSize.Small], "Align", (r) => - { - LudiqGUI.FuzzyDropdown(r, EnumOptionTree.For(), null, op => canvas.Align((AlignOperation)op)); - }, canvas)); + var layoutSection = CreateSection("LayoutSection"); + layoutSection.Add(CreateActionButton(PathUtil.Load("Align", CommunityEditorPath.Fundamentals)?[IconSize.Small], "Align", b => + LudiqGUI.FuzzyDropdown(b.worldBound, EnumOptionTree.For(), null, op => canvas.Align((AlignOperation)op)), + () => canvas.selection.Count > 1, ButtonPosition.Left)); - toolbar.Add(CreateEnumButton(PathUtil.Load("Distribute", CommunityEditorPath.Fundamentals)?[IconSize.Small], "Distribute", (r) => - { - LudiqGUI.FuzzyDropdown(r, EnumOptionTree.For(), null, op => canvas.Distribute((DistributeOperation)op)); - }, canvas)); + layoutSection.Add(CreateActionButton(PathUtil.Load("Distribute", CommunityEditorPath.Fundamentals)?[IconSize.Small], "Distribute", b => + LudiqGUI.FuzzyDropdown(b.worldBound, EnumOptionTree.For(), null, op => canvas.Distribute((DistributeOperation)op)), + () => canvas.selection.Count > 1, ButtonPosition.Right)); + toolbar.Add(layoutSection); - toolbar.Add(CreateOverviewButton(PathUtil.Load("Overview", CommunityEditorPath.Fundamentals)?[IconSize.Small], "Overview", () => - { - GraphUtility.OverrideContextIfNeeded(() => - canvas.ViewElements(reference.graph.elements)); - })); + var windowSection = CreateSection("WindowSection", BoltCore.Configuration.developerMode); + windowSection.Add(CreateActionButton((Texture2D)EditorGUIUtility.IconContent("SearchOverlay").image, "Overview", _ => + GraphUtility.OverrideContextIfNeeded(() => canvas.ViewElements(reference.graph.elements)), null , ButtonPosition.Left)); - toolbar.Add(CreateWindowMaximizeButton(PathUtil.Load("Maximize", CommunityEditorPath.Fundamentals)?[IconSize.Small], "Maximize", window)); + windowSection.Add(CreateStatefulToggle(PathUtil.Load("maximize_window", CommunityEditorPath.Fundamentals)?[IconSize.Small], "Maximize", + () => window.maximized, + v => { window.maximized = v; GUIUtility.ExitGUI(); }, ButtonPosition.Right)); + toolbar.Add(windowSection); if (BoltCore.Configuration.developerMode) { - toolbar.Add(CreateToggleButton(typeof(Debug).Icon()?[IconSize.Small], "Debug", BoltCore.Configuration.debug, v => - { - BoltCore.Configuration.debug = !BoltCore.Configuration.debug; - })); + var debugSection = CreateSection("DebugSection", false); + string iconName = EditorGUIUtility.isProSkin ? "debug On" : "debug"; + debugSection.Add(CreateToggle((Texture2D)EditorGUIUtility.IconContent(iconName).image, "Debug", BoltCore.Configuration.debug, v => BoltCore.Configuration.debug = v, ButtonPosition.All)); + toolbar.Add(debugSection); } } - RebuildToolbar(); - state.contextChanged += () => + toolbar.schedule.Execute(() => { - toolbar.schedule.Execute(() => RebuildToolbar()); - }; + if (previousDeveloperMode != BoltCore.Configuration.developerMode) + { + previousDeveloperMode = BoltCore.Configuration.developerMode; + toolbar.Q("DebugSection").style.display = BoltCore.Configuration.developerMode ? DisplayStyle.Flex : DisplayStyle.None; + toolbar.Q("WindowSection").style.marginRight = BoltCore.Configuration.developerMode ? 12 : 0; + } + }).Every(500); + RebuildToolbar(); + state.contextChanged += () => toolbar.schedule.Execute(RebuildToolbar); root.Add(toolbar); } - static VisualElement CreateFloatingToolbar(GraphWindow window) + static VisualElement CreateToolbarContainer(GraphWindow window) { - var context = window.context; var sidebars = GraphGUIUtilities.GetSidebars(window); const float rightMargin = 10f; return new VisualElement @@ -145,255 +116,166 @@ static VisualElement CreateFloatingToolbar(GraphWindow window) style = { position = Position.Absolute, - top = 30, + flexDirection = FlexDirection.Row, + top = 25, right = sidebars.right.show ? sidebars.right.GetWidth() + rightMargin : rightMargin, - width = GraphGUIUtilities.GetCanvasToolbarWidth(context.canvas), height = 25, backgroundColor = Color.clear, } }; } - public static void KeepAnchored(GraphWindow window) + private static VisualElement CreateSection(string sectionName, bool addSpace = true) { - var state = GraphGUIState.Get(window); - if (state.FloatingToolbar == null) return; - - const float rightMargin = 10f; - - try + var section = new VisualElement { - var sidebars = GraphGUIUtilities.GetSidebars(window); - state.FloatingToolbar.style.right = - sidebars.right.show ? sidebars.right.GetWidth() + rightMargin : rightMargin; - } - catch { } + name = sectionName, + style = { + flexDirection = FlexDirection.Row, + marginRight = addSpace ? 12 : 0, + height = 26 + } + }; + return section; } - - private static ToolbarButton CreateFloatingButton(Texture icon, string tooltip, Action callback, Action imgui) + private static ToolbarButton CreateBaseButton(Texture icon, string tooltip, ButtonPosition position) { - var btn = new ToolbarButton(() => callback()) + var btn = new ToolbarButton { tooltip = tooltip, focusable = false, - style = - { - width = FloatingToolbarButtonSize, - height = FloatingToolbarButtonSize, -#if UNITY_2022_2_OR_NEWER - backgroundSize = new BackgroundSize(Length.Percent(100), Length.Percent(100)) -#else - unityBackgroundScaleMode = ScaleMode.ScaleToFit, -#endif + style = { + width = 34, height = 26, + justifyContent = Justify.Center, alignItems = Align.Center, + backgroundColor = BackgroundColor, + borderLeftColor = BorderColor, borderTopColor = BorderColor, + borderBottomColor = BorderColor, borderRightColor = BorderColor, + borderLeftWidth = 1, borderRightWidth = 1, borderTopWidth = 1, borderBottomWidth = 1, + borderTopLeftRadius = position == ButtonPosition.Left || position == ButtonPosition.All ? 3 : 0, + borderBottomLeftRadius = position == ButtonPosition.Left || position == ButtonPosition.All ? 3 : 0, + borderTopRightRadius = position == ButtonPosition.Right || position == ButtonPosition.All ? 3 : 0, + borderBottomRightRadius = position == ButtonPosition.Right || position == ButtonPosition.All ? 3 : 0, + marginLeft = -1 } }; -#if UNITY_2023_2_OR_NEWER - if (icon != null) - btn.iconImage = icon as Texture2D; -#else if (icon != null) { - var img = new Image(); - img.image = icon; + var img = new Image { image = icon, scaleMode = ScaleMode.ScaleToFit }; + img.style.width = 16; img.style.height = 16; btn.Add(img); } -#endif - btn.Add(new IMGUIContainer(() => - { - btn.style.backgroundImage = LudiqStyles.spinnerButton.normal.background; - imgui(); - })); return btn; } - private static ToolbarButton CreateToggleButton(Texture icon, string tooltip, bool isOn, Action callback) + private static ToolbarButton CreateActionButton(Texture icon, string tooltip, Action onClick, Func enabledCheck = null,ButtonPosition position = ButtonPosition.Middle) { - ToolbarButton btn = null; - btn = new ToolbarButton(() => - { - isOn = !isOn; - callback(isOn); - }) - { - tooltip = tooltip, - focusable = false, - style = - { - width = FloatingToolbarButtonSize, - height = FloatingToolbarButtonSize, -#if UNITY_2022_2_OR_NEWER - backgroundSize = new BackgroundSize(Length.Percent(100), Length.Percent(100)) -#else - unityBackgroundScaleMode = ScaleMode.ScaleToFit, -#endif - } - }; + var btn = CreateBaseButton(icon, tooltip, position); + btn.clicked += () => onClick?.Invoke(btn); -#if UNITY_2023_2_OR_NEWER - if (icon != null) - btn.iconImage = icon as Texture2D; -#else - if (icon != null) + btn.RegisterCallback(e => btn.style.backgroundColor = HoverColor); + btn.RegisterCallback(e => btn.style.backgroundColor = BackgroundColor); + + if (enabledCheck != null) { - var imgContainer = new VisualElement(); - imgContainer.style.flexGrow = 1; - imgContainer.style.flexShrink = 1; - imgContainer.style.justifyContent = Justify.Center; - imgContainer.style.alignItems = Align.Center; - - var img = new Image(); - img.image = icon; - img.scaleMode = ScaleMode.ScaleToFit; - img.style.width = StyleKeyword.Auto; - img.style.height = StyleKeyword.Auto; - - imgContainer.Add(img); - btn.Add(imgContainer); + btn.SetEnabled(enabledCheck()); + btn.schedule.Execute(() => btn.SetEnabled(enabledCheck())).Every(100); } -#endif - var imgui = new IMGUIContainer(() => - { - btn.style.backgroundImage = !isOn ? LudiqStyles.spinnerButton.normal.background : LudiqStyles.spinnerButton.active.background; - }); - - btn.Add(imgui); return btn; } - private static ToolbarButton CreateWindowMaximizeButton(Texture icon, string tooltip, GraphWindow window) + private static ToolbarButton CreateToggle(Texture icon, string tooltip, bool initialState, Action onToggle, ButtonPosition position) { - ToolbarButton btn = null; - btn = new ToolbarButton(() => - { - window.maximized = !window.maximized; - GUIUtility.hotControl = 0; - GUIUtility.keyboardControl = 0; - GUIUtility.ExitGUI(); - }) - { - tooltip = tooltip, - focusable = false, - style = - { - width = FloatingToolbarButtonSize, - height = FloatingToolbarButtonSize, -#if UNITY_2022_2_OR_NEWER - backgroundSize = new BackgroundSize(Length.Percent(100), Length.Percent(100)) -#else - unityBackgroundScaleMode = ScaleMode.ScaleToFit, -#endif - } - }; + bool state = initialState; + var btn = CreateBaseButton(icon, tooltip, position); -#if UNITY_2023_2_OR_NEWER - if (icon != null) - btn.iconImage = icon as Texture2D; -#else - if (icon != null) - { - var img = new Image(); - img.image = icon; - btn.Add(img); - } -#endif + void UpdateStyle() => btn.style.backgroundColor = state ? ActiveColor : BackgroundColor; + UpdateStyle(); - btn.Add(new IMGUIContainer(() => + btn.clicked += () => { - btn.style.backgroundImage = !window.maximized ? LudiqStyles.spinnerButton.normal.background : LudiqStyles.spinnerButton.active.background; - })); + state = !state; + onToggle?.Invoke(state); + btn.style.backgroundColor = state ? ActiveHoverColor : HoverColor; + }; + + btn.RegisterCallback(e => btn.style.backgroundColor = state ? ActiveHoverColor : HoverColor); + btn.RegisterCallback(e => UpdateStyle()); return btn; } - private static ToolbarButton CreateOverviewButton(Texture2D icon, string tooltip, Action callback) + private static ToolbarButton CreateStatefulToggle(Texture icon, string tooltip, Func getter, Action setter, ButtonPosition position) { - var btn = new ToolbarButton(callback) - { - tooltip = tooltip, - focusable = false, - style = - { - width = FloatingToolbarButtonSize, - height = FloatingToolbarButtonSize, -#if UNITY_2022_2_OR_NEWER - backgroundSize = new BackgroundSize(Length.Percent(100), Length.Percent(100)) -#else - unityBackgroundScaleMode = ScaleMode.ScaleToFit, -#endif - } - }; + var btn = CreateBaseButton(icon, tooltip, position); -#if UNITY_2023_2_OR_NEWER - if (icon != null) - btn.iconImage = icon; -#else - if (icon != null) - { - var img = new Image(); - img.image = icon; - btn.Add(img); - } -#endif + void UpdateStyle() => btn.style.backgroundColor = getter() ? ActiveColor : BackgroundColor; + UpdateStyle(); - btn.Add(new IMGUIContainer(() => + btn.clicked += () => { - btn.style.backgroundImage = LudiqStyles.spinnerButton.normal.background; - })); + bool newState = !getter(); + btn.style.backgroundColor = newState ? ActiveColor : BackgroundColor; + setter?.Invoke(newState); + }; + + btn.RegisterCallback(e => btn.style.backgroundColor = getter() ? ActiveHoverColor : HoverColor); + btn.RegisterCallback(e => UpdateStyle()); return btn; } - private static ToolbarButton CreateEnumButton(Texture2D icon, string tooltip, Action callback, ICanvas canvas) + private static ToolbarButton CreateErrorButton(GraphWindow window) { - bool show = false; - var btn = new ToolbarButton(() => + var btn = CreateActionButton(EditorGUIUtility.IconContent("console.erroricon.inactive.sml").image, "Clear Errors", _ => { - show = true; - }) - { - tooltip = tooltip, - focusable = false, - style = - { - width = FloatingToolbarButtonSize, - height = FloatingToolbarButtonSize, -#if UNITY_2022_2_OR_NEWER - backgroundSize = new BackgroundSize(Length.Percent(100), Length.Percent(100)) -#else - unityBackgroundScaleMode = ScaleMode.ScaleToFit, -#endif - } - }; + var reference = window.reference; + foreach (var ed in reference.debugData.elementsData.Where(e => e.runtimeException != null)) + ed.runtimeException = null; + }, null, ButtonPosition.All); - btn.Add(new IMGUIContainer(() => - { - btn.style.backgroundImage = LudiqStyles.spinnerButton.normal.background; - btn.SetEnabled(canvas.selection.Count > 1); + bool hasErrors = window.reference?.debugData?.elementsData.Any(e => e.runtimeException != null) ?? false; - if (show) - { - show = false; - callback?.Invoke(btn.layout); - } - })); + btn.style.opacity = hasErrors ? 1 : 0; + btn.tooltip = hasErrors ? "Clear Errors" : ""; -#if UNITY_2023_2_OR_NEWER - if (icon != null) - btn.iconImage = icon; -#else - if (icon != null) + btn.schedule.Execute(() => { - var img = new Image(); - img.image = icon; - btn.Add(img); - } -#endif + var hasErrors = window.reference?.debugData?.elementsData.Any(e => e.runtimeException != null) ?? false; + btn.style.opacity = hasErrors ? 1 : 0; + btn.tooltip = hasErrors ? "Clear Errors" : ""; + btn.SetEnabled(hasErrors); + }).Every(200); + + return btn; + } + + private static ToolbarButton CreateDimNodesToggle(ButtonPosition position) + { + Texture onIcon = EditorGUIUtility.IconContent("VisibilityOff").image; + Texture offIcon = EditorGUIUtility.IconContent("VisibilityOn").image; + ToolbarButton btn = null; + btn = CreateToggle(BoltCore.Configuration.dimInactiveNodes ? onIcon : offIcon, "Dim Nodes", BoltCore.Configuration.dimInactiveNodes, v => + { + BoltCore.Configuration.dimInactiveNodes = v; + BoltCore.Configuration.Save(); + var img = btn.Q(); + if (img != null) img.image = v ? onIcon : offIcon; + }, position); return btn; } + + public static void KeepAnchored(GraphWindow window) + { + var state = GraphGUIState.Get(window); + if (state.FloatingToolbar == null) return; + const float margin = 10f; + var sidebars = GraphGUIUtilities.GetSidebars(window); + state.FloatingToolbar.style.right = sidebars.right.show ? sidebars.right.GetWidth() + margin : margin; + } } } \ No newline at end of file diff --git a/Editor/Internal/Patches/GraphGUI/GraphGUIPatch.cs b/Editor/Internal/Patches/GraphGUI/GraphGUIPatch.cs index ab151fa6..3339a128 100644 --- a/Editor/Internal/Patches/GraphGUI/GraphGUIPatch.cs +++ b/Editor/Internal/Patches/GraphGUI/GraphGUIPatch.cs @@ -19,8 +19,8 @@ static GraphGUIPatch() static void OnEditorUpdate() { #if NEW_TOOLBAR_STYLE - var tabs = GraphWindow.tabs; - if (tabs == null || tabs.Count() == 0) + var tabs = GraphWindow.tabsNoAlloc; + if (tabs == null || tabs.Count == 0) return; foreach (var window in tabs) diff --git a/Editor/Internal/Patches/GraphGUI/GraphGUIStyles.cs b/Editor/Internal/Patches/GraphGUI/GraphGUIStyles.cs index 367463b0..1d42b5b6 100644 --- a/Editor/Internal/Patches/GraphGUI/GraphGUIStyles.cs +++ b/Editor/Internal/Patches/GraphGUI/GraphGUIStyles.cs @@ -99,10 +99,10 @@ public static void InitializeNewGUI() ApplyNodeStyle(NodeColor.Green, "GreenNode"); ApplyNodeStyle(NodeColor.Gray, "GrayNode"); ApplyNodeStyle(NodeColor.Yellow, "YellowNode"); - ApplyNodeStyle(NodeColor.Orange, "OrangeNode", "OrangeNodeSelected"); + ApplyNodeStyle(NodeColor.Orange, "OrangeNode"); ApplyNodeStyle(NodeColor.Teal, "TealNode"); - ApplyNodeStyle(NodeColor.Blue, "BlueNode"); - ApplyNodeStyle(NodeColor.Red, "RedNode", "RedNodeSelected"); + ApplyNodeStyle(NodeColor.Blue, "BlueNode", "SelectedBlueNode"); + ApplyNodeStyle(NodeColor.Red, "RedNode"); var stateBackground = VisualScripting.StateWidget.Styles.contentBackground; @@ -156,19 +156,23 @@ private static void ApplyNodeStyle(NodeColor color, string normal, string select { var style = GraphGUI.GetNodeStyle(NodeShape.Square, color); + var normalTexture = PathUtil.Load(normal, CommunityEditorPath.Fundamentals)?[IconSize.Large]; + var selectedTexture = PathUtil.Load(selected, CommunityEditorPath.Fundamentals)?[IconSize.Large]; + style.normal.background = - PathUtil.Load(normal, CommunityEditorPath.Fundamentals)?[IconSize.Large]; + normalTexture; style.active.background = - PathUtil.Load(selected, CommunityEditorPath.Fundamentals)?[IconSize.Large]; + selectedTexture; style.focused.background = - PathUtil.Load(selected, CommunityEditorPath.Fundamentals)?[IconSize.Large]; + selectedTexture; style.hover.background = - PathUtil.Load(selected, CommunityEditorPath.Fundamentals)?[IconSize.Large]; + selectedTexture; - style.padding = new RectOffset(5, 5, 5, 5); + style.border = new RectOffset(12, 12, 12, 12); + style.padding = new RectOffset(8, 8, 8, 8); } } } \ No newline at end of file diff --git a/Editor/Internal/Patches/GraphGUI/GraphGUIToolbar.cs b/Editor/Internal/Patches/GraphGUI/GraphGUIToolbar.cs index 35d56cfa..f9421fad 100644 --- a/Editor/Internal/Patches/GraphGUI/GraphGUIToolbar.cs +++ b/Editor/Internal/Patches/GraphGUI/GraphGUIToolbar.cs @@ -9,6 +9,11 @@ namespace Unity.VisualScripting.Community { internal static class GraphGUIToolbar { + private static readonly Color BackgroundColor = EditorGUIUtility.isProSkin ? new Color32(56, 56, 56, 255) : new Color32(194, 194, 194, 255); + private static readonly Color HoverColor = EditorGUIUtility.isProSkin ? new Color32(76, 76, 76, 255) : new Color32(214, 214, 214, 255); + private static readonly Color ActiveColor = EditorGUIUtility.isProSkin ? new Color32(88, 88, 88, 255) : new Color32(150, 150, 150, 255); + private static readonly Color ActiveHoverColor = EditorGUIUtility.isProSkin ? new Color32(108, 108, 108, 255) : new Color32(130, 130, 130, 255); + public static void Build(VisualElement root, GraphWindow window) { var state = GraphGUIState.Get(window); @@ -117,11 +122,7 @@ static void ToolbarGUI(VisualElement root, GraphWindow window, VisualElement too Texture2D lockedIconTex = null; ToolbarButton lockedButton = null; - lockedButton = CreateToggleButton("", 30, 20, () => !window.locked ? disabledColor : ColorPalette.unityBackgroundMid, () => - { - window.locked = !window.locked; - lockedButton.style.backgroundColor = !window.locked ? disabledColor : ColorPalette.unityBackgroundMid; - }); + lockedButton = CreateToggleButton("", 30, 20, () => window.locked, (val) => window.locked = val); IMGUIContainer initializer = null; initializer = new IMGUIContainer(() => { @@ -130,7 +131,7 @@ static void ToolbarGUI(VisualElement root, GraphWindow window, VisualElement too GraphGUIStyles.InitializeNewGUI(); if (lockedIconTex != null) return; - + try { lockedIconTex = GraphGUI.Styles.lockIcon.image as Texture2D; @@ -145,20 +146,20 @@ static void ToolbarGUI(VisualElement root, GraphWindow window, VisualElement too }); ToolbarButton inspectorButton = null; - inspectorButton = CreateToggleButton("", 30, 20, () => !window.graphInspectorEnabled ? disabledColor : ColorPalette.unityBackgroundMid, () => - { - window.graphInspectorEnabled = !window.graphInspectorEnabled; - inspectorButton.style.backgroundColor = !window.graphInspectorEnabled ? disabledColor : ColorPalette.unityBackgroundMid; - window.MatchSelection(); - }, BoltCore.Icons.inspectorWindow?[IconSize.Small]); + inspectorButton = CreateToggleButton("", 30, 20, () => window.graphInspectorEnabled, + (val) => + { + window.graphInspectorEnabled = val; + window.MatchSelection(); + }, BoltCore.Icons.inspectorWindow?[IconSize.Small]); ToolbarButton variablesButton = null; - variablesButton = CreateToggleButton("", 40, 20, () => !window.variablesInspectorEnabled ? disabledColor : ColorPalette.unityBackgroundMid, () => - { - window.variablesInspectorEnabled = !window.variablesInspectorEnabled; - variablesButton.style.backgroundColor = !window.variablesInspectorEnabled ? disabledColor : ColorPalette.unityBackgroundMid; - window.MatchSelection(); - }, BoltCore.Icons.variablesWindow?[IconSize.Small]); + variablesButton = CreateToggleButton("", 40, 20, () => window.variablesInspectorEnabled, + (val) => + { + window.variablesInspectorEnabled = val; + window.MatchSelection(); + }, BoltCore.Icons.variablesWindow?[IconSize.Small]); toolbar.Add(lockedButton); toolbar.Add(inspectorButton); @@ -174,9 +175,9 @@ static void ToolbarGUI(VisualElement root, GraphWindow window, VisualElement too toolbar.Add(GraphGUIUtilities.CreateZoomContainer(window)); } - private static ToolbarButton CreateToggleButton(string text, float width, float height, Func backgroundColor, Action callback, Texture2D icon = null) + private static ToolbarButton CreateToggleButton(string text, float width, float height, Func getter, Action setter, Texture2D icon = null) { - var btn = new ToolbarButton(callback) + var btn = new ToolbarButton() { text = text, focusable = false, @@ -184,7 +185,7 @@ private static ToolbarButton CreateToggleButton(string text, float width, float { width = width, height = height, - backgroundColor = backgroundColor(), + backgroundColor = getter() ? ActiveColor : BackgroundColor, #if UNITY_2022_2_OR_NEWER backgroundSize = new BackgroundSize(16f, 16f) #else @@ -193,29 +194,35 @@ private static ToolbarButton CreateToggleButton(string text, float width, float } }; -#if UNITY_2022_2_OR_NEWER - if (icon != null) btn.style.backgroundImage = icon; -#else - if (icon != null) + void UpdateColor(bool isHovering) { - var imgContainer = new VisualElement(); - imgContainer.style.flexGrow = 1; - imgContainer.style.flexShrink = 1; - imgContainer.style.justifyContent = Justify.Center; - imgContainer.style.alignItems = Align.Center; - - var img = new Image(); - img.image = icon; - img.scaleMode = ScaleMode.ScaleToFit; - img.style.width = 16f; - img.style.height = 16f; - - imgContainer.Add(img); - btn.Add(imgContainer); + bool isActive = getter(); + if (isHovering) + btn.style.backgroundColor = isActive ? ActiveHoverColor : HoverColor; + else + btn.style.backgroundColor = isActive ? ActiveColor : BackgroundColor; } + + btn.clicked += () => + { + setter(!getter()); + UpdateColor(true); + }; + + btn.RegisterCallback(evt => UpdateColor(true)); + btn.RegisterCallback(evt => UpdateColor(false)); + + if (icon != null) + { +#if UNITY_2022_2_OR_NEWER + btn.style.backgroundImage = icon; +#else + var img = new Image { image = icon, scaleMode = ScaleMode.ScaleToFit }; + img.style.width = 16f; img.style.height = 16f; + btn.Add(img); #endif - btn.RegisterCallback(evt => btn.style.backgroundColor = new Color(0.3f, 0.3f, 0.3f, 0.5f)); - btn.RegisterCallback(evt => btn.style.backgroundColor = backgroundColor()); + } + return btn; } diff --git a/Editor/Internal/Patches/GraphGUI/GraphGUIUtilities.cs b/Editor/Internal/Patches/GraphGUI/GraphGUIUtilities.cs index 201fcede..2e826790 100644 --- a/Editor/Internal/Patches/GraphGUI/GraphGUIUtilities.cs +++ b/Editor/Internal/Patches/GraphGUI/GraphGUIUtilities.cs @@ -22,22 +22,22 @@ public static VisualElement CreateZoomContainer(GraphWindow window) var container = new VisualElement { style = - { - flexDirection = FlexDirection.Row, - alignItems = Align.Center, - justifyContent = Justify.FlexEnd, - flexGrow = 1 - } + { + flexDirection = FlexDirection.Row, + alignItems = Align.Center, + justifyContent = Justify.FlexEnd, + flexGrow = 1 + } }; var zoomLabel = new Label("Zoom") { style = - { - unityTextAlign = TextAnchor.MiddleLeft, - marginRight = 2, - fontSize = 11 - } + { + unityTextAlign = TextAnchor.MiddleLeft, + marginRight = 2, + fontSize = 11 + } }; container.Add(zoomLabel); @@ -50,13 +50,13 @@ public static VisualElement CreateZoomContainer(GraphWindow window) }; container.Add(zoomSlider); - var zoomValue = new Label($"{window.context.graph.zoom:0.#}x") + var zoomValue = new Label($"{window.context.graph.zoom:0.0}x") { style = { unityTextAlign = TextAnchor.MiddleLeft, marginLeft = 2, - fontSize = 11 + fontSize = 11, } }; @@ -65,18 +65,19 @@ public static VisualElement CreateZoomContainer(GraphWindow window) container.Add(new IMGUIContainer(() => { if (window.context == null) return; - zoomValue.text = $"{window.context.graph.zoom:0.#}x"; + zoomValue.text = $"{window.context.graph.zoom:0.0}x"; zoomSlider.value = window.context.graph.zoom; })); zoomSlider.RegisterValueChangedCallback(ev => { window.context.graph.zoom = ev.newValue; - zoomValue.text = $"{ev.newValue:0.#}x"; + zoomValue.text = $"{ev.newValue:0.0}x"; }); return container; } + public const float FloatingToolbarButtonSize = 28; public static float GetCanvasToolbarWidth(ICanvas canvas) { @@ -85,16 +86,18 @@ public static float GetCanvasToolbarWidth(ICanvas canvas) { size = 1; } + if (canvas is FlowCanvas) { size += 8; - return (FloatingToolbarButtonSize * size) + 10; + return (FloatingToolbarButtonSize * size) + (30 * 4); } else if (canvas is StateCanvas) { size += 6; - return (FloatingToolbarButtonSize * size) + 10; + return (FloatingToolbarButtonSize * size) + (30 * 4); } + return 0; } } diff --git a/Editor/Internal/Patches/GraphMinimap/GraphMiniMapManager.cs b/Editor/Internal/Patches/GraphMinimap/GraphMiniMapManager.cs index 70be0765..32d0e4f2 100644 --- a/Editor/Internal/Patches/GraphMinimap/GraphMiniMapManager.cs +++ b/Editor/Internal/Patches/GraphMinimap/GraphMiniMapManager.cs @@ -2,75 +2,94 @@ using System.Linq; using UnityEditor; -namespace Unity.VisualScripting.Community +namespace Unity.VisualScripting.Community { [InitializeAfterPlugins] public static class GraphMinimapManager { - #if ENABLE_GRAPH_MINIMAP private static readonly Dictionary instances = new Dictionary(); - + + private static double lastUpdateTime; + private const double UpdateInterval = 1.0 / 30.0; static GraphMinimapManager() { - GraphMiniMapStorage.Load(); EditorApplication.update += Update; } - + private static void Update() { + double currentTime = EditorApplication.timeSinceStartup; + if (currentTime - lastUpdateTime < UpdateInterval) + return; + + lastUpdateTime = currentTime; + if (!ProviderPatcher.isWidgetsPatched) return; - + if (GraphGUIUtilities.DisableUI) { DisposeAll(); return; } - - var tabs = GraphWindow.tabs; - if (tabs == null) + + var tabs = GraphWindow.tabsNoAlloc; + if (tabs == null || tabs.Count == 0) return; - + foreach (var window in tabs) { if (window == null) continue; - + if (!instances.TryGetValue(window, out var instance)) { if (window.context == null) continue; - + instance = new GraphMinimapInstance(window); instances.Add(window, instance); } - + instance.Tick(); } - + CleanupClosedWindows(); - GraphMiniMapStorage.SaveIfNeeded(); } - + private static void CleanupClosedWindows() { - var closed = instances.Keys.Where(w => w == null).ToList(); - foreach (var window in closed) + List closed = null; + + foreach (var key in instances.Keys) + { + if (key == null) + { + closed ??= new List(); + closed.Add(key); + } + } + + if (closed != null) { - instances[window].Dispose(); - instances.Remove(window); + for (int i = 0; i < closed.Count; i++) + { + var window = closed[i]; + instances[window]?.Dispose(); + instances.Remove(window); + } } } - + private static void DisposeAll() { foreach (var instance in instances.Values) instance.Dispose(); - + instances.Clear(); } #endif - } + } } \ No newline at end of file diff --git a/Editor/Internal/Patches/GraphMinimap/GraphMinimapElement.cs b/Editor/Internal/Patches/GraphMinimap/GraphMinimapElement.cs new file mode 100644 index 00000000..560e91d1 --- /dev/null +++ b/Editor/Internal/Patches/GraphMinimap/GraphMinimapElement.cs @@ -0,0 +1,248 @@ +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Unity.VisualScripting.Community +{ + public class GraphMinimapElement : Foldout + { + public const float DefaultX = 200f; + public const float DefaultY = 150f; + private IGraphContext _context; + private List _widgets = new List(); + private IGraphElementWidget _selectedWidget; + + private const float Padding = 50f; + private Rect _combinedBounds; + private float _scale; + private Vector2 _minimapOffset; + + private Vector2 canvasPan; + private Rect canvasViewport; + + public GraphMinimapElement() + { + style.backgroundColor = new Color(0.15f, 0.15f, 0.15f, 0.8f); + style.borderLeftColor = style.borderRightColor = style.borderTopColor = style.borderBottomColor = new Color(0.1f, 0.1f, 0.1f, 0.5f); + style.borderLeftWidth = style.borderRightWidth = style.borderTopWidth = style.borderBottomWidth = 1f; + + var defaultToggle = this.Q(className: Foldout.toggleUssClassName); + if (defaultToggle != null) + { + defaultToggle.style.display = DisplayStyle.None; + } + + RegisterCallback(OnPointerDown); + + generateVisualContent += OnGenerateVisualContent; + // Use the foldout's ability to persist it's Foldout State for the Minimized State + viewDataKey = "VisualScripting-Minimap-Expanded"; + Add(new IMGUIContainer(CanvasSnapshotCapture)); + } + + private void CanvasSnapshotCapture() + { + if (_context == null) return; + + var canvas = _context.canvas; + if (canvas == null) return; + + canvasPan = canvas.pan; + canvasViewport = canvas.viewport; + } + + public void UpdateMinimap(IGraphContext context, List widgets) + { + _context = context; + + _widgets.Clear(); + if (widgets != null) _widgets.AddRange(widgets); + + MarkDirtyRepaint(); + } + + private void OnGenerateVisualContent(MeshGenerationContext mgc) + { + if (_context?.graph == null || _widgets.Count == 0) return; + + var canvas = _context.canvas; + if (canvas == null) return; + + Rect localRect = contentRect; + if (localRect.width <= 1 || localRect.height <= 1) return; + + Rect contentBounds = GraphGUI.CalculateArea(_widgets); + contentBounds.xMin -= Padding; + contentBounds.yMin -= Padding; + contentBounds.xMax += Padding; + contentBounds.yMax += Padding; + + Rect viewportWorld = new Rect(canvasPan - canvasViewport.size * 0.5f, canvasViewport.size); + _combinedBounds = contentBounds.Encompass(viewportWorld); + + float scaleX = localRect.width / _combinedBounds.width; + float scaleY = localRect.height / _combinedBounds.height; + _scale = Mathf.Min(scaleX, scaleY); + + if (_scale <= 0f || float.IsInfinity(_scale)) return; + + _minimapOffset = localRect.center - _combinedBounds.size * (_scale * 0.5f); + + var painter = mgc.painter2D; + + bool contextIsValid = GraphContextProvider.instance.IsValid(_context.reference); + + foreach (var widget in _widgets) + { + if (widget == null || !canvas.widgetProvider.IsValid(widget.item) || !contextIsValid) continue; + + Rect drawRect = ToMinimapRect(widget.position); + + painter.fillColor = GetElementColor(widget).WithAlpha(0.2f); + painter.BeginPath(); + painter.MoveTo(new Vector2(drawRect.xMin, drawRect.yMin)); + painter.LineTo(new Vector2(drawRect.xMax, drawRect.yMin)); + painter.LineTo(new Vector2(drawRect.xMax, drawRect.yMax)); + painter.LineTo(new Vector2(drawRect.xMin, drawRect.yMax)); + painter.ClosePath(); + painter.Fill(); + + if (canvas.selection.Contains(widget.element)) + { + painter.strokeColor = Color.white; + painter.lineWidth = 1f; + painter.BeginPath(); + painter.MoveTo(new Vector2(drawRect.xMin, drawRect.yMin)); + painter.LineTo(new Vector2(drawRect.xMax, drawRect.yMin)); + painter.LineTo(new Vector2(drawRect.xMax, drawRect.yMax)); + painter.LineTo(new Vector2(drawRect.xMin, drawRect.yMax)); + painter.ClosePath(); + painter.Stroke(); + } + } + + Rect viewRect = ToMinimapRect(viewportWorld); + viewRect.xMin = Mathf.Max(viewRect.xMin, 0); + viewRect.yMin = Mathf.Max(viewRect.yMin, 0); + viewRect.xMax = Mathf.Min(viewRect.xMax, localRect.width); + viewRect.yMax = Mathf.Min(viewRect.yMax, localRect.height); + + painter.fillColor = new Color(1f, 1f, 0f, 0.05f); + painter.BeginPath(); + painter.MoveTo(new Vector2(viewRect.xMin, viewRect.yMin)); + painter.LineTo(new Vector2(viewRect.xMax, viewRect.yMin)); + painter.LineTo(new Vector2(viewRect.xMax, viewRect.yMax)); + painter.LineTo(new Vector2(viewRect.xMin, viewRect.yMax)); + painter.ClosePath(); + painter.Fill(); + + painter.strokeColor = Color.yellow; + painter.lineWidth = 1.5f; + painter.BeginPath(); + painter.MoveTo(new Vector2(viewRect.xMin, viewRect.yMin)); + painter.LineTo(new Vector2(viewRect.xMax, viewRect.yMin)); + painter.LineTo(new Vector2(viewRect.xMax, viewRect.yMax)); + painter.LineTo(new Vector2(viewRect.xMin, viewRect.yMax)); + painter.ClosePath(); + painter.Stroke(); + } + + private void OnPointerDown(PointerDownEvent evt) + { + if (_context?.graph == null || _widgets.Count == 0 || evt.button != 0) return; + + var canvas = _context.canvas; + if (canvas == null) return; + + Vector2 mousePos = evt.localPosition; + Vector2 mouseWorld = (mousePos - _minimapOffset) / _scale + _combinedBounds.min; + + var selection = canvas.selection; + bool contextIsValid = GraphContextProvider.instance.IsValid(_context.reference); + + List hitWidgets = new List(); + IGraphElementWidget closest = null; + float closestDistSq = float.MaxValue; + + foreach (var widget in _widgets) + { + if (widget == null || !canvas.widgetProvider.IsValid(widget.item) || !contextIsValid) continue; + + Rect drawRect = ToMinimapRect(widget.position); + + if (drawRect.Contains(mousePos)) + hitWidgets.Add(widget); + + float distSq = (widget.position.center - mouseWorld).sqrMagnitude; + if (distSq < closestDistSq) + { + closestDistSq = distSq; + closest = widget; + } + } + + IGraphElementWidget target; + if (hitWidgets.Count > 0) + { + int index = 0; + if (_selectedWidget != null) + { + int i = hitWidgets.IndexOf(_selectedWidget); + if (i >= 0) index = (i + 1) % hitWidgets.Count; + } + target = hitWidgets[index]; + } + else + { + target = closest; + } + + if (target != null) + { + _selectedWidget = target; + + GraphUtility.OverrideContextIfNeeded(() => + { + if (target.canSelect) + { + if (evt.actionKey) + selection.Add(target.element); + else + selection.Select(target.element); + } + + canvas.ViewElements(target.element.Yield()); + }); + + evt.StopPropagation(); + } + } + + private Rect ToMinimapRect(Rect worldRect) + { + return new Rect + { + position = (worldRect.position - _combinedBounds.min) * _scale + _minimapOffset, + size = worldRect.size * _scale + }; + } + + private static Color GetElementColor(IWidget widget) + { + if (widget is IUnitWidget) + { + if (widget is CommentNodeWidget comment) return comment.element.color; + if (widget is ArrowWidget arrowWidget) return arrowWidget.element.Color; + return Color.gray; + } + if (widget is GraphGroupWidget group) return group.element.color; + +#if VISUAL_SCRIPTING_1_8_0_OR_GREATER + if (widget is StickyNoteWidget sticky) return StickyNote.GetStickyColor(sticky.element.colorTheme); +#endif + return Color.white; + } + } +} \ No newline at end of file diff --git a/Editor/Internal/Patches/GraphMinimap/GraphMinimapRenderer.cs.meta b/Editor/Internal/Patches/GraphMinimap/GraphMinimapElement.cs.meta similarity index 100% rename from Editor/Internal/Patches/GraphMinimap/GraphMinimapRenderer.cs.meta rename to Editor/Internal/Patches/GraphMinimap/GraphMinimapElement.cs.meta diff --git a/Editor/Internal/Patches/GraphMinimap/GraphMinimapInstance.cs b/Editor/Internal/Patches/GraphMinimap/GraphMinimapInstance.cs index cc221d37..a3bc0f70 100644 --- a/Editor/Internal/Patches/GraphMinimap/GraphMinimapInstance.cs +++ b/Editor/Internal/Patches/GraphMinimap/GraphMinimapInstance.cs @@ -10,33 +10,21 @@ namespace Unity.VisualScripting.Community { internal sealed class GraphMinimapInstance : IDisposable { - private static readonly HashSet activeInstances = new HashSet(); - private static Vector2 MinimapSize - { - get => new Vector2(GraphMiniMapStorage.Settings.width, GraphMiniMapStorage.Settings.height); - set - { - GraphMiniMapStorage.Settings.width = value.x; - GraphMiniMapStorage.Settings.height = value.y; - GraphMiniMapStorage.MarkDirty(); - } - } - private static Vector2 lastMousePos = Vector2.zero; private readonly GraphWindow window; private IGraphContext context; private readonly VisualElement container; - private readonly IMGUIContainer background; + private readonly GraphMinimapElement minimapRenderer; private readonly Button toggle; private IGraph subscribedGraph; - private IEnumerable widgets = Enumerable.Empty(); - public Sidebars sidebars; - private bool minimized; + private Vector2 lastExpandedSize = new Vector2(GraphMinimapElement.DefaultX, GraphMinimapElement.DefaultY); + + private bool minimized => minimapRenderer == null || !minimapRenderer.value; private static readonly Color MinimapBackgroundDark = new Color(0f, 0f, 0f, 0.9f); private static readonly Color MinimapBackgroundLight = new Color(1f, 1f, 1f, 0.9f); @@ -46,30 +34,37 @@ private static Vector2 MinimapSize public GraphMinimapInstance(GraphWindow window) { - activeInstances.Add(this); - this.window = window; this.context = window.context; sidebars = (Sidebars)sidebarsField.GetValue(window); - minimized = GraphMiniMapStorage.Settings - .minimized - .TryGetValue(window.reference.ToString(), out var value) && value; - container = CreateContainer(); - background = CreateRenderer(); + minimapRenderer = CreateRenderer(); toggle = CreateToggle(); - container.Add(background); + minimapRenderer.RegisterValueChangedCallback(OnMinimapValueChanged); + + container.Add(minimapRenderer); container.Add(toggle); AddResizeHandle(container); window.rootVisualElement.Add(container); + minimapRenderer.RegisterCallback(Initialize); + + Subscribe(context); + } + public void Initialize(GeometryChangedEvent evt) + { UpdateState(); - Subscribe(context); + minimapRenderer.UnregisterCallback(Initialize); + } + + private void OnMinimapValueChanged(ChangeEvent evt) + { + UpdateState(); } public void Tick() @@ -81,7 +76,7 @@ public void Tick() if (!minimized) { - background.MarkDirtyRepaint(); + minimapRenderer.UpdateMinimap(context, widgets); } KeepMinimapAnchored(); @@ -111,12 +106,30 @@ private void OnElementsChanged() EditorApplication.delayCall += CacheWidgets; } + private readonly List _cachedWidgets = new List(); + public List widgets => _cachedWidgets; + private void CacheWidgets() { - if (context?.graph == null) + _cachedWidgets.Clear(); + + if (context?.graph?.elements == null || context.canvas == null) return; - widgets = context.graph.elements.Select(e => context.canvas.Widget(e)).OfType(); + var elements = context.graph.elements.ToList(); + int count = elements.Count; + + for (int i = 0; i < count; i++) + { + var element = elements[i]; + if (element == null) continue; + + var widget = context.canvas.Widget(element); + if (widget != null) + { + _cachedWidgets.Add(widget); + } + } } private void KeepMinimapAnchored() @@ -142,54 +155,59 @@ private VisualElement CreateContainer() var miniMapContainer = new VisualElement { style = - { - position = Position.Absolute, - #if NEW_TOOLBAR_STYLE - top = 60, - #else - top = 30, - #endif - right = 10, - width = Mathf.Min(MinimapSize.x, context.canvas.viewport.width - 25), - height = Mathf.Min(MinimapSize.y, context.canvas.viewport.height - 25), - backgroundColor = isDark ? MinimapBackgroundDark : MinimapBackgroundLight, - borderTopLeftRadius = 8, - borderTopRightRadius = 8, - borderBottomLeftRadius = 8, - borderBottomRightRadius = 8, - borderBottomWidth = 1, - borderTopWidth = 1, - borderLeftWidth = 1, - borderRightWidth = 1, - borderBottomColor = BorderColor, - borderLeftColor = BorderColor, - borderRightColor = BorderColor, - borderTopColor = BorderColor - }, + { + position = Position.Absolute, +#if NEW_TOOLBAR_STYLE + top = 60, +#else + top = 30, +#endif + right = 10, + width = 55, + height = 26, + backgroundColor = isDark ? MinimapBackgroundDark : MinimapBackgroundLight, + borderTopLeftRadius = 8, + borderTopRightRadius = 8, + borderBottomLeftRadius = 8, + borderBottomRightRadius = 8, + borderBottomWidth = 1, + borderTopWidth = 1, + borderLeftWidth = 1, + borderRightWidth = 1, + borderBottomColor = BorderColor, + borderLeftColor = BorderColor, + borderRightColor = BorderColor, + borderTopColor = BorderColor + }, pickingMode = PickingMode.Ignore }; return miniMapContainer; } - private IMGUIContainer CreateRenderer() + private GraphMinimapElement CreateRenderer() { - var imgui = new IMGUIContainer(Draw); - imgui.cullingEnabled = false; - - return imgui; + var renderer = new GraphMinimapElement + { + style = + { + width = Length.Percent(100), + height = Length.Percent(100), + position = Position.Absolute, + borderTopLeftRadius = 8, + borderTopRightRadius = 8, + borderBottomLeftRadius = 8, + borderBottomRightRadius = 8, + } + }; + return renderer; } private Button CreateToggle() { var button = new Button(() => { - minimized = !minimized; - GraphMiniMapStorage.Settings - .minimized[window.reference.ToString()] = minimized; - - GraphMiniMapStorage.MarkDirty(); - UpdateState(); + minimapRenderer.value = !minimapRenderer.value; }) { style = @@ -220,15 +238,15 @@ private void AddResizeHandle(VisualElement container) { name = "MinimapResizeHandle", style = - { - position = Position.Absolute, - bottom = 0, - left = 0, - width = 12, - height = 12, - backgroundColor = Color.clear, - cursor = UIElementsCursorUpdater.DefaultCursor(UIElementsCursorUpdater.CursorType.ResizeUpRight) - } + { + position = Position.Absolute, + bottom = 0, + left = 0, + width = 12, + height = 12, + backgroundColor = Color.clear, + cursor = UIElementsCursorUpdater.DefaultCursor(UIElementsCursorUpdater.CursorType.ResizeUpRight) + } }; container.Add(resizeHandle); @@ -236,6 +254,7 @@ private void AddResizeHandle(VisualElement container) bool resizing = false; resizeHandle.RegisterCallback(evt => { + if (minimized) return; resizing = true; lastMousePos = evt.mousePosition; resizeHandle.CaptureMouse(); @@ -244,19 +263,23 @@ private void AddResizeHandle(VisualElement container) resizeHandle.RegisterCallback(evt => { - if (!resizing) return; + if (!resizing || minimized) return; Vector2 delta = evt.mousePosition - lastMousePos; lastMousePos = evt.mousePosition; - float newWidth = Mathf.Clamp(container.resolvedStyle.width - delta.x, 200, Mathf.Min(600, window.context.canvas.viewport.width - 25)); - float newHeight = Mathf.Clamp(container.resolvedStyle.height + delta.y, 150, Mathf.Min(500, window.context.canvas.viewport.height - 25)); + float maxW = GetSafeMaxViewportWidth(); + float maxH = GetSafeMaxViewportHeight(); + + float newWidth = Mathf.Clamp(container.resolvedStyle.width - delta.x, 200, maxW); + float newHeight = Mathf.Clamp(container.resolvedStyle.height + delta.y, 150, maxH); + + lastExpandedSize = new Vector2(newWidth, newHeight); container.style.width = newWidth; container.style.height = newHeight; - SetGlobalSize(new Vector2(newWidth, newHeight)); - background.MarkDirtyRepaint(); + ApplySize(lastExpandedSize); evt.StopPropagation(); }); @@ -269,67 +292,71 @@ private void AddResizeHandle(VisualElement container) }); } - private static void SetGlobalSize(Vector2 size) - { - MinimapSize = size; - GraphMiniMapStorage.MarkDirty(); - - foreach (var instance in activeInstances) - { - instance.ApplySize(size); - } - } - private void ApplySize(Vector2 size) { if (minimized) return; - container.style.width = - Mathf.Min(size.x, context.canvas.viewport.width - 25); + float maxW = GetSafeMaxViewportWidth(); + float maxH = GetSafeMaxViewportHeight(); - container.style.height = - Mathf.Min(size.y, context.canvas.viewport.height - 25); + container.style.width = Mathf.Min(size.x, maxW); + container.style.height = Mathf.Min(size.y, maxH); - background.MarkDirtyRepaint(); + minimapRenderer.UpdateMinimap(context, widgets); } private void UpdateState() { - if (container == null || background == null || toggle == null) + if (container == null || minimapRenderer == null || toggle == null) return; + var resizeHandle = container.Q("MinimapResizeHandle"); + if (minimized) { - background.style.display = DisplayStyle.None; - container.style.height = 26; + minimapRenderer.style.display = DisplayStyle.None; container.style.width = 55; + container.style.height = 26; toggle.text = "+"; - container.Q("MinimapResizeHandle").style.display = DisplayStyle.None; + if (resizeHandle != null) resizeHandle.style.display = DisplayStyle.None; } else { - background.style.display = DisplayStyle.Flex; - container.style.width = Mathf.Min(MinimapSize.x, context.canvas.viewport.width - 25); - container.style.height = Mathf.Min(MinimapSize.y, context.canvas.viewport.height - 25); + minimapRenderer.style.display = DisplayStyle.Flex; + + float maxW = GetSafeMaxViewportWidth(); + float maxH = GetSafeMaxViewportHeight(); + + container.style.width = Mathf.Clamp(lastExpandedSize.x, 200, maxW); + container.style.height = Mathf.Clamp(lastExpandedSize.y, 150, maxH); + toggle.text = "—"; - container.Q("MinimapResizeHandle").style.display = DisplayStyle.Flex; + if (resizeHandle != null) resizeHandle.style.display = DisplayStyle.Flex; + + minimapRenderer.UpdateMinimap(context, widgets); } container.MarkDirtyRepaint(); } - private void Draw() + private float GetSafeMaxViewportWidth() { - if (minimized) - return; + return 600f; + } - MiniMapRenderer.Draw(context, widgets); + private float GetSafeMaxViewportHeight() + { + return 550f; } public void Dispose() { - activeInstances.Remove(this); + if (minimapRenderer != null) + { + minimapRenderer.UnregisterValueChangedCallback(OnMinimapValueChanged); + + } if (subscribedGraph != null) { diff --git a/Editor/Internal/Patches/GraphMinimap/GraphMinimapRenderer.cs b/Editor/Internal/Patches/GraphMinimap/GraphMinimapRenderer.cs deleted file mode 100644 index 717f4eb4..00000000 --- a/Editor/Internal/Patches/GraphMinimap/GraphMinimapRenderer.cs +++ /dev/null @@ -1,182 +0,0 @@ -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; - -namespace Unity.VisualScripting.Community -{ - internal static class MiniMapRenderer - { - private static Vector2 MinimapSize => new Vector2( - GraphMiniMapStorage.Settings.width, - GraphMiniMapStorage.Settings.height - ); - - private static readonly List hitWidgets = new List(); - private static IGraphElementWidget selectedWidget; - - private const float Padding = 50f; - - public static void Draw(IGraphContext context, IEnumerable widgets) - { - if (context == null || context.graph == null) return; - - var canvas = context.graph.Canvas(); - if (canvas == null) return; - - Rect rect = GUILayoutUtility.GetRect(MinimapSize.x, MinimapSize.y); - GUI.BeginGroup(rect); - - Rect contentBounds = GraphGUI.CalculateArea(widgets); - contentBounds.xMin -= Padding; - contentBounds.yMin -= Padding; - contentBounds.xMax += Padding; - contentBounds.yMax += Padding; - - Rect viewportWorld = new Rect(canvas.pan - canvas.viewport.size * 0.5f, canvas.viewport.size); - Rect combinedBounds = contentBounds.Encompass(viewportWorld); - - float scaleX = rect.width / combinedBounds.width; - float scaleY = rect.height / combinedBounds.height; - float scale = scaleX < scaleY ? scaleX : scaleY; - if (scale <= 0f) { GUI.EndGroup(); return; } - - Vector2 minimapOffset = rect.center - combinedBounds.size * (scale * 0.5f); - Vector2 boundsMin = combinedBounds.min; - - Vector2 ToMinimap(Vector2 worldPos) - { - return (worldPos - boundsMin) * scale + minimapOffset; - } - - GraphUtility.OverrideContextIfNeeded(() => - { - hitWidgets.Clear(); - - var e = Event.current; - Vector2 mousePos = e.mousePosition; - Vector2 mouseWorld = (mousePos - minimapOffset) / scale + boundsMin; - - var selection = canvas.selection; - bool contextIsValid = GraphContextProvider.instance.IsValid(context.reference); - - IGraphElementWidget closest = null; - float closestDistSq = float.MaxValue; - - Rect drawRect = default; - - foreach (var widget in widgets) - { - if (!canvas.widgetProvider.IsValid(widget.item)) continue; - - if (widget == null) continue; - - if (!contextIsValid) continue; - - Rect wp = widget.position; - - drawRect.position = ToMinimap(wp.position); - drawRect.size = wp.size * scale; - - Handles.DrawSolidRectangleWithOutline( - drawRect, - GetElementColor(widget).WithAlpha(0.1f), - Color.white * (canvas.selection.Contains(widget.element) ? 1f : 0) - ); - - Vector2 center = wp.center; - Vector2 delta = center - mouseWorld; - float distSq = delta.sqrMagnitude; - - if (distSq < closestDistSq) - { - closestDistSq = distSq; - closest = widget; - } - - if (drawRect.Contains(mousePos)) - { - hitWidgets.Add(widget); - } - } - - if (e.type == EventType.MouseDown && e.button == 0) - { - IGraphElementWidget target = null; - - if (hitWidgets.Count > 0) - { - int index = 0; - if (selectedWidget != null) - { - int i = hitWidgets.IndexOf(selectedWidget); - if (i >= 0) index = (i + 1) % hitWidgets.Count; - } - target = hitWidgets[index]; - } - else - { - target = closest; - } - - if (target != null) - { - selectedWidget = target; - canvas.ViewElements(target.element.Yield()); - - if (target.canSelect) - { - if (e.shift) - selection.Add(target.element); - else - selection.Select(target.element); - } - - e.Use(); - } - } - }); - - Vector2 viewPos = ToMinimap(viewportWorld.position); - Vector2 viewSize = viewportWorld.size * scale; - - Rect viewRect = Rect.MinMaxRect( - Mathf.Max(viewPos.x, 0), - Mathf.Max(viewPos.y, 0), - Mathf.Min(viewPos.x + viewSize.x, MinimapSize.x), - Mathf.Min(viewPos.y + viewSize.y, MinimapSize.y) - ); - - Handles.DrawSolidRectangleWithOutline( - viewRect, - new Color(1f, 1f, 1f, 0.1f), - Color.yellow - ); - - GUI.EndGroup(); - } - - private static Color GetElementColor(IWidget widget) - { - if (widget is IUnitWidget unitWidget) - { - if (unitWidget is CommentNodeWidget commentNodeWidget) - return commentNodeWidget.element.color; - else if (unitWidget is ArrowWidget arrowWidget) - return arrowWidget.element.Color; - else - return Color.gray; - } - else if (widget is GraphGroupWidget group) - { - return group.element.color; - } -#if VISUAL_SCRIPTING_1_8_0_OR_GREATER - else if (widget is StickyNoteWidget sticky) - { - return StickyNote.GetStickyColor(sticky.element.colorTheme); - } -#endif - return Color.white; - } - } -} \ No newline at end of file diff --git a/Editor/Internal/Patches/GraphMinimap/GraphMinimapStorage.cs b/Editor/Internal/Patches/GraphMinimap/GraphMinimapStorage.cs deleted file mode 100644 index 3e8f988f..00000000 --- a/Editor/Internal/Patches/GraphMinimap/GraphMinimapStorage.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using UnityEngine; - -namespace Unity.VisualScripting.Community -{ - [Serializable] - public class GraphMiniMapSettings - { - public float width = 200f; - public float height = 150f; - public Dictionary minimized = new Dictionary(); - } - - public static class GraphMiniMapStorage - { - private static readonly string SettingsPath = "ProjectSettings/GraphMiniMapSettings.json"; - private static GraphMiniMapSettings _settings; - private static bool _isDirty; - - public static GraphMiniMapSettings Settings - { - get - { - if (_settings == null) - Load(); - return _settings; - } - } - - public static void Load() - { - if (File.Exists(SettingsPath)) - { - try - { - string json = File.ReadAllText(SettingsPath); - _settings = (GraphMiniMapSettings)new SerializationData(json).Deserialize() ?? new GraphMiniMapSettings(); - } - catch - { - _settings = new GraphMiniMapSettings(); - } - } - else - { - _settings = new GraphMiniMapSettings(); - } - } - - public static void Save() - { - try - { - Directory.CreateDirectory(Path.GetDirectoryName(SettingsPath)); - string json = _settings.Serialize().json; - File.WriteAllText(SettingsPath, json); - _isDirty = false; - } - catch (Exception e) - { - Debug.LogError($"[GraphMiniMap] Failed to save settings: {e}"); - } - } - - public static void MarkDirty() - { - _isDirty = true; - } - - public static void SaveIfNeeded() - { - if (_isDirty) - Save(); - } - } -} \ No newline at end of file diff --git a/Editor/Internal/Patches/GraphMinimap/GraphMinimapStorage.cs.meta b/Editor/Internal/Patches/GraphMinimap/GraphMinimapStorage.cs.meta deleted file mode 100644 index 6180051e..00000000 --- a/Editor/Internal/Patches/GraphMinimap/GraphMinimapStorage.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: a2fd95f13cc50264986dc6d01d2dfb43 \ No newline at end of file diff --git a/Editor/Internal/Patches/NesterAdaptor.cs b/Editor/Internal/Patches/NesterAdaptor.cs new file mode 100644 index 00000000..e67b514b --- /dev/null +++ b/Editor/Internal/Patches/NesterAdaptor.cs @@ -0,0 +1,180 @@ +using System.Reflection; +using Unity.VisualScripting.ReorderableList; +using UnityEditor; +using UnityEngine; + +namespace Unity.VisualScripting.Community +{ + public class NesterAdaptor : MetadataListAdaptor + { + public ReorderableListControl listControl; + private static readonly FieldInfo listControlFieldInfo = typeof(MetadataCollectionAdaptor).GetField("listControl", BindingFlags.NonPublic | BindingFlags.Instance); + + public NesterAdaptor(Metadata metadata, Inspector parentInspector) : base(metadata, parentInspector) + { + isExpanded = EditorPrefs.GetBool(ExpandedKey, true); + + if (listControlFieldInfo != null) + { + listControl = listControlFieldInfo.GetValueOptimized(this) as ReorderableListControl; + if (listControl != null) + { + listControl.Flags = ReorderableListFlags.HideAddButton | ReorderableListFlags.DisableContextMenu | ReorderableListFlags.DisableReordering; + } + } + } + + public override float GetItemHeight(float width, int index) + { + if (!isExpanded) return -4; + return EditorGUIUtility.singleLineHeight; + } + + protected override bool CanAdd() + { + return false; + } + + public override bool CanRemove(int index) + { + return false; + } + + private bool isExpanded = false; + + private const string ExpandedKey = "Community_FlowGraphEditor_NesterGraphs_Expanded"; + + protected override void OnTitleGUI(Rect position, GUIContent title) + { + EditorGUI.BeginChangeCheck(); + isExpanded = CommunityStyles.TitleFoldout(position, isExpanded, title); + if (EditorGUI.EndChangeCheck()) + { + EditorPrefs.SetBool(ExpandedKey, isExpanded); + } + } + + private static readonly RectOffset MissingSizeOffset = new RectOffset(0, 25, 0, 0); + public override void DrawItem(Rect position, int index) + { + if (!isExpanded || metadata[index] == null || metadata[index].value == null) return; + + var nesterElement = (IGraphNesterElement)metadata[index].value; + var nester = metadata[index]; + + var nestMetadata = nester[nameof(IGraphNesterElement.nest)]; + + var graphMetadata = nestMetadata?[nameof(IGraphNest.graph)]; + + try + { + if (graphMetadata?.value == null) + { + var helpBoxRect = position.ExpandByX(MissingSizeOffset); + EditorGUI.HelpBox(helpBoxRect, "Missing Graph Reference", MessageType.Warning); + + if (Event.current.type == EventType.MouseDown && helpBoxRect.Contains(Event.current.mousePosition)) + { + Event.current.Use(); + + var context = LudiqGraphsEditorUtility.editedContext.value; + if (context == null) context = GraphWindow.activeContext; + + if (context != null && context.reference != null && context.canvas != null) + { + context.canvas.ViewElements(new IGraphElement[] { (IGraphElement)nesterElement }); + } + } + return; + } + } + catch + { + return; + } + + var titleMetadata = graphMetadata[nameof(IGraph.title)]; + + const float buttonWidth = 50f; + const float iconSize = 16f; + const float spacing = 4f; + + position.width += buttonWidth / 2; + + var textureRect = new Rect(position.x, position.y + (position.height - iconSize) / 2, iconSize, iconSize); + GUI.DrawTexture(textureRect, nesterElement.GetType().Icon()?[IconSize.Small]); + + float titleWidth = position.width - iconSize - buttonWidth - (spacing * 2); + Rect titleRect = new Rect(position.x + iconSize + spacing, position.y, titleWidth, position.height); + + Rect buttonRect = new Rect(position.xMax - buttonWidth, position.y, buttonWidth, position.height - 4); + + string actualTitle = (string)titleMetadata.value; + string displayName = actualTitle; + + if (string.IsNullOrEmpty(actualTitle)) + { + displayName = GraphTraversal.GetNesterName(nesterElement); + } + + EditorGUI.BeginChangeCheck(); + + var userInput = EditorGUI.TextField(titleRect, displayName, EditorStyles.textField); + + if (EditorGUI.EndChangeCheck()) + { + if (userInput == GraphTraversal.GetNesterName(nesterElement)) + { + titleMetadata.value = string.Empty; + } + else + { + titleMetadata.value = userInput; + } + } + + if (GUI.Button(buttonRect, new GUIContent($"Open", $"Open {nesterElement.nest.source} graph"), EditorStyles.miniButton)) + { + var context = LudiqGraphsEditorUtility.editedContext.value; + + if (context == null) context = GraphWindow.activeContext; + + if (context == null || context.reference == null || context.canvas == null) return; + + context.canvas.window.reference = context.reference.ChildReference(nesterElement, false); + } + + HandleDragAndDrop(position, nesterElement); + } + + private void HandleDragAndDrop(Rect position, IGraphNesterElement nesterElement) + { + int controlID = GUIUtility.GetControlID(FocusType.Passive); + var e = Event.current; + + switch (e.GetTypeForControl(controlID)) + { + case EventType.MouseDown: + if (e.button == (int)MouseButton.Left && position.Contains(e.mousePosition)) + { + GUIUtility.hotControl = controlID; + e.Use(); + } + break; + + case EventType.MouseDrag: + if (GUIUtility.hotControl == controlID) + { + GUIUtility.hotControl = 0; + DragAndDrop.PrepareStartDrag(); + DragAndDrop.objectReferences = new UnityEngine.Object[0]; + DragAndDrop.paths = new string[0]; + DragAndDrop.SetGenericData("Graphs.NesterElementCopy", nesterElement.CloneViaFakeSerialization()); + DragAndDrop.StartDrag(metadata.path); + e.Use(); + } + break; + } + } + } +} \ No newline at end of file diff --git a/Editor/Internal/Patches/NesterAdaptor.cs.meta b/Editor/Internal/Patches/NesterAdaptor.cs.meta new file mode 100644 index 00000000..bf4fcca4 --- /dev/null +++ b/Editor/Internal/Patches/NesterAdaptor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5b6e2f61827f11b43950594b250ec2e5 \ No newline at end of file diff --git a/Editor/Internal/Patches/PatchedFlowGraphEditor.cs b/Editor/Internal/Patches/PatchedFlowGraphEditor.cs new file mode 100644 index 00000000..762ddb94 --- /dev/null +++ b/Editor/Internal/Patches/PatchedFlowGraphEditor.cs @@ -0,0 +1,178 @@ +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using JetBrains.Annotations; +using UnityEditor; +using UnityEngine; + +namespace Unity.VisualScripting.Community +{ + public class FlowGraphEditor : GraphEditor + { + public FlowGraphEditor(Metadata metadata) : base(metadata) + { + graph.units.ItemAdded += OnUnitAdded; + graph.units.ItemRemoved += OnItemRemoved; + + nesterMetadata = Metadata.Root().Object("editor", this).Member("nesters", BindingFlags.Instance | BindingFlags.NonPublic); + + nesterMetadata.value = new List(); + IEnumerable nesterUnits = graph.units.OfType(); + + nesterMetadata.value = nesterUnits + .Where(nester => nester.nest.source == GraphSource.Embed || nester == nesterUnits + .FirstOrDefault(n => n.nest.source == GraphSource.Macro && n.nest.macro == nester.nest.macro)).ToList(); + + nesterAdaptor = new NesterAdaptor(nesterMetadata, this); + } + + private bool nestersCached; + + [InspectorWide(true)] + [UsedImplicitly] + private List nesters = new List(); + + private NesterAdaptor nesterAdaptor; + + private void OnItemRemoved(IUnit unit) + { + if (unit is INesterUnit) nestersCached = false; + } + + private void OnUnitAdded(IUnit unit) + { + if (unit is INesterUnit) nestersCached = false; + } + + public override void Dispose() + { + graph.units.ItemAdded -= OnUnitAdded; + graph.units.ItemRemoved -= OnItemRemoved; + } + + private new FlowGraph graph => (FlowGraph)base.graph; + + private Metadata controlInputDefinitionsMetadata => metadata[nameof(FlowGraph.controlInputDefinitions)]; + private Metadata controlOutputDefinitionsMetadata => metadata[nameof(FlowGraph.controlOutputDefinitions)]; + private Metadata valueInputDefinitionsMetadata => metadata[nameof(FlowGraph.valueInputDefinitions)]; + private Metadata valueOutputDefinitionsMetadata => metadata[nameof(FlowGraph.valueOutputDefinitions)]; + + private readonly Metadata nesterMetadata; + + private IEnumerable warnings => UnitPortDefinitionUtility.Warnings((FlowGraph)metadata.value); + + protected override float GetHeight(float width, GUIContent label) + { + var height = 0f; + + height += GetHeaderHeight(width); + + height += GetControlInputDefinitionsHeight(width); + + height += EditorGUIUtility.standardVerticalSpacing; + + height += GetControlOutputDefinitionsHeight(width); + + height += EditorGUIUtility.standardVerticalSpacing; + + height += GetValueInputDefinitionsHeight(width); + + height += EditorGUIUtility.standardVerticalSpacing; + + height += GetValueOutputDefinitionsHeight(width); + + height += EditorGUIUtility.standardVerticalSpacing; + + height += LudiqGUI.GetInspectorHeight(this, nesterMetadata, width); + + height += EditorGUIUtility.standardVerticalSpacing; + + if (warnings.Any()) + { + height += EditorGUIUtility.standardVerticalSpacing; + + foreach (var warning in warnings) + { + height += warning.GetHeight(width) + 1f; + } + } + + return height; + } + + protected override void OnGUI(Rect position, GUIContent label) + { + if (!nestersCached) + { + IEnumerable nesterUnits = graph.units.OfType(); + + nesterMetadata.value = nesterUnits + .Where(nester => nester.nest.source == GraphSource.Embed || nester == nesterUnits + .FirstOrDefault(n => n.nest.source == GraphSource.Macro && n.nest.macro == nester.nest.macro)).ToList(); + nestersCached = true; + } + + BeginLabeledBlock(metadata, position, label); + + OnHeaderGUI(position); + + EditorGUI.BeginChangeCheck(); + + LudiqGUI.Inspector(controlInputDefinitionsMetadata, position.VerticalSection(ref y, GetControlInputDefinitionsHeight(position.width))); + + y += EditorGUIUtility.standardVerticalSpacing; + + LudiqGUI.Inspector(controlOutputDefinitionsMetadata, position.VerticalSection(ref y, GetControlOutputDefinitionsHeight(position.width))); + + y += EditorGUIUtility.standardVerticalSpacing; + + LudiqGUI.Inspector(valueInputDefinitionsMetadata, position.VerticalSection(ref y, GetValueInputDefinitionsHeight(position.width))); + + y += EditorGUIUtility.standardVerticalSpacing; + + LudiqGUI.Inspector(valueOutputDefinitionsMetadata, position.VerticalSection(ref y, GetValueOutputDefinitionsHeight(position.width))); + + if (EditorGUI.EndChangeCheck()) + { + graph.PortDefinitionsChanged(); + } + + y += EditorGUIUtility.standardVerticalSpacing; + + nesterAdaptor.Field(position.VerticalSection(ref y, nesterAdaptor.GetHeight(position.width, new GUIContent("Graphs"))), new GUIContent("Graphs")); + + if (warnings.Any()) + { + y += EditorGUIUtility.standardVerticalSpacing; + + foreach (var warning in warnings) + { + y--; + warning.OnGUI(position.VerticalSection(ref y, warning.GetHeight(position.width) + 1)); + } + } + + EndBlock(metadata); + } + + private float GetControlInputDefinitionsHeight(float width) + { + return LudiqGUI.GetInspectorHeight(this, controlInputDefinitionsMetadata, width); + } + + private float GetControlOutputDefinitionsHeight(float width) + { + return LudiqGUI.GetInspectorHeight(this, controlOutputDefinitionsMetadata, width); + } + + private float GetValueInputDefinitionsHeight(float width) + { + return LudiqGUI.GetInspectorHeight(this, valueInputDefinitionsMetadata, width); + } + + private float GetValueOutputDefinitionsHeight(float width) + { + return LudiqGUI.GetInspectorHeight(this, valueOutputDefinitionsMetadata, width); + } + } +} diff --git a/Editor/Internal/Patches/PatchedFlowGraphEditor.cs.meta b/Editor/Internal/Patches/PatchedFlowGraphEditor.cs.meta new file mode 100644 index 00000000..c2397d31 --- /dev/null +++ b/Editor/Internal/Patches/PatchedFlowGraphEditor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 08f7aa8440a370547b01dc490d397084 \ No newline at end of file diff --git a/Editor/Internal/Patches/ProviderPatcher.cs b/Editor/Internal/Patches/ProviderPatcher.cs index dd1a3e70..a9f2973b 100644 --- a/Editor/Internal/Patches/ProviderPatcher.cs +++ b/Editor/Internal/Patches/ProviderPatcher.cs @@ -23,9 +23,18 @@ static ProviderPatcher() { PatchVariablesDeclarationsInspector(); PatchWidgets(); + PatchGraphEditors(); // PatchGraphContext(); } + private static void PatchGraphEditors() + { + var provider = EditorProvider.instance; + + PatchGlobalProvider(provider, typeof(FlowGraph)); + PatchGlobalProvider(provider, typeof(StateGraph)); + } + private static void PatchWidgets() { var descriptorProvider = DescriptorProvider.instance; @@ -291,10 +300,9 @@ private static void PatchVariablesDeclarationsInspector() #if NEW_VARIABLES_UI PatchGlobalProvider(provider, typeof(VariableDeclarations)); -#else +#endif PatchGlobalProvider(provider, typeof(VariableDeclaration)); -#endif } } } \ No newline at end of file diff --git a/Editor/Internal/Patches/StateGraphEditor.cs b/Editor/Internal/Patches/StateGraphEditor.cs new file mode 100644 index 00000000..7b2cb0ec --- /dev/null +++ b/Editor/Internal/Patches/StateGraphEditor.cs @@ -0,0 +1,88 @@ +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using JetBrains.Annotations; +using UnityEditor; +using UnityEngine; + +namespace Unity.VisualScripting.Community +{ + public class PatchedStateGraphEditor : GraphEditor + { + public PatchedStateGraphEditor(Metadata metadata) : base(metadata) + { + graph.elements.ItemAdded += OnUnitAdded; + graph.elements.ItemRemoved += OnItemRemoved; + + nesterMetadata = Metadata.Root().Object("editor", this).Member("nesters", BindingFlags.Instance | BindingFlags.NonPublic); + + nesterMetadata.value = null; + IEnumerable nesterUnits = graph.elements.OfType(); + + nesterMetadata.value = nesterUnits + .Where(nester => nester.nest.source == GraphSource.Embed || nester == nesterUnits + .FirstOrDefault(n => n.nest.source == GraphSource.Macro && n.nest.macro == nester.nest.macro)).ToList(); + + nesterAdaptor = new NesterAdaptor(nesterMetadata, this); + } + + private new StateGraph graph => (StateGraph)base.graph; + + private bool nestersCached; + + [InspectorWide(true)] + [UsedImplicitly] + private List nesters = new List(); + + private NesterAdaptor nesterAdaptor; + + private readonly Metadata nesterMetadata; + + private void OnItemRemoved(IGraphElement unit) + { + if (unit is IGraphNesterElement) nestersCached = false; + } + + private void OnUnitAdded(IGraphElement unit) + { + if (unit is IGraphNesterElement) nestersCached = false; + } + + public override void Dispose() + { + graph.elements.ItemAdded -= OnUnitAdded; + graph.elements.ItemRemoved -= OnItemRemoved; + } + + protected override float GetHeight(float width, GUIContent label) + { + var height = base.GetHeight(width, label); + + height += EditorGUIUtility.standardVerticalSpacing; + + height += LudiqGUI.GetInspectorHeight(this, nesterMetadata, width); + + return height; + } + + protected override void OnGUI(Rect position, GUIContent label) + { + base.OnGUI(position, label); + + if (!nestersCached) + { + IEnumerable nesterUnits = graph.elements.OfType(); + + nesterMetadata.value = nesterUnits + .Where(nester => nester.nest.source == GraphSource.Embed || nester == nesterUnits + .FirstOrDefault(n => n.nest.source == GraphSource.Macro && n.nest.macro == nester.nest.macro)).ToList(); + nestersCached = true; + } + + y += EditorGUIUtility.standardVerticalSpacing; + + nesterAdaptor.Field(position.VerticalSection(ref y, nesterAdaptor.GetHeight(position.width, new GUIContent("Graphs"))), new GUIContent("Graphs")); + } + + } +} diff --git a/Editor/Internal/Patches/StateGraphEditor.cs.meta b/Editor/Internal/Patches/StateGraphEditor.cs.meta new file mode 100644 index 00000000..447455c6 --- /dev/null +++ b/Editor/Internal/Patches/StateGraphEditor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4215e1d60e8ba4b42965b105dd3a4b56 \ No newline at end of file diff --git a/Editor/Internal/Processes/KeyboardControlProcess.cs b/Editor/Internal/Processes/KeyboardControlProcess.cs index 972021f7..8565cea7 100644 --- a/Editor/Internal/Processes/KeyboardControlProcess.cs +++ b/Editor/Internal/Processes/KeyboardControlProcess.cs @@ -203,7 +203,7 @@ private void TryInsertReroute(FlowGraph graph, FlowCanvas canvas, IUnitPort sour var destinationPos = destinationWidget.position; var reroutePos = rerouteWidget.position; - rerouteWidget.position = new Rect(destinationPos.xMin - reroutePos.width - 35, destinationPos.position.y - 4, reroutePos.width, reroutePos.height); + rerouteWidget.position = new Rect(destinationPos.xMin - reroutePos.width - 40, destinationPos.position.y - 1, reroutePos.width, reroutePos.height); rerouteWidget.Reposition(); } finally diff --git a/Editor/Internal/ScriptingDefineUtility.cs b/Editor/Internal/ScriptingDefineUtility.cs index b6b9d0db..3f398de7 100644 --- a/Editor/Internal/ScriptingDefineUtility.cs +++ b/Editor/Internal/ScriptingDefineUtility.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Collections.Generic; using UnityEditor.Build; +using UnityEditor.Build.Profile; namespace Unity.VisualScripting.Community { @@ -16,7 +17,6 @@ public static class ScriptingDefineUtility private const string UNIT_STYLE = "NEW_UNIT_STYLE"; private const string TOOLBAR_STYLE = "NEW_TOOLBAR_STYLE"; private const string GRAPH_MINIMAP = "ENABLE_GRAPH_MINIMAP"; - private const string DARK_UI = "DARKER_UI"; private const string NEW_VARIABLES_UI = "NEW_VARIABLES_UI"; private const string NEW_LIST_UI = "NEW_LIST_UI"; private const string NEW_DICTIONARY_UI = "NEW_DICTIONARY_UI"; @@ -29,7 +29,6 @@ static ScriptingDefineUtility() UpdateUnitStyle(); UpdateToolbarStyle(); UpdateGraphMiniMap(); - UpdateDarkUI(); UpdateVariablesUI(); UpdateListUI(); UpdateDictionaryUI(); @@ -61,11 +60,6 @@ public static void UpdateGraphMiniMap() SetDefine(GRAPH_MINIMAP, EditorPrefs.GetBool(ProjectSettingsProviderView.GraphMinimapKey, false)); } - public static void UpdateDarkUI() - { - SetDefine(DARK_UI, EditorPrefs.GetBool(ProjectSettingsProviderView.DarkerUIKey, false)); - } - public static void UpdateVariablesUI() { SetDefine(NEW_VARIABLES_UI, EditorPrefs.GetBool(ProjectSettingsProviderView.NewVariablesUIKey, false)); @@ -85,31 +79,62 @@ public static void SetDefine(string symbol, bool enabled) { if (string.IsNullOrWhiteSpace(symbol)) return; +#if UNITY_6000_0_OR_NEWER + BuildProfile activeProfile = BuildProfile.GetActiveBuildProfile(); + + if (activeProfile != null) + { + List list = activeProfile.scriptingDefines != null + ? activeProfile.scriptingDefines.Where(d => !string.IsNullOrWhiteSpace(d)).ToList() + : new List(); + + bool changed = false; + if (enabled && !list.Contains(symbol)) + { + list.Add(symbol); + changed = true; + } + else if (!enabled && list.Contains(symbol)) + { + list.Remove(symbol); + changed = true; + } + + if (changed) + { + activeProfile.scriptingDefines = list.ToArray(); + EditorUtility.SetDirty(activeProfile); + AssetDatabase.SaveAssetIfDirty(activeProfile); + } + return; + } +#endif + #if UNITY_2022_1_OR_NEWER var target = NamedBuildTarget.FromBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup); - string defines = PlayerSettings.GetScriptingDefineSymbols(target); + string definesString = PlayerSettings.GetScriptingDefineSymbols(target); #else var target = EditorUserBuildSettings.selectedBuildTargetGroup; - string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(target); + string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(target); #endif - List list = defines.Split(';').Where(d => !string.IsNullOrWhiteSpace(d)).ToList(); - bool changed = false; + List legacyList = definesString.Split(';').Where(d => !string.IsNullOrWhiteSpace(d)).ToList(); + bool legacyChanged = false; - if (enabled && !list.Contains(symbol)) + if (enabled && !legacyList.Contains(symbol)) { - list.Add(symbol); - changed = true; + legacyList.Add(symbol); + legacyChanged = true; } - else if (!enabled && list.Contains(symbol)) + else if (!enabled && legacyList.Contains(symbol)) { - list.Remove(symbol); - changed = true; + legacyList.Remove(symbol); + legacyChanged = true; } - if (!changed) return; + if (!legacyChanged) return; - string result = string.Join(";", list); + string result = string.Join(";", legacyList); #if UNITY_2022_1_OR_NEWER PlayerSettings.SetScriptingDefineSymbols(target, result); diff --git a/Editor/Nodes/Events/Resources/return.png.meta b/Editor/Nodes/Events/Resources/return.png.meta index 0d8521be..531aff24 100644 --- a/Editor/Nodes/Events/Resources/return.png.meta +++ b/Editor/Nodes/Events/Resources/return.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 818a917ccaff66a4b95ec02dbb402dbd TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -995779289211046693 + second: return_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -32,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -51,17 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 @@ -71,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 @@ -83,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: return_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: bd472e723084e22f0800000000000000 + internalID: -995779289211046693 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -98,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Events/Resources/return@Pro.png.meta b/Editor/Nodes/Events/Resources/return@Pro.png.meta index 10f2ee4f..b37f1228 100644 --- a/Editor/Nodes/Events/Resources/return@Pro.png.meta +++ b/Editor/Nodes/Events/Resources/return@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 1555510bc861aaf45a991646c58d78c2 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -9028082845167450635 + second: return@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -32,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -51,17 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 @@ -71,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 @@ -83,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: return@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 5f50ff23c7ec5b280800000000000000 + internalID: -9028082845167450635 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -98,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Events/Resources/return_event.png.meta b/Editor/Nodes/Events/Resources/return_event.png.meta index 73ff1907..dcdf1af4 100644 --- a/Editor/Nodes/Events/Resources/return_event.png.meta +++ b/Editor/Nodes/Events/Resources/return_event.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 5aab74d0b11d00b4a80a3cf436ea3cca TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 3058852381063108299 + second: return_event_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: return_event_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: bc6df99b80a337a20800000000000000 + internalID: 3058852381063108299 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Events/Resources/return_event@Pro.png.meta b/Editor/Nodes/Events/Resources/return_event@Pro.png.meta index e08db15a..1165c4eb 100644 --- a/Editor/Nodes/Events/Resources/return_event@Pro.png.meta +++ b/Editor/Nodes/Events/Resources/return_event@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 2cf450b0769dd7144abab64157dd9ecc TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -2913948437038840684 + second: return_event@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -32,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -51,17 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 @@ -71,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 @@ -83,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: return_event@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 494ce74d5539f87d0800000000000000 + internalID: -2913948437038840684 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -98,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/CommunityGraphContextExtensions.cs b/Editor/Nodes/Fundamentals/CommunityFlowGraphContextExtensions.cs similarity index 64% rename from Editor/Nodes/Fundamentals/CommunityGraphContextExtensions.cs rename to Editor/Nodes/Fundamentals/CommunityFlowGraphContextExtensions.cs index 5647ee71..b3952993 100644 --- a/Editor/Nodes/Fundamentals/CommunityGraphContextExtensions.cs +++ b/Editor/Nodes/Fundamentals/CommunityFlowGraphContextExtensions.cs @@ -1,18 +1,39 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Reflection; +using UnityEditor; using UnityEngine; namespace Unity.VisualScripting.Community { [GraphContextExtension(typeof(FlowGraphContext))] - public class CommunityGraphContextExtensions : GraphContextExtension + public class CommunityFlowGraphContextExtensions : GraphContextExtension { - public CommunityGraphContextExtensions(FlowGraphContext context) : base(context) + public CommunityFlowGraphContextExtensions(FlowGraphContext context) : base(context) { } + public override bool AcceptsDragAndDrop() + { + return DragAndDrop.GetGenericData("Graphs.NesterElementCopy") is IUnit; + } + + public override void DrawDragAndDropPreview() + { + var element = DragAndDrop.GetGenericData("Graphs.NesterElementCopy") as IGraphNesterElement; + var name = GraphTraversal.GetNesterName(element); + GraphGUI.DrawDragAndDropPreviewLabel(new Vector2(e.mousePosition.x, e.mousePosition.y), "Add: " + name, element.GetType().Icon()); + } + + public override void PerformDragAndDrop() + { + var element = DragAndDrop.GetGenericData("Graphs.NesterElementCopy") as IGraphNesterElement; + element.guid = Guid.NewGuid(); + graph.elements.Add(element); + if (element is IUnit unit) unit.position = e.mousePosition; + } + + public override DragAndDropVisualMode dragAndDropVisualMode => DragAndDropVisualMode.Copy; + public override IEnumerable contextMenuItems { get diff --git a/Editor/Nodes/Fundamentals/CommunityGraphContextExtensions.cs.meta b/Editor/Nodes/Fundamentals/CommunityFlowGraphContextExtensions.cs.meta similarity index 100% rename from Editor/Nodes/Fundamentals/CommunityGraphContextExtensions.cs.meta rename to Editor/Nodes/Fundamentals/CommunityFlowGraphContextExtensions.cs.meta diff --git a/Editor/Nodes/Fundamentals/CommunityStateGraphContextExtensions.cs b/Editor/Nodes/Fundamentals/CommunityStateGraphContextExtensions.cs new file mode 100644 index 00000000..0f106232 --- /dev/null +++ b/Editor/Nodes/Fundamentals/CommunityStateGraphContextExtensions.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace Unity.VisualScripting.Community +{ + [GraphContextExtension(typeof(StateGraphContext))] + public class CommunityStateGraphContextExtensions : GraphContextExtension + { + public CommunityStateGraphContextExtensions(StateGraphContext context) : base(context) + { + } + + public override bool AcceptsDragAndDrop() + { + return DragAndDrop.GetGenericData("Graphs.NesterElementCopy") is IState; + } + + public override void DrawDragAndDropPreview() + { + var element = DragAndDrop.GetGenericData("Graphs.NesterElementCopy") as IGraphNesterElement; + var name = GraphTraversal.GetNesterName(element); + GraphGUI.DrawDragAndDropPreviewLabel(new Vector2(e.mousePosition.x, e.mousePosition.y), "Add: " + name, element.GetType().Icon()); + } + + public override void PerformDragAndDrop() + { + var element = DragAndDrop.GetGenericData("Graphs.NesterElementCopy") as IGraphNesterElement; + element.guid = Guid.NewGuid(); + graph.elements.Add(element); + if (element is IState state) state.position = e.mousePosition; + } + + public override DragAndDropVisualMode dragAndDropVisualMode => DragAndDropVisualMode.Copy; + + public override IEnumerable contextMenuItems + { + get + { + foreach (var item in base.contextMenuItems) + { + yield return item; + } + + yield return new GraphContextMenuItem(OpenNodeFinder, "Windows/Open NodeFinder Window"); + yield return new GraphContextMenuItem(OpenUtilityWindow, "Windows/Open Utility Window"); + yield return new GraphContextMenuItem(OpenGraphSnippetPopup, "Windows/Open Graph Snippets Window"); + } + } + + private void OpenGraphSnippetPopup(Vector2 _) + { + Rect rect = new Rect(e.mousePosition.x, e.mousePosition.y, 0, 0); + + GraphSnippetsPopup.Show(rect); + } + + private void ConvertToEmbed(Vector2 _) + { + NodeSelection.Convert(GraphSource.Embed); + } + + private void ConvertToMacro(Vector2 _) + { + NodeSelection.Convert(GraphSource.Macro); + } + + private void OpenUtilityWindow(Vector2 _) + { + var window = UtilityWindow.Open(); + window.graphContext = context; + } + + private void OpenNodeFinder(Vector2 _) + { + NodeFinderWindow.Open(); + } + } +} \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/CommunityStateGraphContextExtensions.cs.meta b/Editor/Nodes/Fundamentals/CommunityStateGraphContextExtensions.cs.meta new file mode 100644 index 00000000..5be17d29 --- /dev/null +++ b/Editor/Nodes/Fundamentals/CommunityStateGraphContextExtensions.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0223196fa569ff24fb84056030f7a680 diff --git a/Editor/Nodes/Fundamentals/Editors/Delegates/BindDelegateNodeEditor.cs b/Editor/Nodes/Fundamentals/Editors/Delegates/BindDelegateNodeEditor.cs index fc661f1e..4eb24d02 100644 --- a/Editor/Nodes/Fundamentals/Editors/Delegates/BindDelegateNodeEditor.cs +++ b/Editor/Nodes/Fundamentals/Editors/Delegates/BindDelegateNodeEditor.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System; using System.Reflection; +using UnityEngine.Assemblies; +using System.Linq; namespace Unity.VisualScripting.Community { @@ -40,7 +42,12 @@ protected override void OnInspectorGUI(Rect position) GenericMenu menu = new GenericMenu(); List result = new List(); + +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { diff --git a/Editor/Nodes/Fundamentals/Editors/Delegates/DelegateInvokeNodeEditor.cs b/Editor/Nodes/Fundamentals/Editors/Delegates/DelegateInvokeNodeEditor.cs index bbb7dca8..541e713b 100644 --- a/Editor/Nodes/Fundamentals/Editors/Delegates/DelegateInvokeNodeEditor.cs +++ b/Editor/Nodes/Fundamentals/Editors/Delegates/DelegateInvokeNodeEditor.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System; using System.Reflection; +using UnityEngine.Assemblies; +using System.Linq; namespace Unity.VisualScripting.Community { @@ -40,7 +42,12 @@ protected override void OnInspectorGUI(Rect position) GenericMenu menu = new GenericMenu(); List result = new List(); + +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { diff --git a/Editor/Nodes/Fundamentals/Editors/Delegates/DelegateNodeEditor.cs b/Editor/Nodes/Fundamentals/Editors/Delegates/DelegateNodeEditor.cs index d006babe..32937096 100644 --- a/Editor/Nodes/Fundamentals/Editors/Delegates/DelegateNodeEditor.cs +++ b/Editor/Nodes/Fundamentals/Editors/Delegates/DelegateNodeEditor.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System; using System.Reflection; +using UnityEngine.Assemblies; +using System.Linq; namespace Unity.VisualScripting.Community { @@ -42,7 +44,12 @@ protected override void OnInspectorGUI(Rect position) GenericMenu menu = new GenericMenu(); List result = new List(); - Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); + +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else + Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { diff --git a/Editor/Nodes/Fundamentals/Editors/Delegates/UnbindDelegateNodeEditor.cs b/Editor/Nodes/Fundamentals/Editors/Delegates/UnbindDelegateNodeEditor.cs index 75fbdd2d..fa4b0814 100644 --- a/Editor/Nodes/Fundamentals/Editors/Delegates/UnbindDelegateNodeEditor.cs +++ b/Editor/Nodes/Fundamentals/Editors/Delegates/UnbindDelegateNodeEditor.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System; using System.Reflection; +using UnityEngine.Assemblies; +using System.Linq; namespace Unity.VisualScripting.Community { @@ -40,7 +42,12 @@ protected override void OnInspectorGUI(Rect position) GenericMenu menu = new GenericMenu(); List result = new List(); + +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { diff --git a/Editor/Nodes/Fundamentals/Inspectors/Dictionary/DictionaryAdaptor.cs b/Editor/Nodes/Fundamentals/Inspectors/Dictionary/DictionaryAdaptor.cs index 7a2c8f92..4d581bee 100644 --- a/Editor/Nodes/Fundamentals/Inspectors/Dictionary/DictionaryAdaptor.cs +++ b/Editor/Nodes/Fundamentals/Inspectors/Dictionary/DictionaryAdaptor.cs @@ -1,266 +1,191 @@ +using System; +using System.Collections; using System.Collections.Generic; using System.Reflection; +using Unity.VisualScripting.Community.Libraries.Humility; +using Unity.VisualScripting.ReorderableList; using UnityEditor; using UnityEngine; -using Unity.VisualScripting.ReorderableList; -using System; -using Unity.VisualScripting.Community.Libraries.Humility; -using System.Collections; namespace Unity.VisualScripting.Community { public class DictionaryAdaptor : MetadataDictionaryAdaptor, IReorderableListDropTarget { + public ReorderableListControl listControl; + public Metadata Metadata; + public event Action valueChanged; + private readonly List foldoutStates = new List(); + private Metadata newKeyMetadata; + private Metadata newValueMetadata; + private bool newItemExpanded = false; private const float FoldoutHeight = 20f; private const float FieldHeight = 18f; private const float Spacing = 4f; private const float DeleteButtonWidth = 18f; - private const float spaceBetweenKeyAndValue = 5; - private const float itemPadding = 2; - - private Metadata newKeyMetadata; - private Metadata newValueMetadata; + private const float SpaceBetweenKeyAndValue = 5f; + private const float ItemPadding = 2f; + private const float FoldoutArrowWidth = 12f; + private const float AdaptiveWidthPadding = 10f; + private const float ExtraItemPadding = 8f; private static readonly FieldInfo listControlFieldInfo = typeof(MetadataCollectionAdaptor).GetField("listControl", BindingFlags.NonPublic | BindingFlags.Instance); private static readonly PropertyInfo metadataLabelProperty = typeof(Metadata).GetProperty("label", BindingFlags.Instance | BindingFlags.Public); - public ReorderableListControl listControl; - public DictionaryAdaptor(Metadata metadata, Inspector parent) : base(metadata, parent) { Metadata = metadata; - valueChanged += (previousValue) => - { - Initialize(); - }; - metadata.valueChanged += (previousValue) => - { - Initialize(); - }; + Action reinitialize = (previousValue) => Initialize(); + valueChanged += reinitialize; + metadata.valueChanged += reinitialize; - if (listControlFieldInfo != null) + if (listControlFieldInfo?.GetValue(this) is ReorderableListControl control) { - listControl = listControlFieldInfo.GetValue(this) as ReorderableListControl; - if (listControl != null) - { - listControl.ContainerStyle = GUIStyle.none; - listControl.Flags = ReorderableListFlags.HideRemoveButtons | ReorderableListFlags.DisableReordering; - listControl.HorizontalLineColor = EditorGUIUtility.isProSkin ? Color.black : Color.white; - listControl.HorizontalLineAtStart = true; - listControl.HorizontalLineAtEnd = true; - } + listControl = control; + listControl.Flags = ReorderableListFlags.DisableReordering; } } -#if DARKER_UI - // I have to do this setup to change the color of the add button - // It's very hacky but seems to work better than tinting the background Texture. - private Color _previousBackgroundColor; - private bool _tintApplied; - - public override void BeginGUI() - { - if (_tintApplied) - { - GUI.backgroundColor = _previousBackgroundColor; - _tintApplied = false; - } - } - - public override void EndGUI() - { - _previousBackgroundColor = GUI.backgroundColor; - GUI.backgroundColor = CommunityStyles.backgroundColor.Brighten(0.36f); - _tintApplied = true; - } -#endif private void Initialize() { if (!metadata.isDictionary) - { - throw new InvalidOperationException("Metadata for dictionary adaptor is not a dictionary: " + metadata); - } + throw new InvalidOperationException($"Metadata for dictionary adaptor is not a dictionary: {metadata}"); - if (metadata.value == null) - { - metadata.value = ConstructDictionary(); - } + metadata.value ??= ConstructDictionary(); newKeyMetadata?.Unlink(); newValueMetadata?.Unlink(); - // It seems like Unlink is not enough. - // so we make sure to give it a new name - var guid = GUID.Generate().ToString(); - - // Todo: Find a way to overwrite the key and value - // instead of using a new key. + string guid = GUID.Generate().ToString(); newKeyMetadata = metadata.Object($"newKey_{guid}", ConstructKey(), metadata.dictionaryKeyType); newValueMetadata = metadata.Object($"newValue_{guid}", ConstructValue(), metadata.dictionaryValueType); - // Some Metadata types use this, so we insure that its not null. - metadataLabelProperty.SetValue(newKeyMetadata, GUIContent.none); - metadataLabelProperty.SetValue(newValueMetadata, GUIContent.none); + metadataLabelProperty?.SetValue(newKeyMetadata, GUIContent.none); + metadataLabelProperty?.SetValue(newValueMetadata, GUIContent.none); } protected override IDictionary ConstructDictionary() { - if (metadata.dictionaryType == typeof(IDictionary)) return new AotDictionary(); - else if (metadata.dictionaryType.IsGenericType && metadata.dictionaryType.GetGenericTypeDefinition() == typeof(IDictionary<,>)) + if (metadata.dictionaryType == typeof(IDictionary)) + return new AotDictionary(); + + if (metadata.dictionaryType.IsGenericType && metadata.dictionaryType.GetGenericTypeDefinition() == typeof(IDictionary<,>)) { var args = metadata.dictionaryType.GetGenericArguments(); return (IDictionary)Activator.CreateInstance(typeof(Dictionary<,>).MakeGenericType(args[0], args[1])); } - return base.ConstructDictionary(); - } - protected override object ConstructKey() - { - return base.ConstructKey(); + return base.ConstructDictionary(); } protected override object ConstructValue() { - if (metadata.dictionaryValueType == typeof(object)) return null; - if (typeof(UnityEngine.Object).IsAssignableFrom(metadata.dictionaryValueType)) return null; - return metadata.dictionaryValueType.PseudoDefault() ?? metadata.dictionaryValueType.TryInstantiate(false) ?? base.ConstructKey(); - } - - public Metadata Metadata; + if (metadata.dictionaryValueType == typeof(object) || typeof(UnityEngine.Object).IsAssignableFrom(metadata.dictionaryValueType)) + return null; - private void EnsureFoldoutCount(int index) - { - if (index == Count - 1) return; - - while (foldoutStates.Count <= index) - { - foldoutStates.Add(false); - parentInspector.SetHeightDirty(); - } + return metadata.dictionaryValueType.PseudoDefault() ?? + metadata.dictionaryValueType.TryInstantiate(false) ?? + base.ConstructKey(); } public override float GetItemHeight(float width, int index) { - EnsureFoldoutCount(index); + EnsureFoldoutStateSynced(index); - bool expanded = (index == Count - 1) ? newItemExpanded : foldoutStates[index]; - - if (!expanded) - return FoldoutHeight + Spacing; + bool isNewItem = index == Count - 1; + bool expanded = isNewItem ? newItemExpanded : foldoutStates[index]; - if (index == Count - 1) - return FoldoutHeight + GetItemHeight(newKeyMetadata, newValueMetadata, index) + 8f; + if (!expanded) return FoldoutHeight + Spacing; - return FoldoutHeight + GetItemHeight(metadata.KeyMetadata(index), metadata.ValueMetadata(index), index) + 8f; - } + float contentHeight = isNewItem + ? GetItemContentHeight(newKeyMetadata, newValueMetadata, width) + : GetItemContentHeight(metadata.KeyMetadata(index), metadata.ValueMetadata(index), width); - public override void DrawItemBackground(Rect position, int index) - { -#if DARKER_UI - EditorGUI.DrawRect(position, CommunityStyles.backgroundColor); -#else - EditorGUI.DrawRect(position, ColorPalette.unityBackgroundLight); -#endif - - var restoredColor = Handles.color; - Handles.color = Color.gray * 0.6f; - Handles.DrawAAPolyLine(2f, new Vector3[] - { - new Vector3(position.x, position.y + 1), - new Vector3(position.xMax, position.y + 1), - new Vector3(position.xMax, position.yMax), - new Vector3(position.x, position.yMax), - new Vector3(position.x, position.y) - }); - Handles.color = restoredColor; + return FoldoutHeight + contentHeight + ExtraItemPadding; } - private bool newItemExpanded = false; - public override void DrawItem(Rect position, int index) { - EnsureFoldoutCount(index); + EnsureFoldoutStateSynced(index); bool isNewItem = index == Count - 1; + Rect foldoutRect = new Rect(position.x + Spacing, position.y + Spacing, position.width, FieldHeight); - bool expanded = isNewItem ? newItemExpanded : foldoutStates[index]; - - float lineY = position.y + (FoldoutHeight - 8) / 2f; - - Rect foldoutRect = new Rect(position.x + Spacing, position.y + 4, position.width - DeleteButtonWidth - 35, FieldHeight); - Rect arrowRect = new Rect(foldoutRect.x, lineY, 12, 12); + GUIContent label = isNewItem + ? new GUIContent("New Item") + : CommunityStyles.GetCollectionDisplayName(metadata.KeyMetadata(index), index, true); - Texture2D arrowTex = expanded ? CommunityStyles.ArrowDownTexture : CommunityStyles.ArrowRightTexture; - if (arrowTex != null) - GUI.DrawTexture(arrowRect, arrowTex, ScaleMode.ScaleToFit, true); + bool expanded = DrawFoldout(foldoutRect, index, label, isNewItem); - GUIContent label = isNewItem ? new GUIContent("New Item") : CommunityStyles.GetCollectionDisplayName(metadata.KeyMetadata(index), index, true); - Rect labelRect = new Rect(foldoutRect.x + 16, lineY - 3, foldoutRect.width - 16, FieldHeight); - GUI.Label(labelRect, label, EditorStyles.label); + if (expanded) + { + DrawExpandedContent(position, index, isNewItem); + } if (!isNewItem) { - Rect deleteRect = new Rect(position.x + position.width - DeleteButtonWidth - 4, lineY - 2, DeleteButtonWidth - 2, FieldHeight - 2); - if (GUI.Button(deleteRect, GUIContent.none, new GUIStyle(EditorStyles.whiteLabel) - { - normal = { background = CommunityStyles.RemoveItemTexture } - })) - { - Remove(index); - return; - } + HandleDragAndDrop(position, index); } + } - if (Event.current.type == EventType.MouseDown && arrowRect.Contains(Event.current.mousePosition)) + private bool DrawFoldout(Rect foldoutRect, int index, GUIContent label, bool isNewItem) + { + using (new EditorGUIUtility.IconSizeScope(new Vector2(IconSize.Small, IconSize.Small))) { - if (isNewItem) - newItemExpanded = !newItemExpanded; - else - foldoutStates[index] = !expanded; + var oldHierarchyMode = EditorGUIUtility.hierarchyMode; + EditorGUIUtility.hierarchyMode = false; - parentInspector.SetHeightDirty(); - - Event.current.Use(); - } + EditorGUI.BeginChangeCheck(); - if (expanded) - { - Rect contentRect = new Rect(position.x, position.y + FoldoutHeight + Spacing, position.width - Spacing, position.height - FoldoutHeight - Spacing); + bool expanded = isNewItem + ? (newItemExpanded = EditorGUI.Foldout(foldoutRect, newItemExpanded, label)) + : (foldoutStates[index] = EditorGUI.Foldout(foldoutRect, foldoutStates[index], label)); - contentRect.x -= (arrowRect.width / 2) - Spacing; - contentRect.width += (arrowRect.width / 2) - Spacing; - if (isNewItem) + if (EditorGUI.EndChangeCheck()) { - DrawNewItem(contentRect); - } - else - { - var keyMeta = metadata.KeyMetadata(index); - var valMeta = metadata.ValueMetadata(index); - OnItemGUI(keyMeta, valMeta, contentRect, false); + parentInspector.SetHeightDirty(); } + + EditorGUIUtility.hierarchyMode = oldHierarchyMode; + return expanded; } + } - if (index == Count - 1) - return; + private void DrawExpandedContent(Rect position, int index, bool isNewItem) + { + Rect contentRect = new Rect( + position.x, + position.y + FoldoutHeight + Spacing, + position.width, + position.height - FoldoutHeight - Spacing); - var controlID = GUIUtility.GetControlID(FocusType.Passive); + if (isNewItem) + { + Rect newItemPosition = new Rect(contentRect.x, contentRect.y, contentRect.width, GetItemContentHeight(newKeyMetadata, newValueMetadata, contentRect.width)); + OnItemGUI(newKeyMetadata, newValueMetadata, newItemPosition, editableKey: true); + } + else + { + OnItemGUI(metadata.KeyMetadata(index), metadata.ValueMetadata(index), contentRect, editableKey: false); + } + } - switch (Event.current.GetTypeForControl(controlID)) + private void HandleDragAndDrop(Rect position, int index) + { + int controlID = GUIUtility.GetControlID(FocusType.Passive); + var e = Event.current; + + switch (e.GetTypeForControl(controlID)) { case EventType.MouseDown: - var draggablePosition = position; - - if (Event.current.button == (int)MouseButton.Left && draggablePosition.Contains(Event.current.mousePosition)) + if (e.button == (int)MouseButton.Left && position.Contains(e.mousePosition)) { GUIUtility.hotControl = controlID; - Event.current.Use(); + e.Use(); } - break; case EventType.MouseDrag: @@ -268,35 +193,38 @@ public override void DrawItem(Rect position, int index) { var item = this[index]; GUIUtility.hotControl = 0; + DragAndDrop.PrepareStartDrag(); - DragAndDrop.objectReferences = new UnityEngine.Object[0]; - DragAndDrop.paths = new string[0]; - DragAndDrop.SetGenericData(DraggedDictionaryItem.TypeName, new DraggedDictionaryItem(this, index, KeyValuePair.Create(metadata.KeyMetadata(index).value, item), foldoutStates[index])); + DragAndDrop.objectReferences = Array.Empty(); + DragAndDrop.paths = Array.Empty(); + + var pair = KeyValuePair.Create(metadata.KeyMetadata(index).value, item); + DragAndDrop.SetGenericData(DraggedDictionaryItem.TypeName, new DraggedDictionaryItem(this, index, pair, foldoutStates[index])); + DragAndDrop.StartDrag(metadata.path); - Event.current.Use(); + e.Use(); } - break; } } - public new event Action itemAdded; - public event Action valueChanged; - - public override void Add() + private void EnsureFoldoutStateSynced(int index) { - var newKey = newKeyMetadata.value; - var newValue = newValueMetadata.value; + if (index == Count - 1) return; - if (!CanAdd()) + while (foldoutStates.Count <= index) { - return; + foldoutStates.Add(false); + parentInspector.SetHeightDirty(); } + } - metadata.RecordUndo(); - metadata.Add(newKey, newValue); + public override void Add() + { + if (!CanAdd()) return; - itemAdded?.Invoke(newKey, newValue); + metadata.RecordUndo(); + metadata.Add(newKeyMetadata.value, newValueMetadata.value); parentInspector.SetHeightDirty(); foldoutStates.Add(true); @@ -313,7 +241,7 @@ public override void Add() return false; } - if (metadata.Contains(newKeyMetadata.value)) + if (metadata.Contains(newKey)) { EditorUtility.DisplayDialog("New Dictionary Item", "An item with the same key already exists.", "OK"); return false; @@ -322,206 +250,122 @@ public override void Add() return true; } - public override void Clear() - { - base.Clear(); - valueChanged?.Invoke(metadata.value); - } - - public override void Duplicate(int index) - { - base.Duplicate(index); - valueChanged?.Invoke(metadata.value); - } + public override void Clear() { base.Clear(); InvokeValueChanged(); } + public override void Duplicate(int index) { base.Duplicate(index); InvokeValueChanged(); } + public override void Move(int sourceIndex, int destinationIndex) { base.Move(sourceIndex, destinationIndex); InvokeValueChanged(); } + public override void Insert(int index) { base.Insert(index); InvokeValueChanged(); } - public override void Move(int sourceIndex, int destinationIndex) + public override void Remove(int index) { - base.Move(sourceIndex, destinationIndex); - valueChanged?.Invoke(metadata.value); + if (index < foldoutStates.Count) foldoutStates.RemoveAt(index); + base.Remove(index); + InvokeValueChanged(); + ClearHotControls(); } - public override void Insert(int index) - { - base.Insert(index); - valueChanged?.Invoke(metadata.value); - } + private void InvokeValueChanged() => valueChanged?.Invoke(metadata.value); - public override void Remove(int index) + private void ClearHotControls() { - if (index < foldoutStates.Count) - foldoutStates.RemoveAt(index); - base.Remove(index); - valueChanged?.Invoke(metadata.value); GUIUtility.keyboardControl = 0; GUIUtility.hotControl = 0; } - private void DrawNewItem(Rect position) + private float GetItemContentHeight(Metadata keyMetadata, Metadata valueMetadata, float width) { - var newItemPosition = new Rect - ( - position.x, - position.y, - position.width, - GetItemHeight(newKeyMetadata, newValueMetadata, position.width) - ); - - OnItemGUI(newKeyMetadata, newValueMetadata, newItemPosition, true); - } - - private float GetItemHeight(Metadata keyMetadata, Metadata valueMetadata, float width) - { - return Mathf.Max(GetKeyHeight(keyMetadata, GetKeyWidth(width)), GetValueHeight(valueMetadata, GetValueWidth(width))) + (itemPadding * 2); + float halfWidth = GetHalfWidth(width); + return Mathf.Max( + LudiqGUI.GetInspectorHeight(parentInspector, keyMetadata, halfWidth, GUIContent.none), + LudiqGUI.GetInspectorHeight(parentInspector, valueMetadata, halfWidth, GUIContent.none)) + (ItemPadding * 2); } private void OnItemGUI(Metadata keyMetadata, Metadata valueMetadata, Rect position, bool editableKey) { - var keyPosition = new Rect - ( - position.x + itemPadding, - position.y + itemPadding, - GetKeyWidth(position.width), - GetKeyHeight(keyMetadata, GetKeyWidth(position.width)) - ); - - var valuePosition = new Rect - ( - keyPosition.xMax + spaceBetweenKeyAndValue, - position.y + itemPadding, - GetValueWidth(position.width), - GetValueHeight(valueMetadata, GetValueWidth(position.width)) - ); + float halfWidth = GetHalfWidth(position.width); - EditorGUI.BeginDisabledGroup(!editableKey); - OnKeyGUI(keyMetadata, keyPosition); - EditorGUI.EndDisabledGroup(); + Rect keyPosition = new Rect( + position.x + ItemPadding, + position.y + ItemPadding, + halfWidth, + LudiqGUI.GetInspectorHeight(parentInspector, keyMetadata, halfWidth, GUIContent.none)); - OnValueGUI(valueMetadata, valuePosition); - } + Rect valuePosition = new Rect( + keyPosition.xMax + SpaceBetweenKeyAndValue, + position.y + ItemPadding, + halfWidth, + LudiqGUI.GetInspectorHeight(parentInspector, valueMetadata, halfWidth, GUIContent.none)); - private void OnKeyGUI(Metadata keyMetadata, Rect keyPosition) - { + EditorGUI.BeginDisabledGroup(!editableKey); LudiqGUI.Inspector(keyMetadata, keyPosition, GUIContent.none); - } + EditorGUI.EndDisabledGroup(); - private void OnValueGUI(Metadata valueMetadata, Rect valuePosition) - { LudiqGUI.Inspector(valueMetadata, valuePosition, GUIContent.none); } - private float GetKeyHeight(Metadata keyMetadata, float keyWidth) - { - return LudiqGUI.GetInspectorHeight(parentInspector, keyMetadata, keyWidth, GUIContent.none); - } - - private float GetValueHeight(Metadata valueMetadata, float valueWidth) - { - return LudiqGUI.GetInspectorHeight(parentInspector, valueMetadata, valueWidth, GUIContent.none); - } - - private float GetKeyWidth(float width) - { - return (width - spaceBetweenKeyAndValue) / 2; - } - - private float GetValueWidth(float width) - { - return (width - spaceBetweenKeyAndValue) / 2; - } + private float GetHalfWidth(float totalWidth) => (totalWidth - SpaceBetweenKeyAndValue) / 2; public bool CanDropInsert(int insertionIndex) { - if (insertionIndex != Count - 1) - return false; - if (!ReorderableListControl.CurrentListPosition.Contains(Event.current.mousePosition)) - { + if (insertionIndex != Count - 1 || !ReorderableListControl.CurrentListPosition.Contains(Event.current.mousePosition)) return false; - } - - var data = DragAndDrop.GetGenericData(DraggedDictionaryItem.TypeName); - - if (data is DraggedDictionaryItem draggedDictionaryItem && draggedDictionaryItem.item is KeyValuePair valuePair) - { - return !metadata.Contains(valuePair.Key) && metadata.dictionaryKeyType.IsInstanceOfType(valuePair.Key) && metadata.dictionaryValueType.IsInstanceOfType(valuePair.Value); - } - return false; + return DragAndDrop.GetGenericData(DraggedDictionaryItem.TypeName) is DraggedDictionaryItem draggedData && + draggedData.item is KeyValuePair valuePair && + !metadata.Contains(valuePair.Key) && + metadata.dictionaryKeyType.IsInstanceOfType(valuePair.Key) && + metadata.dictionaryValueType.IsInstanceOfType(valuePair.Value); } - protected virtual bool CanDrop(object item) - { - return true; - } + protected virtual bool CanDrop(object item) => true; public void ProcessDropInsertion(int insertionIndex) { if (Event.current.type == EventType.DragPerform) { - var draggedItem = (DraggedDictionaryItem)DragAndDrop.GetGenericData(DraggedDictionaryItem.TypeName); - - if (draggedItem.sourceDictionaryAdaptor != this) + if (DragAndDrop.GetGenericData(DraggedDictionaryItem.TypeName) is DraggedDictionaryItem draggedItem && + draggedItem.sourceDictionaryAdaptor != this && + CanDrop(draggedItem.item)) { - if (CanDrop(draggedItem.item)) - { - var pair = (KeyValuePair)draggedItem.item; - metadata.Add(pair.Key, pair.Value); - - draggedItem.sourceDictionaryAdaptor.Remove(draggedItem.index); - draggedItem.sourceDictionaryAdaptor.parentInspector.SetHeightDirty(); - parentInspector.SetHeightDirty(); - GUI.changed = true; - Event.current.Use(); - } + var pair = (KeyValuePair)draggedItem.item; + metadata.Add(pair.Key, pair.Value); + + draggedItem.sourceDictionaryAdaptor.Remove(draggedItem.index); + draggedItem.sourceDictionaryAdaptor.parentInspector.SetHeightDirty(); + + parentInspector.SetHeightDirty(); + GUI.changed = true; + Event.current.Use(); } } } public override float GetItemAdaptiveWidth(int index) { - EnsureFoldoutCount(index); + EnsureFoldoutStateSynced(index); bool isNewItem = index == Count - 1; bool expanded = isNewItem ? newItemExpanded : foldoutStates[index]; - const float foldoutArrowWidth = 12f; - const float padding = 10f; - - GUIContent label = isNewItem - ? new GUIContent("New Item") - : CommunityStyles.GetCollectionDisplayName(metadata.KeyMetadata(index), index, true); - - float labelWidth = GUI.skin.label.CalcSize(label).x; - - float baseWidth = foldoutArrowWidth + labelWidth + DeleteButtonWidth + padding; + GUIContent label = isNewItem ? new GUIContent("New Item") : CommunityStyles.GetCollectionDisplayName(metadata.KeyMetadata(index), index, true); + float baseWidth = FoldoutArrowWidth + GUI.skin.label.CalcSize(label).x + DeleteButtonWidth + AdaptiveWidthPadding; - float keyWidth = 0f; - float valueWidth = 0f; + float contentWidth = 0f; if (expanded) { try { - var keyInspector = metadata.KeyMetadata(index).Inspector(); - var valueInspector = metadata.ValueMetadata(index).Inspector(); - - if (keyInspector != null) - { - keyWidth = keyInspector.GetAdaptiveWidth(); - } - - if (valueInspector != null) - { - valueWidth = valueInspector.GetAdaptiveWidth(); - } + float keyWidth = metadata.KeyMetadata(index).Inspector()?.GetAdaptiveWidth() ?? 0f; + float valueWidth = metadata.ValueMetadata(index).Inspector()?.GetAdaptiveWidth() ?? 0f; + contentWidth = keyWidth + valueWidth + SpaceBetweenKeyAndValue + (ItemPadding * 2); } catch (Exception) { + } } - float contentWidth = keyWidth + valueWidth + spaceBetweenKeyAndValue + itemPadding * 2; - - return Mathf.Max(baseWidth, contentWidth + padding); + return Mathf.Max(baseWidth, contentWidth + AdaptiveWidthPadding); } } } \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Inspectors/Dictionary/DictionaryInspector.cs b/Editor/Nodes/Fundamentals/Inspectors/Dictionary/DictionaryInspector.cs index acd5eef9..1c74a430 100644 --- a/Editor/Nodes/Fundamentals/Inspectors/Dictionary/DictionaryInspector.cs +++ b/Editor/Nodes/Fundamentals/Inspectors/Dictionary/DictionaryInspector.cs @@ -22,10 +22,7 @@ protected override float GetHeight(float width, GUIContent label) protected override void OnGUI(Rect position, GUIContent label) { - var normal = GUI.backgroundColor; adaptor.Field(position, label); - // Restore color after tinting add - GUI.backgroundColor = normal; } public override float GetAdaptiveWidth() diff --git a/Editor/Nodes/Fundamentals/Inspectors/List/DraggedListItem.cs b/Editor/Nodes/Fundamentals/Inspectors/List/DraggedListItem.cs index 16d63d2a..b59f39f3 100644 --- a/Editor/Nodes/Fundamentals/Inspectors/List/DraggedListItem.cs +++ b/Editor/Nodes/Fundamentals/Inspectors/List/DraggedListItem.cs @@ -3,21 +3,14 @@ namespace Unity.VisualScripting.Community { - public class DraggedListItem : VisualScripting.DraggedListItem + internal class DraggedListItem : VisualScripting.DraggedListItem { public DraggedListItem(MetadataListAdaptor sourceListAdaptor, int index, object item, bool foldoutState) : base(sourceListAdaptor, index, item) { this.foldoutState = foldoutState; } - public DraggedListItem(MetadataListAdaptor sourceListAdaptor, int index, object item, (VariableDeclaration, VariableFoldout) variableState) : base(sourceListAdaptor, index, item) - { - this.variableState = variableState; - } - public readonly bool foldoutState; - - public readonly (VariableDeclaration, VariableFoldout) variableState; } public class DraggedDictionaryItem diff --git a/Editor/Nodes/Fundamentals/Inspectors/List/ListAdaptor.cs b/Editor/Nodes/Fundamentals/Inspectors/List/ListAdaptor.cs index 420c30d0..7a9344fa 100644 --- a/Editor/Nodes/Fundamentals/Inspectors/List/ListAdaptor.cs +++ b/Editor/Nodes/Fundamentals/Inspectors/List/ListAdaptor.cs @@ -1,244 +1,137 @@ using System; +using System.Collections; using System.Collections.Generic; -using System.Reflection; +using Unity.VisualScripting.Community.Libraries.Humility; +using Unity.VisualScripting.ReorderableList; using UnityEditor; using UnityEngine; -using Unity.VisualScripting.ReorderableList; -using Unity.VisualScripting.Community.Libraries.Humility; -using System.Collections; -using System.Linq; namespace Unity.VisualScripting.Community { public class ListAdaptor : MetadataListAdaptor, IReorderableListDropTarget { - private readonly List foldoutStates = new List(); public ReorderableListControl listControl; + private readonly List foldoutStates = new List(); + private const float FoldoutHeight = 20f; private const float FieldHeight = 18f; private const float Spacing = 4f; private const float DeleteButtonWidth = 18f; private const float DragHandleWidth = 16f; + private const float IndentWidth = 20f; + private const float ContentIndent = 22f; + private const float VerticalOffset = 4f; + private const float HoverExpandDelay = 0.35f; - private static readonly FieldInfo listControlFieldInfo = typeof(MetadataCollectionAdaptor).GetField("listControl", BindingFlags.NonPublic | BindingFlags.Instance); - - public ListAdaptor(Metadata metadata, Inspector parent) : base(metadata, parent) - { - if (listControlFieldInfo != null) - { - listControl = listControlFieldInfo.GetValue(this) as ReorderableListControl; - if (listControl != null) - { - listControl.ContainerStyle = GUIStyle.none; - listControl.Flags = ReorderableListFlags.HideRemoveButtons; - listControl.HorizontalLineColor = EditorGUIUtility.isProSkin ? Color.black : Color.white; - listControl.HorizontalLineAtStart = true; - listControl.HorizontalLineAtEnd = true; - } - } - alwaysDragAndDrop = true; - } + public ListAdaptor(Metadata metadata, Inspector parent) : base(metadata, parent) { } public override float GetItemHeight(float width, int index) { var element = metadata[index]; + EnsureFoldoutStateSynced(index); - EnsureFoldoutCount(index); - bool expanded = foldoutStates[index]; - - if (!expanded) - return FoldoutHeight + Spacing; + float totalHeight = FoldoutHeight + Spacing; - float total = FoldoutHeight + Spacing; - - total += element.Inspector().GetCachedHeight(width - 20, GUIContent.none, parentInspector) + 2f; + if (foldoutStates[index]) + { + totalHeight += element.Inspector().GetCachedHeight(width - IndentWidth, GUIContent.none, parentInspector) + 2f; + totalHeight += 4f; + } - return total + 4f; + return totalHeight; } protected override IList ConstructList() { - if (metadata.listType == typeof(IList)) return new AotList(); - else if (metadata.listType.IsGenericType && metadata.listType.GetGenericTypeDefinition() == typeof(IList<>)) + if (metadata.listType == typeof(IList)) + return new AotList(); + + if (metadata.listType.IsGenericType && metadata.listType.GetGenericTypeDefinition() == typeof(IList<>)) { var args = metadata.listType.GetGenericArguments(); return (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(args[0])); } - return base.ConstructList(); - } - -#if DARKER_UI - // I have to do this setup to change the color of the add button - // It's very hacky but seems to work better than tinting the background Texture. - private Color _previousBackgroundColor; - private bool _tintApplied; - - public override void BeginGUI() - { - if (_tintApplied) - { - GUI.backgroundColor = _previousBackgroundColor; - _tintApplied = false; - } - } - - public override void EndGUI() - { - _previousBackgroundColor = GUI.backgroundColor; - GUI.backgroundColor = CommunityStyles.backgroundColor.Brighten(0.36f); - _tintApplied = true; - } -#endif - private void EnsureFoldoutCount(int index) - { - while (foldoutStates.Count <= index) - { - foldoutStates.Add(false); - foldoutHoverStartTimes.Add(null); - parentInspector.SetHeightDirty(); - } + return base.ConstructList(); } - public override void DrawItemBackground(Rect position, int index) - { -#if DARKER_UI - EditorGUI.DrawRect(position, CommunityStyles.backgroundColor); -#else - EditorGUI.DrawRect(position, ColorPalette.unityBackgroundLight); -#endif - var restoredColor = Handles.color; - Handles.color = Color.gray * 0.6f; - Handles.DrawAAPolyLine(2f, new Vector3[] - { - new Vector3(position.x, position.y + 1), - new Vector3(position.xMax, position.y + 1), - new Vector3(position.xMax, position.yMax), - new Vector3(position.x, position.yMax), - new Vector3(position.x, position.y) - }); - Handles.color = restoredColor; - } - private List foldoutHoverStartTimes = new List(); public override void DrawItem(Rect position, int index) { - if (!foldoutHoverStartTimes.Contains(index)) foldoutHoverStartTimes.Add(null); - - position.x -= 20; - position.width += 20; - var element = metadata[index]; - - var oldHandleRect = new Rect(position.x + 4, position.y + position.height / 2f - 3, 9, 7); -#if DARKER_UI - EditorGUI.DrawRect(oldHandleRect, CommunityStyles.backgroundColor); -#else - EditorGUI.DrawRect(oldHandleRect, ColorPalette.unityBackgroundLight); -#endif - EnsureFoldoutCount(index); - bool expanded = foldoutStates[index]; - - float y = position.y + 4; - - Rect boxRect = new Rect(position.x, y, position.width, GetItemHeight(index)); - float lineY = boxRect.y + (FoldoutHeight - 16f) / 2f; - - const float handleSize = 12f; - Rect handleRect = new Rect(position.x + 3, lineY, handleSize, handleSize); - - Texture2D dragTexture = CommunityStyles.DragHandleTexture; + EnsureFoldoutStateSynced(index); - GUI.DrawTexture(handleRect, dragTexture); + position.x -= IndentWidth; + position.width += IndentWidth; - EditorGUIUtility.AddCursorRect(handleRect, MouseCursor.Pan); - - Rect foldoutRect = new Rect(position.x + 18, lineY, position.width - DragHandleWidth - DeleteButtonWidth - 23, FieldHeight); + var element = metadata[index]; + float yPos = position.y + VerticalOffset; - Texture2D arrowOpen = CommunityStyles.ArrowDownTexture; - Texture2D arrowClosed = CommunityStyles.ArrowRightTexture; + Rect foldoutRect = new Rect( + position.x + FieldHeight, + yPos, + position.width - DragHandleWidth - DeleteButtonWidth - 23f, + FieldHeight); - Texture2D arrowTexture = foldoutStates[index] ? arrowOpen : arrowClosed; - var arrowRect = new Rect(foldoutRect) - { - width = 12f, - height = 12f, - y = foldoutRect.y + 1 - }; + DrawFoldout(foldoutRect, index, element); + // HandleHoverExpansion(index); - if (arrowTexture != null) + if (foldoutStates[index]) { - GUI.DrawTexture(arrowRect, arrowTexture, ScaleMode.ScaleToFit, true); + DrawExpandedContent(position, yPos, index, element); } - var labelRect = new Rect(foldoutRect); - labelRect.x += 15; - labelRect.y -= 3; - GUI.Label(labelRect, CommunityStyles.GetCollectionDisplayName(element, index)); + HandleDragAndDrop(position, index); + } - if (Event.current.type == EventType.MouseDown && arrowRect.Contains(Event.current.mousePosition)) + private void DrawFoldout(Rect foldoutRect, int index, Metadata element) + { + using (new EditorGUIUtility.IconSizeScope(new Vector2(IconSize.Small, IconSize.Small))) { - foldoutStates[index] = !foldoutStates[index]; - parentInspector.SetHeightDirty(); - Event.current.Use(); - } + var oldHierarchyMode = EditorGUIUtility.hierarchyMode; + EditorGUIUtility.hierarchyMode = false; + EditorGUI.BeginChangeCheck(); - var e = Event.current; - - bool draggingObjects = (DragAndDrop.objectReferences != null && DragAndDrop.objectReferences.Length > 0) || - DragAndDrop.GetGenericData(VisualScripting.DraggedListItem.TypeName) != null || - DragAndDrop.GetGenericData(DraggedDictionaryItem.TypeName) != null; - - if (e != null && draggingObjects && e.type == EventType.MouseDrag && e.button == (int)MouseButton.Left && boxRect.Contains(e.mousePosition)) - { - const float expandDelay = 0.35f; - if (!foldoutHoverStartTimes[index].HasValue) - foldoutHoverStartTimes[index] = EditorApplication.timeSinceStartup; + foldoutStates[index] = EditorGUI.Foldout(foldoutRect, foldoutStates[index], CommunityStyles.GetCollectionDisplayName(element, index)); - if (EditorApplication.timeSinceStartup - foldoutHoverStartTimes[index].Value > expandDelay) - foldoutStates[index] = true; + if (EditorGUI.EndChangeCheck()) + { + parentInspector.SetHeightDirty(); + } - parentInspector.SetHeightDirty(); - GUI.changed = true; - } - else - { - foldoutHoverStartTimes[index] = null; + EditorGUIUtility.hierarchyMode = oldHierarchyMode; } + } - Rect deleteRect = new Rect(position.x + position.width - DeleteButtonWidth - 4, lineY - 2f, DeleteButtonWidth - 2, FieldHeight - 2); - if (GUI.Button(deleteRect, "", new GUIStyle(EditorStyles.whiteLabel) - { - normal = { background = CommunityStyles.RemoveItemTexture } - })) - { - if (CanRemove(index)) - Remove(index); - return; - } + private void DrawExpandedContent(Rect position, float yPos, int index, Metadata element) + { + float contentY = yPos + FoldoutHeight + Spacing; + float contentWidth = position.width - ContentIndent; - if (expanded) - { - float contentY = y + FoldoutHeight + Spacing; - float width = position.width - 12; - element.Inspector().Draw(new Rect(position.x + 5, contentY, width, LudiqGUI.GetInspectorHeight(parentInspector, element, width, GUIContent.none)), GUIContent.none); - } + Rect contentRect = new Rect( + position.x + ContentIndent, + contentY, + contentWidth, + LudiqGUI.GetInspectorHeight(parentInspector, element, contentWidth, GUIContent.none)); - var controlID = GUIUtility.GetControlID(FocusType.Passive); + element.Inspector().Draw(contentRect, GUIContent.none); + } + + private void HandleDragAndDrop(Rect position, int index) + { + int controlID = GUIUtility.GetControlID(FocusType.Passive); + var e = Event.current; - switch (Event.current.GetTypeForControl(controlID)) + switch (e.GetTypeForControl(controlID)) { case EventType.MouseDown: - var draggablePosition = position; - - if (Event.current.button == (int)MouseButton.Left && draggablePosition.Contains(Event.current.mousePosition) && !handleRect.Contains(Event.current.mousePosition)) + if (e.button == (int)MouseButton.Left && position.Contains(e.mousePosition)) { - if (alwaysDragAndDrop || Event.current.alt) + if (alwaysDragAndDrop || e.alt) { GUIUtility.hotControl = controlID; - Event.current.Use(); + e.Use(); } } - break; case EventType.MouseDrag: @@ -246,22 +139,32 @@ public override void DrawItem(Rect position, int index) { var item = this[index]; GUIUtility.hotControl = 0; + DragAndDrop.PrepareStartDrag(); - DragAndDrop.objectReferences = new UnityEngine.Object[0]; - DragAndDrop.paths = new string[0]; - DragAndDrop.SetGenericData(VisualScripting.DraggedListItem.TypeName, new DraggedListItem(this, index, item, foldoutStates[index])); + DragAndDrop.objectReferences = Array.Empty(); + DragAndDrop.paths = Array.Empty(); + DragAndDrop.SetGenericData(DraggedListItem.TypeName, new DraggedListItem(this, index, item, foldoutStates[index])); DragAndDrop.StartDrag(metadata.path); - Event.current.Use(); + e.Use(); } - break; } } + private void EnsureFoldoutStateSynced(int index) + { + while (foldoutStates.Count <= index) + { + foldoutStates.Add(false); + parentInspector.SetHeightDirty(); + } + } + protected override bool CanAdd() { if (metadata.HasAttribute()) return metadata.Count < metadata.GetAttribute().max; + return true; } @@ -269,15 +172,8 @@ public override bool CanRemove(int index) { if (metadata.HasAttribute()) return metadata.Count > metadata.GetAttribute().min; - return base.CanRemove(index); - } - public override void Remove(int index) - { - foldoutStates.RemoveAt(index); - base.Remove(index); - GUIUtility.keyboardControl = 0; - GUIUtility.hotControl = 0; + return base.CanRemove(index); } public override void Add() @@ -286,17 +182,37 @@ public override void Add() base.Add(); } + public override void Clear() + { + metadata.RecordUndo(); + + for (int i = 0; i < metadata.Count; i++) + { + Remove(i); + } + + parentInspector.SetHeightDirty(); + } + + public override void Remove(int index) + { + if (!CanRemove(index)) + return; + + foldoutStates.RemoveAt(index); + base.Remove(index); + ClearHotControls(); + } + public override void Move(int sourceIndex, int destIndex) { base.Move(sourceIndex, destIndex); - if (foldoutStates.Count == 0) - return; + if (foldoutStates.Count == 0) return; - if (destIndex > sourceIndex) - destIndex--; + if (destIndex > sourceIndex) destIndex--; - var state = foldoutStates[sourceIndex]; + bool state = foldoutStates[sourceIndex]; foldoutStates.RemoveAt(sourceIndex); foldoutStates.Insert(destIndex, state); } @@ -304,30 +220,21 @@ public override void Move(int sourceIndex, int destIndex) public new bool CanDropInsert(int insertionIndex) { if (!ReorderableListControl.CurrentListPosition.Contains(Event.current.mousePosition)) - { return false; - } - var data = DragAndDrop.GetGenericData(VisualScripting.DraggedListItem.TypeName); - - return data is DraggedListItem && metadata.listElementType.IsInstanceOfType(((DraggedListItem)data).item); + return DragAndDrop.GetGenericData(DraggedListItem.TypeName) is DraggedListItem draggedData && + metadata.listElementType.IsInstanceOfType(draggedData.item); } public new void ProcessDropInsertion(int insertionIndex) { if (Event.current.type == EventType.DragPerform) { - var draggedItem = DragAndDrop.GetGenericData(VisualScripting.DraggedListItem.TypeName) as DraggedListItem; - - if (draggedItem != null) + if (DragAndDrop.GetGenericData(DraggedListItem.TypeName) is DraggedListItem draggedItem) { - if (draggedItem.sourceListAdaptor != this) + if (draggedItem.sourceListAdaptor != this && CanDrop(draggedItem.item)) { - if (!CanDrop(draggedItem.item)) - return; - - var state = draggedItem.foldoutState; - foldoutStates.Insert(insertionIndex, state); + foldoutStates.Insert(insertionIndex, draggedItem.foldoutState); } } } @@ -338,16 +245,12 @@ public override void Move(int sourceIndex, int destIndex) public override float GetItemAdaptiveWidth(int index) { var element = metadata[index]; - EnsureFoldoutCount(index); - - const float foldoutArrowWidth = 12f; + EnsureFoldoutStateSynced(index); GUIContent label = CommunityStyles.GetCollectionDisplayName(element, index); - float labelWidth = GUI.skin.label.CalcSize(label).x; - - float baseWidth = DragHandleWidth + foldoutArrowWidth + labelWidth + DeleteButtonWidth; - + float baseWidth = GUI.skin.label.CalcSize(label).x; float inspectorWidth = 0f; + if (foldoutStates[index]) { try @@ -355,8 +258,7 @@ public override float GetItemAdaptiveWidth(int index) var inspector = element.Inspector(); if (inspector != null) { - float contentWidth = inspector.GetAdaptiveWidth(); - inspectorWidth = contentWidth + 10f; + inspectorWidth = inspector.GetAdaptiveWidth() + 10f; } } catch (Exception) @@ -366,5 +268,11 @@ public override float GetItemAdaptiveWidth(int index) return Mathf.Max(baseWidth, inspectorWidth); } + + private void ClearHotControls() + { + GUIUtility.keyboardControl = 0; + GUIUtility.hotControl = 0; + } } } \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Inspectors/List/ListInspector.cs b/Editor/Nodes/Fundamentals/Inspectors/List/ListInspector.cs index 8f1a4166..bb8c66a5 100644 --- a/Editor/Nodes/Fundamentals/Inspectors/List/ListInspector.cs +++ b/Editor/Nodes/Fundamentals/Inspectors/List/ListInspector.cs @@ -38,10 +38,7 @@ protected override void OnGUI(Rect position, GUIContent label) return; } - var normal = GUI.backgroundColor; adaptor.Field(position, label); - // Restore color after tinting add - GUI.backgroundColor = normal; } public override float GetAdaptiveWidth() => adaptor.GetAdaptiveWidth(); diff --git a/Editor/Nodes/Fundamentals/Inspectors/Variables/GraphInspectorSession.cs b/Editor/Nodes/Fundamentals/Inspectors/Variables/GraphInspectorSession.cs index 89594fe0..b67d3794 100644 --- a/Editor/Nodes/Fundamentals/Inspectors/Variables/GraphInspectorSession.cs +++ b/Editor/Nodes/Fundamentals/Inspectors/Variables/GraphInspectorSession.cs @@ -28,6 +28,16 @@ public static bool Load(UnityEngine.Object rootObject, Guid[] parentGuids, strin return state; } + public static void Delete(UnityEngine.Object rootObject, Guid[] parentGuids, string variableName) + { + if (rootObject == null) + return; + + var key = BuildInspectorKey(rootObject, parentGuids); + + SessionState.EraseBool($"{key}.{variableName}"); + } + private static string BuildInspectorKey(UnityEngine.Object rootObject, Guid[] parentGuids) { var globalId = GlobalObjectId.GetGlobalObjectIdSlow(rootObject); diff --git a/Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationInspector.cs b/Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationInspector.cs index 4f621dfe..77d48efb 100644 --- a/Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationInspector.cs +++ b/Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationInspector.cs @@ -1,16 +1,527 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Unity.VisualScripting.ReorderableList; using UnityEditor; using UnityEngine; using UnityEngine.SceneManagement; namespace Unity.VisualScripting.Community { +#if NEW_VARIABLES_UI public sealed class PatchedVariableDeclarationInspector : Inspector { + private static readonly GUIContent Rename = new GUIContent("Rename"); + private static readonly GUIContent CommandMoveToTop = new GUIContent("Move to Top"); + private static readonly GUIContent CommandMoveToBottom = new GUIContent("Move to Bottom"); + private static readonly GUIContent CommandDuplicate = new GUIContent("Duplicate"); + private static readonly GUIContent CommandRemove = new GUIContent("Remove"); + private static readonly GUIContent CommandClearAll = new GUIContent("Clear All"); + + private static readonly FieldInfo s_ContextCommandNameFieldInfo; + private readonly Metadata nameMetadata; + private readonly Metadata valueMetadata; + private readonly Metadata typeMetadata; + + private Type cachedType; + private Texture cachedIcon; + private InlineTypeInfo cachedInlineInfo; + private bool cachedIsInline; + private SerializableType cachedTypeHandle; + private bool isOpen; + private bool hasCachedType; + private bool initializedType; + private bool changed; + private bool isRenaming; + private string renameControl; + + private SystemObjectInspector systemObjectInspector; + private Inspector valueInspector; + private Inspector typedValueInspector; + + public readonly static EditorTexture NullIcon = typeof(Null).Icon(); + private static readonly GUIContent Temp = new GUIContent(); + private const int IconSize = 16; + private const int InlineValueSpacing = 4; + private const string TextControl = "VariableDeclerationsControl"; + + private static readonly Assembly EditorCoreAssembly; + private static readonly MethodInfo ResolveSerializableTypeMethod; + private static readonly FieldInfo SystemObjectInspectorField; + private static readonly MethodInfo GetWidthMethod; + private static readonly FieldInfo ParentInspectorField; + + PatchedVariableDeclarationsInspector parent; + + private static readonly HashSet ConstructTypes = new HashSet() + { + typeof(Vector2), typeof(Vector3), typeof(Vector4), typeof(Vector2Int), typeof(Vector3Int), + typeof(Quaternion), typeof(Rect), typeof(Color), typeof(HDRColor), typeof(Gradient), + }; + + static PatchedVariableDeclarationInspector() + { + EditorCoreAssembly = typeof(GraphGUI).Assembly; + ResolveSerializableTypeMethod = EditorCoreAssembly.GetTypes().FirstOrDefault(t => t.Name == "SerializableTypeExtensions")?.GetMethod("Resolve", BindingFlags.Static | BindingFlags.Public); + SystemObjectInspectorField = typeof(SystemObjectInspector).GetField("inspector", BindingFlags.Instance | BindingFlags.NonPublic); + GetWidthMethod = EditorCoreAssembly.GetTypes().FirstOrDefault(t => t.Name == "ValueInspector")?.GetMethod("GetWidth", BindingFlags.Instance | BindingFlags.Public); + ParentInspectorField = typeof(Inspector).GetField("parentInspector", BindingFlags.NonPublic | BindingFlags.Instance); + + s_ContextCommandNameFieldInfo = typeof(ReorderableListControl).GetField("s_ContextCommandName", BindingFlags.Static | BindingFlags.NonPublic); + } + + public PatchedVariableDeclarationInspector(Metadata metadata) : base(metadata) + { + VSUsageUtility.isVisualScriptingUsed = true; + nameMetadata = metadata[nameof(VariableDeclaration.name)]; + valueMetadata = metadata[nameof(VariableDeclaration.value)]; + typeMetadata = metadata[nameof(VariableDeclaration.typeHandle)]; + } + + GraphReference reference = null; + UnityEngine.Object root = null; + Guid[] parentGuids = null; + + public override void Initialize() + { + base.Initialize(); + + valueInspector = valueMetadata.Inspector(); + + if (valueInspector is SystemObjectInspector sysObjInspector) + { + systemObjectInspector = sysObjInspector; + } + + RefreshCachedTypeInfo(); + } + + private void RefreshCachedTypeInfo() + { + var declaration = (VariableDeclaration)metadata.value; + + if (hasCachedType && cachedTypeHandle == declaration.typeHandle) return; + + hasCachedType = true; + cachedTypeHandle = declaration.typeHandle; + cachedType = (Type)ResolveSerializableTypeMethod.InvokeOptimized(null, cachedTypeHandle); + + EditorTexture icon = (cachedType == null || cachedType == typeof(Unknown)) ? NullIcon : cachedType.Icon(); + cachedIcon = icon[IconSize]; + + cachedInlineInfo = new InlineTypeInfo(cachedType); + cachedIsInline = cachedType != null && (cachedType.IsBasic() || cachedInlineInfo.isConstruct || cachedInlineInfo.isUnityObject); + + typedValueInspector = valueMetadata.Cast(cachedType).Inspector(); + } + + protected override float GetHeight(float width, GUIContent label) + { + float height = 0f; + + using (LudiqGUIUtility.labelWidth.Override(Styles.labelWidth)) + { + height += Styles.padding + GetNameHeight(width); + + if (isOpen) + { + height += Styles.spacing + GetTypeHeight(width); + height += Styles.spacing + GetValueHeight(width); + } + + height += Styles.padding; + } + + return height; + } + + private float GetNameHeight(float width) => EditorGUIUtility.singleLineHeight; + private float GetValueHeight(float width) => LudiqGUI.GetInspectorHeight(this, valueMetadata, width); + private float GetTypeHeight(float width) => LudiqGUI.GetInspectorHeight(this, typeMetadata, width); + + private bool LoadedState; + + private void LoadState() + { + if (LoadedState) return; + + LoadedState = true; + + parent = ParentInspectorField.GetValueOptimized(this) as PatchedVariableDeclarationsInspector; + + var declaration = metadata.value as VariableDeclaration; + + if (VariablesWindow.isVariablesWindowContext) + { + reference = VariablesWindow.currentContext?.reference; + root = reference?.rootObject; + parentGuids = reference?.parentElementGuids?.ToArray(); + } + else + { + reference = LudiqGraphsEditorUtility.editedContext?.value?.reference; + root = reference?.rootObject; + parentGuids = reference?.parentElementGuids?.ToArray(); + } + + var ancestor = metadata.Ancestor(m => m.value is Variables); + if (ancestor != null) + { + root = ancestor.value as Variables; + parentGuids = null; + } + + if (parent.kind == VariableKind.Application) + { + root = ApplicationVariables.asset; + parentGuids = null; + } + else if (parent.kind == VariableKind.Saved) + { + root = SavedVariables.asset; + parentGuids = null; + } + + isOpen = VariableInspectorState.Load(root, parentGuids, declaration.name); + } + + protected override void OnGUI(Rect position, GUIContent label) + { + LoadState(); + + if (e.type == EventType.ContextClick && position.Contains(e.mousePosition)) + { + var menu = new GenericMenu(); + AddItemsToMenu(menu, metadata.parent.IndexOf(metadata.value)); + menu.ShowAsContext(); + e.Use(); + } + + position = BeginLabeledBlock(metadata, position, label); + RefreshCachedTypeInfo(); + + using (LudiqGUIUtility.labelWidth.Override(Styles.labelWidth)) + { + y += Styles.padding; + var namePosition = position.VerticalSection(ref y, GetNameHeight(position.width)); + + if (!initializedType && systemObjectInspector != null) + { + GetWidthMethod.InvokeOptimized(SystemObjectInspectorField.GetValueOptimized(systemObjectInspector)); + initializedType = true; + } + + OnNameGUI(namePosition); + + if (isOpen) + { + y += Styles.spacing; + var typePosition = position.VerticalSection(ref y, GetTypeHeight(position.width)); + + y += Styles.spacing; + var valuePosition = position.VerticalSection(ref y, GetValueHeight(position.width)); + + LudiqGUI.Inspector(typeMetadata, typePosition, GUIContent.none); + LudiqGUI.Inspector(valueMetadata, valuePosition, GUIContent.none); + } + + y += Styles.padding; + } + + if (!changed) EndBlock(metadata); + } + + public void OnNameGUI(Rect namePosition) + { + var declaration = (VariableDeclaration)metadata.value; + + var foldoutRect = new Rect(namePosition.x, namePosition.y, 16, namePosition.height); + var textRect = new Rect(foldoutRect.xMax + IconSize, namePosition.y, namePosition.width - foldoutRect.width - IconSize, namePosition.height); + var valueRect = Rect.zero; + + var oldMode = EditorGUIUtility.hierarchyMode; + EditorGUIUtility.hierarchyMode = false; + Temp.image = cachedIcon; + + var oldIsOpen = isOpen; + isOpen = EditorGUI.Foldout(foldoutRect, isOpen, Temp, true); + + if (oldIsOpen != isOpen) + VariableInspectorState.Save(root, parentGuids, declaration.name, isOpen); + + EditorGUIUtility.hierarchyMode = oldMode; + + bool drawInlineValue = !isOpen && cachedIsInline; + if (drawInlineValue) + { + if (cachedInlineInfo.isEnum) + { + if (typedValueInspector is EnumInspector enumInspector) + { + var adaptiveWidth = enumInspector.GetAdaptiveWidth(); + textRect.width -= adaptiveWidth; + + valueRect = new Rect(textRect.xMax + InlineValueSpacing, textRect.y, adaptiveWidth, textRect.height); + } + else + { + textRect.width -= cachedInlineInfo.width + InlineValueSpacing; + valueRect = new Rect(textRect.xMax + InlineValueSpacing, textRect.y, cachedInlineInfo.width, textRect.height); + } + } + else + { + textRect.width -= cachedInlineInfo.width + InlineValueSpacing; + valueRect = new Rect(textRect.xMax + InlineValueSpacing, textRect.y, cachedInlineInfo.width, textRect.height); + } + } + + var oldName = (string)nameMetadata.value; + string controlName = TextControl + oldName; + GUI.SetNextControlName(controlName); + + BeginBlock(nameMetadata, namePosition); + string newName = EditorGUI.DelayedTextField(textRect, oldName); + + if (renameControl != null && renameControl == controlName) + { + GUI.FocusControl(controlName); + renameControl = null; + } + + bool endBlock = EndBlock(nameMetadata); + + if (drawInlineValue) + { + if (cachedInlineInfo.isUnityObject) + { + EditorGUI.BeginChangeCheck(); + var updatedObj = EditorGUI.ObjectField(valueRect, valueMetadata.value as UnityEngine.Object, cachedType, true); + if (EditorGUI.EndChangeCheck()) + { + valueMetadata.RecordUndo(); + valueMetadata.value = updatedObj; + } + } + else + { + valueInspector.Draw(valueRect, GUIContent.none); + } + } + + if (endBlock && ProcessRename(oldName, newName, declaration, parent?.kind)) + { + GUI.FocusControl(null); + } + + if (parent != null && parent.addedItem && declaration == parent.addedDeclaration) + { + parent.addedItem = false; + parent.addedDeclaration = null; + GUI.FocusControl(controlName); + } + } + + private bool ProcessRename(string oldName, string newName, VariableDeclaration declaration, VariableKind? kind) + { + var variableDeclarations = (VariableDeclarationCollection)metadata.parent.value; + + if (StringUtility.IsNullOrWhiteSpace(newName)) + { + EditorUtility.DisplayDialog("Edit Variable Name", "Please enter a variable name.", "OK"); + return false; + } + if (variableDeclarations.Contains(newName) && newName != oldName) + { + EditorUtility.DisplayDialog("Edit Variable Name", "A variable with the same name already exists.", "OK"); + return false; + } + if (oldName == newName) return false; + + nameMetadata.RecordUndo(); + RecordSceneUndo(kind); + + variableDeclarations.EditorRename(declaration, newName); + nameMetadata.value = newName; + + UpdateVariableReferences(kind, oldName, newName); + + if (isRenaming) + { + GraphUtility.RenameVariables(parent.kind.Value, oldName, newName, metadata); + } + return true; + } + + private void RecordSceneUndo(VariableKind? kind) + { + if (kind != VariableKind.Scene) return; + + if (GraphWindow.active != null && GraphWindow.activeReference?.scene != null) + { + Undo.RecordObject(SceneVariables.Instance(GraphWindow.activeReference.scene.Value).variables, "Changed Scene variable name"); + return; + } + + for (int i = 0; i < SceneManager.sceneCount; i++) + { + var scene = SceneManager.GetSceneAt(i); + if (scene.isLoaded && VisualScripting.Variables.Scene(scene) == metadata.parent.value) + { + Undo.RecordObject(SceneVariables.Instance(scene).variables, "Changed Scene variable name"); + break; + } + } + } + + private void UpdateVariableReferences(VariableKind? kind, string oldName, string newName) + { + switch (kind) + { + case VariableKind.Flow: + case VariableKind.Graph: + if (EditorWindow.focusedWindow == GraphWindow.active) + GraphUtility.UpdateAllGraphVariables((FlowGraph)GraphWindow.activeContext.graph, oldName, newName); + else if (VariablesWindow.isVariablesWindowContext && VariablesWindow.currentContext != null) + GraphUtility.UpdateAllGraphVariables((FlowGraph)VariablesWindow.currentContext.graph, oldName, newName); + break; + + case VariableKind.Object: + var objAncestor = metadata.Ancestor(m => m.value is VisualScripting.Variables); + if (objAncestor?.value != null) + GraphUtility.UpdateAllObjectVariables((objAncestor.value as VisualScripting.Variables).gameObject, oldName, newName); + else if (EditorWindow.focusedWindow == GraphWindow.active && GraphWindow.activeReference?.gameObject != null) + GraphUtility.UpdateAllObjectVariables(GraphWindow.activeReference.gameObject, oldName, newName); + break; + + case VariableKind.Scene: + var sceneAncestor = metadata.Ancestor(m => m.value is VisualScripting.Variables); + if (sceneAncestor?.value != null) + GraphUtility.UpdateAllSceneVariables((sceneAncestor.value as VisualScripting.Variables).gameObject.scene, oldName, newName); + else if (EditorWindow.focusedWindow == GraphWindow.active && GraphWindow.activeReference?.scene != null) + GraphUtility.UpdateAllSceneVariables(GraphWindow.activeReference.scene.Value, oldName, newName); + else + Debug.LogWarning("[Rename Variables] Could not find valid scene to update variables."); + break; + + case VariableKind.Application: + case VariableKind.Saved: + if (Application.isPlaying) + { + Debug.LogWarning($"[Rename Variables] Cannot rename {kind} variables while in play mode!"); + break; + } + bool choice = changed = EditorUtility.DisplayDialog( + $"Update ALL {kind} Variables?", + $"This will go through ALL scenes and macros to find every Variable Unit using '{oldName}' and update it to '{newName}'.\n\nThis operation is FINAL and cannot be undone!", + "Update All", "Rename Only"); + + if (choice && kind == VariableKind.Application) GraphUtility.RenameApplicationVariables(oldName, newName); + else if (choice && kind == VariableKind.Saved) GraphUtility.RenameSavedVariables(oldName, newName); + break; + } + } + + private void DoCommand(GUIContent command, int itemIndex) + { + if (command == Rename) + { + isRenaming = true; + renameControl = TextControl + (metadata.parent[itemIndex].value as VariableDeclaration).name; + return; + } + s_ContextCommandNameFieldInfo.SetValueOptimized(null, command.text); + parent.listControl.DoCommand(command.text, itemIndex, (IReorderableListAdaptor)PatchedVariableDeclarationsInspector.adaptorFieldAccessor.GetValue(parent)); + } + + private void AddItemsToMenu(GenericMenu menu, int itemIndex) + { + void Action(object v) => DoCommand(v as GUIContent, itemIndex); + + menu.AddItem(Rename, false, Action, Rename); + menu.AddSeparator(""); + + if (itemIndex > 0) menu.AddItem(CommandMoveToTop, false, Action, CommandMoveToTop); + else menu.AddDisabledItem(CommandMoveToTop); + + if (itemIndex + 1 < metadata.parent.Count) menu.AddItem(CommandMoveToBottom, false, Action, CommandMoveToBottom); + else menu.AddDisabledItem(CommandMoveToBottom); + + menu.AddSeparator(""); + menu.AddItem(CommandDuplicate, false, Action, CommandDuplicate); + + if (menu.GetItemCount() > 0) menu.AddSeparator(""); + + menu.AddItem(CommandRemove, false, Action, CommandRemove); + menu.AddSeparator(""); + menu.AddItem(CommandClearAll, false, Action, CommandClearAll); + } + + private readonly struct InlineTypeInfo + { + public readonly bool isUnityObject; + public readonly bool isConstruct; + public readonly bool isEnum; + public readonly float width; + + public InlineTypeInfo(Type type) + { + isUnityObject = type != null && typeof(UnityEngine.Object).IsAssignableFrom(type); + isConstruct = type != null && ConstructTypes.Contains(type); + isEnum = type != null && type.IsEnum; + + if (isUnityObject || type == typeof(bool)) width = 20f; + else if (isEnum) width = 65f; + else if (type == typeof(Vector2) || type == typeof(Vector2Int) || type == typeof(Color) || type == typeof(HDRColor) || type == typeof(Gradient)) width = 50f; + else if (type == typeof(Vector3) || type == typeof(Vector3Int)) width = 65f; + else if (type == typeof(Vector4)) width = 80f; + else width = 35f; + } + } + + public static class Styles + { + public static readonly float labelWidth = SystemObjectInspector.Styles.labelWidth; + public static readonly float padding = 2; + public static readonly float spacing = EditorGUIUtility.standardVerticalSpacing; + } + } +#else + public sealed class PatchedVariableDeclarationInspector : Inspector + { + private static readonly FieldInfo s_ContextCommandNameFieldInfo; + private static readonly FieldInfo AdaptorField = typeof(VariableDeclarationsInspector).GetField("adaptor", BindingFlags.Instance | BindingFlags.NonPublic); + private static readonly FieldInfo listControlFieldInfo = typeof(MetadataCollectionAdaptor).GetField("listControl", BindingFlags.NonPublic | BindingFlags.Instance); + + private static readonly GUIContent Rename = new GUIContent("Rename"); + private static readonly GUIContent CommandMoveToTop = new GUIContent("Move to Top"); + private static readonly GUIContent CommandMoveToBottom = new GUIContent("Move to Bottom"); + private static readonly GUIContent CommandDuplicate = new GUIContent("Duplicate"); + private static readonly GUIContent CommandRemove = new GUIContent("Remove"); + private static readonly GUIContent CommandClearAll = new GUIContent("Clear All"); + + private MetadataListAdaptor adaptor; + private ReorderableListControl listControl; + + private const string TextControl = "VariableDeclerationsControl"; + private string renameControl; + private bool isRenaming; + private Metadata nameMetadata => metadata[nameof(VariableDeclaration.name)]; private Metadata valueMetadata => metadata[nameof(VariableDeclaration.value)]; #if VISUAL_SCRIPTING_1_7 private Metadata typeMetadata => metadata[nameof(VariableDeclaration.typeHandle)]; #endif + private bool changed; + private VariableDeclarationsInspector parent; + private static readonly FieldInfo ParentInspectorField = typeof(Inspector).GetField("parentInspector", BindingFlags.NonPublic | BindingFlags.Instance); + + static PatchedVariableDeclarationInspector() + { + s_ContextCommandNameFieldInfo = typeof(ReorderableListControl).GetField("s_ContextCommandName", BindingFlags.Static | BindingFlags.NonPublic); + } + public PatchedVariableDeclarationInspector(Metadata metadata) : base(metadata) { @@ -54,8 +565,41 @@ float GetTypeHeight(float width) return LudiqGUI.GetInspectorHeight(this, typeMetadata, width); } #endif + + private bool LoadedState; + + private bool addedItem; + + private void LoadState() + { + if (LoadedState) return; + + LoadedState = true; + + parent = ParentInspectorField.GetValueOptimized(this) as VariableDeclarationsInspector; + + adaptor = (MetadataListAdaptor)AdaptorField.GetValueOptimized(parent); + + listControl = (ReorderableListControl)listControlFieldInfo.GetValueOptimized(adaptor); + + adaptor.itemAdded += (v) => + { + addedItem = metadata.value == v; + }; + } + protected override void OnGUI(Rect position, GUIContent label) { + LoadState(); + + if (e.type == EventType.ContextClick && position.Contains(e.mousePosition)) + { + var menu = new GenericMenu(); + AddItemsToMenu(menu, metadata.parent.IndexOf(metadata.value)); + menu.ShowAsContext(); + e.Use(); + } + position = BeginLabeledBlock(metadata, position, label); using (LudiqGUIUtility.labelWidth.Override(Styles.labelWidth)) @@ -77,179 +621,173 @@ protected override void OnGUI(Rect position, GUIContent label) OnValueGUI(valuePosition); } - if (!changed) - EndBlock(metadata); + if (!changed) EndBlock(metadata); } - private bool changed; - public void OnNameGUI(Rect namePosition) { - namePosition = BeginLabeledBlock(nameMetadata, namePosition); + var declaration = (VariableDeclaration)metadata.value; var oldName = (string)nameMetadata.value; - var newName = EditorGUI.DelayedTextField(namePosition, (string)nameMetadata.value); + string controlName = TextControl + oldName; - if (EndBlock(nameMetadata)) + namePosition = BeginLabeledBlock(nameMetadata, namePosition); + + GUI.SetNextControlName(controlName); + + var newName = EditorGUI.DelayedTextField(namePosition, oldName); + + if (renameControl != null && renameControl == controlName) { - var variableDeclarations = (VariableDeclarationCollection)metadata.parent.value; - var declaration = (VariableDeclaration)nameMetadata.parent.value; + GUI.FocusControl(controlName); + renameControl = null; + } - if (StringUtility.IsNullOrWhiteSpace(newName)) - { - EditorUtility.DisplayDialog("Edit Variable Name", "Please enter a variable name.", "OK"); - return; - } - else if (variableDeclarations.Contains(newName)) + if (EndBlock(nameMetadata) && ProcessRename(oldName, newName, declaration, parent?.kind)) + { + GUI.FocusControl(null); + } + + if (addedItem) + { + addedItem = false; + GUI.FocusControl(controlName); + } + } + + private bool ProcessRename(string oldName, string newName, VariableDeclaration declaration, VariableKind? kind) + { + var variableDeclarations = (VariableDeclarationCollection)metadata.parent.value; + + if (StringUtility.IsNullOrWhiteSpace(newName)) + { + EditorUtility.DisplayDialog("Edit Variable Name", "Please enter a variable name.", "OK"); + return false; + } + if (variableDeclarations.Contains(newName) && newName != oldName) + { + EditorUtility.DisplayDialog("Edit Variable Name", "A variable with the same name already exists.", "OK"); + return false; + } + if (oldName == newName) return false; + + nameMetadata.RecordUndo(); + RecordSceneUndo(kind); + + variableDeclarations.EditorRename(declaration, newName); + nameMetadata.value = newName; + + UpdateVariableReferences(kind, oldName, newName); + + if (isRenaming) + { + GraphUtility.RenameVariables(parent.kind.Value, oldName, newName, metadata); + } + return true; + } + + private void RecordSceneUndo(VariableKind? kind) + { + if (kind != VariableKind.Scene) return; + + if (GraphWindow.active != null && GraphWindow.activeReference?.scene != null) + { + Undo.RecordObject(SceneVariables.Instance(GraphWindow.activeReference.scene.Value).variables, "Changed Scene variable name"); + return; + } + + for (int i = 0; i < SceneManager.sceneCount; i++) + { + var scene = SceneManager.GetSceneAt(i); + if (scene.isLoaded && VisualScripting.Variables.Scene(scene) == metadata.parent.value) { - EditorUtility.DisplayDialog("Edit Variable Name", "A variable with the same name already exists.", "OK"); - return; + Undo.RecordObject(SceneVariables.Instance(scene).variables, "Changed Scene variable name"); + break; } - var kind = - (typeof(Inspector).GetField("parentInspector", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(this) as VariableDeclarationsInspector).kind; - nameMetadata.RecordUndo(); - if (kind == VariableKind.Scene) - { - if (GraphWindow.active != null && GraphWindow.activeReference?.scene != null) - Undo.RecordObject(SceneVariables.Instance(GraphWindow.activeReference.scene.Value).variables, "Changed Scene variable name"); + } + } + + private void UpdateVariableReferences(VariableKind? kind, string oldName, string newName) + { + switch (kind) + { + case VariableKind.Flow: + case VariableKind.Graph: + if (EditorWindow.focusedWindow == GraphWindow.active) + GraphUtility.UpdateAllGraphVariables((FlowGraph)GraphWindow.activeContext.graph, oldName, newName); + else if (VariablesWindow.isVariablesWindowContext && VariablesWindow.currentContext != null) + GraphUtility.UpdateAllGraphVariables((FlowGraph)VariablesWindow.currentContext.graph, oldName, newName); + break; + + case VariableKind.Object: + var objAncestor = metadata.Ancestor(m => m.value is VisualScripting.Variables); + if (objAncestor?.value != null) + GraphUtility.UpdateAllObjectVariables((objAncestor.value as VisualScripting.Variables).gameObject, oldName, newName); + else if (EditorWindow.focusedWindow == GraphWindow.active && GraphWindow.activeReference?.gameObject != null) + GraphUtility.UpdateAllObjectVariables(GraphWindow.activeReference.gameObject, oldName, newName); + break; + + case VariableKind.Scene: + var sceneAncestor = metadata.Ancestor(m => m.value is VisualScripting.Variables); + if (sceneAncestor?.value != null) + GraphUtility.UpdateAllSceneVariables((sceneAncestor.value as VisualScripting.Variables).gameObject.scene, oldName, newName); + else if (EditorWindow.focusedWindow == GraphWindow.active && GraphWindow.activeReference?.scene != null) + GraphUtility.UpdateAllSceneVariables(GraphWindow.activeReference.scene.Value, oldName, newName); else + Debug.LogWarning("[Rename Variables] Could not find valid scene to update variables."); + break; + + case VariableKind.Application: + case VariableKind.Saved: + if (Application.isPlaying) { - Scene? current = null; - for (int i = 0; i < SceneManager.sceneCount; i++) - { - var scene = SceneManager.GetSceneAt(i); - if (!scene.isLoaded) continue; - - var variables = VisualScripting.Variables.Scene(scene); - - if (variables == metadata.parent.value) - { - current = scene; - break; - } - } - - if (current != null) - { - Undo.RecordObject(SceneVariables.Instance(current.Value).variables, "Changed Scene variable name"); - } + Debug.LogWarning($"[Rename Variables] Cannot rename {kind} variables while in play mode!"); + break; } - } - variableDeclarations.EditorRename(declaration, newName); - nameMetadata.value = newName; + bool choice = changed = EditorUtility.DisplayDialog( + $"Update ALL {kind} Variables?", + $"This will go through ALL scenes and macros to find every Variable Unit using '{oldName}' and update it to '{newName}'.\n\nThis operation is FINAL and cannot be undone!", + "Update All", "Rename Only"); - switch (kind) - { - case VariableKind.Flow: - case VariableKind.Graph: - if (EditorWindow.focusedWindow == GraphWindow.active) - GraphUtility.UpdateAllGraphVariables((FlowGraph)GraphWindow.activeContext.graph, oldName, newName); - else if (VariablesWindow.isVariablesWindowContext && VariablesWindow.currentContext != null) - GraphUtility.UpdateAllGraphVariables((FlowGraph)VariablesWindow.currentContext.graph, oldName, newName); - break; - case VariableKind.Object: - { - var ancestor = metadata.Ancestor(m => m.value is VisualScripting.Variables); - if (ancestor != null && ancestor.value != null) - { - var gameObject = (ancestor.value as VisualScripting.Variables).gameObject; - GraphUtility.UpdateAllObjectVariables(gameObject, oldName, newName); - } - else if (EditorWindow.focusedWindow == GraphWindow.active && GraphWindow.activeReference != null) - { - if (GraphWindow.activeReference.gameObject != null) - GraphUtility.UpdateAllObjectVariables(GraphWindow.activeReference.gameObject, oldName, newName); - } - } - break; - case VariableKind.Scene: - { - var ancestor = metadata.Ancestor(m => m.value is VisualScripting.Variables); - if (ancestor != null && ancestor.value != null) - { - var scene = (ancestor.value as VisualScripting.Variables).gameObject.scene; - GraphUtility.UpdateAllSceneVariables(scene, oldName, newName); - } - else if (EditorWindow.focusedWindow == GraphWindow.active && GraphWindow.activeReference != null) - { - if (GraphWindow.activeReference.scene != null) - GraphUtility.UpdateAllSceneVariables(GraphWindow.activeReference.scene.Value, oldName, newName); - else - { - Scene? current = null; - for (int i = 0; i < SceneManager.sceneCount; i++) - { - var scene = SceneManager.GetSceneAt(i); - if (!scene.isLoaded) continue; - - var variables = VisualScripting.Variables.Scene(scene); - - if (variables == metadata.parent.value) - { - current = scene; - break; - } - } - - if (current == null) - { - Debug.LogWarning( - $"[Rename Variables] Could not find the scene that this variable is in please ensure that the scene is valid and loaded." - ); - break; - } - - GraphUtility.UpdateAllSceneVariables(current.Value, oldName, newName); - } - } - } - break; - case VariableKind.Application: - { - if (Application.isPlaying) - { - Debug.LogWarning($"[Rename Variables] Cannot rename all Application variables while in play mode!"); - break; - } - bool choice = changed = EditorUtility.DisplayDialog( - "Update ALL Application Variables?", - "This will go through ALL scenes and macros to find every Variable Unit " - + $"using {oldName} and update it to {newName}.\n\n" - + "This operation is FINAL and cannot be undone!", - "Update All", - "Rename Only" - ); - - if (choice) - { - GraphUtility.RenameApplicationVariables(oldName, newName); - } - } - break; - case VariableKind.Saved: - { - if (Application.isPlaying) - { - Debug.LogWarning($"[Rename Variables] Cannot rename all Saved variables while in play mode!"); - break; - } - bool choice = changed = EditorUtility.DisplayDialog( - "Update ALL Saved Variables?", - "This will go through ALL scenes and macros to find every Variable Unit " - + $"using {oldName} and update it to {newName}.\n\n" - + "This operation is FINAL and cannot be undone!", - "Update All", - "Rename Only" - ); - - if (choice) - { - GraphUtility.RenameSavedVariables(oldName, newName); - } - } - break; - } + if (choice && kind == VariableKind.Application) GraphUtility.RenameApplicationVariables(oldName, newName); + else if (choice && kind == VariableKind.Saved) GraphUtility.RenameSavedVariables(oldName, newName); + break; + } + } + + private void DoCommand(GUIContent command, int itemIndex) + { + if (command == Rename) + { + isRenaming = true; + renameControl = TextControl + (metadata.parent[itemIndex].value as VariableDeclaration).name; + return; } + s_ContextCommandNameFieldInfo.SetValueOptimized(null, command.text); + listControl.DoCommand(command.text, itemIndex, adaptor); + } + + private void AddItemsToMenu(GenericMenu menu, int itemIndex) + { + void Action(object v) => DoCommand(v as GUIContent, itemIndex); + + menu.AddItem(Rename, false, Action, Rename); + menu.AddSeparator(""); + + if (itemIndex > 0) menu.AddItem(CommandMoveToTop, false, Action, CommandMoveToTop); + else menu.AddDisabledItem(CommandMoveToTop); + + if (itemIndex + 1 < metadata.parent.Count) menu.AddItem(CommandMoveToBottom, false, Action, CommandMoveToBottom); + else menu.AddDisabledItem(CommandMoveToBottom); + + menu.AddSeparator(""); + menu.AddItem(CommandDuplicate, false, Action, CommandDuplicate); + + if (menu.GetItemCount() > 0) menu.AddSeparator(""); + + menu.AddItem(CommandRemove, false, Action, CommandRemove); + menu.AddSeparator(""); + menu.AddItem(CommandClearAll, false, Action, CommandClearAll); } public void OnValueGUI(Rect valuePosition) @@ -269,4 +807,5 @@ public static class Styles public static readonly float spacing = EditorGUIUtility.standardVerticalSpacing; } } -} +#endif +} \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationsInpsector.cs b/Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationsInpsector.cs deleted file mode 100644 index 5562cb20..00000000 --- a/Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationsInpsector.cs +++ /dev/null @@ -1,1009 +0,0 @@ -using UnityEditor; -using UnityEngine; -using System; -using System.Collections.Generic; -using System.Reflection; -using Unity.VisualScripting.Community.Libraries.Humility; -using Unity.VisualScripting.ReorderableList; -using Unity.VisualScripting.ReorderableList.Internal; -using UnityEngine.SceneManagement; -using System.Linq; -using System.Text; - -namespace Unity.VisualScripting.Community -{ - public class PatchedVariableDeclarationsInspector : VariableDeclarationsInspector - { - private VariableDeclarationsAdaptor adaptor; - private string newName; - - internal Dictionary foldouts; - - public PatchedVariableDeclarationsInspector(Metadata metadata) : base(metadata) - { - } - - public override void Initialize() - { - base.Initialize(); - - var variableDecls = metadata.value as VariableDeclarations; - - if (variableDecls == null) - return; - - var collection = metadata["collection"]; - - foldouts ??= new Dictionary(); - - foreach (var declaration in variableDecls) - { - if (foldouts.TryGetValue(declaration, out var existing)) - { - existing.name = declaration.name; - foldouts[declaration] = existing; - } - else - { - foldouts[declaration] = new VariableFoldout(declaration.name, false); - } - } - -#pragma warning disable 618 - kind = metadata.GetAttribute()?.kind; -#pragma warning restore 618 -#if VISUAL_SCRIPTING_1_7 - kind ??= variableDecls.Kind; -#endif - adaptor = new VariableDeclarationsAdaptor(collection, this); - } - - protected override void OnGUI(Rect position, GUIContent label) - { - if (metadata.value == null) - return; - - position.x = 0; - if (metadata.parent.definedType == typeof(VisualScripting.Variables)) - { - position.width = LudiqGUIUtility.currentInspectorWidthWithoutScrollbar; - } - - if (EditorPrefs.GetBool(ProjectSettingsProviderView.ShowVariablesQuickbarKey, false) && !metadata.HasAttribute()) - { - DrawQuickAddToolbar(position); - - position.y += (ButtonHeight * 2) + ButtonSpacingY + (ToolbarPadding * 2); - position.height -= (ButtonHeight * 2) + ButtonSpacingY + (ToolbarPadding * 2); - } - - var normal = GUI.backgroundColor; - adaptor.Field(position, label); - // Restore color after tinting add button - GUI.backgroundColor = normal; - - if (metadata.parent.definedType != typeof(VisualScripting.Variables)) - { - position.width -= 1; - } - - var newNamePosition = new Rect(position.x, position.yMax - 20, position.width - Styles.addButtonWidth, 18); - - if (adaptor.Count == 0) - { - newNamePosition.y = position.yMax - 20; - } - - newNamePosition.height += 1; - OnNewNameGUI(newNamePosition); - } - - private static readonly GUIContent[] quickTypesLabels = - { - new GUIContent("Float", typeof(float).Icon()[IconSize.Small]), new GUIContent("Int", typeof(int).Icon()[IconSize.Small]), new GUIContent("Bool", typeof(bool).Icon()[IconSize.Small]), - new GUIContent("String", typeof(string).Icon()[IconSize.Small]), - new GUIContent("Vector", typeof(Vector4).Icon()[IconSize.Small]), new GUIContent("Color", typeof(Color).Icon()[IconSize.Small]), new GUIContent("Object", typeof(GameObject).Icon()[IconSize.Small]), - new GUIContent("Other", typeof(Generic).Icon()[IconSize.Small]) - }; - - private static readonly string[] quickTypes = { "Float", "Int", "Bool", "String", "Vector", "Color", "Object", "Other" }; - - private const float Spacing = 4f; - private const float ButtonHeight = 27f; - private const float ButtonSpacingX = 4f; - private const float ButtonSpacingY = 4f; - private const float CornerRadius = 10f; - private const float ToolbarPadding = 6f; - - private void DrawQuickAddToolbar(Rect position) - { - int columns = 4; - int rows = 2; - float totalHeight = (ButtonHeight * rows) + ButtonSpacingY + (ToolbarPadding * 2); - Rect toolbarRect = new Rect(position.x, position.y, position.width, totalHeight); -#if DARKER_UI - EditorGUI.DrawRect(toolbarRect, CommunityStyles.backgroundColor); -#else - EditorGUI.DrawRect(toolbarRect, ColorPalette.unityBackgroundLight); -#endif - float availableWidth = toolbarRect.width - ToolbarPadding * 2; - - float totalSpacingX = ButtonSpacingX * (columns - 1); - float buttonWidthAdjusted = (availableWidth - totalSpacingX) / columns; - - float xStart = toolbarRect.x + ToolbarPadding; - float yStart = toolbarRect.y + ToolbarPadding; - - for (int i = 0; i < quickTypesLabels.Length; i++) - { - int row = i / columns; - int col = i % columns; - - float x = xStart + col * (buttonWidthAdjusted + ButtonSpacingX); - float y = yStart + row * (ButtonHeight + ButtonSpacingY); - - Rect buttonRect = new Rect(x, y, buttonWidthAdjusted, ButtonHeight); - - if (DrawRoundedButton(buttonRect, quickTypesLabels[i], out var mouse)) - { - bool isRight = mouse == MouseButton.Right; - switch (quickTypes[i]) - { - case "Float": - { - var menu = new GenericMenu(); - menu.AddItem(new GUIContent("float"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(float), true)); - menu.AddItem(new GUIContent("double"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(double), true)); - menu.AddItem(new GUIContent("decimal"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(decimal), true)); - menu.DropDown(buttonRect); - break; - } - - case "Int": - { - var menu = new GenericMenu(); - menu.AddItem(new GUIContent("int"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(int))); - menu.AddItem(new GUIContent("short"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(short), true)); - menu.AddItem(new GUIContent("long"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(long), true)); - menu.AddItem(new GUIContent("byte"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(byte), true)); - menu.AddItem(new GUIContent("sbyte"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(sbyte), true)); - menu.AddSeparator(""); - menu.AddItem(new GUIContent("uint"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(uint), true)); - menu.AddItem(new GUIContent("ushort"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(ushort), true)); - menu.AddItem(new GUIContent("ulong"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(ulong), true)); - menu.DropDown(buttonRect); - break; - } - - case "String": - AddQuickVariable(isRight ? typeof(List) : typeof(string), true); - break; - - case "Bool": - AddQuickVariable(isRight ? typeof(List) : typeof(bool), true); - break; - - case "Vector": - { - var menu = new GenericMenu(); - menu.AddItem(new GUIContent("Vector 2"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Vector2), true)); - menu.AddItem(new GUIContent("Vector 3"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Vector3), true)); - menu.AddItem(new GUIContent("Vector 4"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Vector4), true)); - menu.AddSeparator(""); - menu.AddItem(new GUIContent("Vector 2 Int"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Vector2Int), true)); - menu.AddItem(new GUIContent("Vector 3 Int"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Vector3Int), true)); - menu.DropDown(buttonRect); - break; - } - - case "Color": - { - var menu = new GenericMenu(); - menu.AddItem(new GUIContent("Color"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Color))); - menu.AddItem(new GUIContent("HDRColor"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(HDRColor), true)); - menu.AddItem(new GUIContent("Gradient"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Gradient), true)); - menu.DropDown(buttonRect); - break; - } - - case "Object": - AddQuickVariable(isRight ? typeof(List) : typeof(GameObject), true); - break; - - case "Other": - TypeBuilderWindow.ShowWindow(buttonRect, (t) => - { - bool ask = false; - if (e.shift) - { - ask = true; - } - AddQuickVariable(t, ask); - }, typeof(object), true, Array.Empty()); - break; - } - } - } - } - - private static GUIStyle _labelStyle; - - private static GUIStyle labelStyle - { - get - { - _labelStyle ??= new GUIStyle(EditorStyles.label) - { - border = new RectOffset((int)CornerRadius, (int)CornerRadius, (int)CornerRadius, (int)CornerRadius), - padding = new RectOffset(4, 4, 2, 2), - alignment = TextAnchor.MiddleLeft, - normal = { textColor = !EditorGUIUtility.isProSkin ? Color.black : Color.white } - }; - - return _labelStyle; - } - } - - private static bool DrawRoundedButton(Rect rect, GUIContent content, out MouseButton? mouseButton) - { - var e = Event.current; - - bool containsMouse = e != null && rect.Contains(e.mousePosition); - bool isClick = containsMouse && e.type == EventType.MouseDown && e.button == 0; - - bool isRightClick = containsMouse && e.type == EventType.MouseDown && e.button == 1; - - var previous = EditorGUIUtility.GetIconSize(); - - EditorGUIUtility.SetIconSize(new Vector2(16, 16)); - - var color = Color.gray.Brighten(0.1f); - - if (isClick || isRightClick) - { - color = CommunityStyles.backgroundColor; - } - else if (containsMouse) - { - color = CommunityStyles.backgroundColor.Brighten(0.3f); - } - - LudiqGUI.DrawEmptyRect(rect, color); - - EditorGUI.LabelField(rect, content, labelStyle); - - EditorGUIUtility.SetIconSize(previous); - - var texRect = new Rect(rect.xMax - 14, rect.y + 9, EditorGUIUtility.isProSkin ? 8 : 10, 10); - GUI.DrawTexture(texRect, ReorderableListResources.GetTexture(ReorderableListTexture.Icon_Add_Normal)); - - if (isClick) - { - mouseButton = MouseButton.Left; - e.Use(); - return true; - } - else if (isRightClick) - { - mouseButton = MouseButton.Right; - e.Use(); - return true; - } - - mouseButton = null; - return false; - } - - private void AddQuickVariable(Type type, bool ask = false) - { - string typeKey = Application.dataPath + $"_Community_ShowTypePopup_{type.AssemblyQualifiedName}"; - - bool hasSeenPopup = EditorPrefs.GetBool(typeKey, false); - - if (ask && !Codebase.settingsTypes.Contains(type) && !hasSeenPopup) - { - int choice = EditorUtility.DisplayDialogComplex( - "Add Type to Settings", - $"The type '{type.As().CSharpName(false, false, false)}' is not currently in your settings types.\n\nWould you like to add it?", - "Add", - "No", - "Add && Regenerate" - ); - - var coreConfig = BoltCore.Configuration; - - switch (choice) - { - case 0: - coreConfig.typeOptions.Add(type); - SaveCoreConfig(coreConfig); - Codebase.UpdateSettings(); - break; - - case 1: - break; - - case 2: - coreConfig.typeOptions.Add(type); - SaveCoreConfig(coreConfig); - Codebase.UpdateSettings(); - UnitBase.Rebuild(); - break; - } - - EditorPrefs.SetBool(typeKey, true); - } - - var variableDecls = (VariableDeclarations)metadata.value; - - var collection = (VariableDeclarationCollection)metadata["collection"].value; - - string baseName = type.HumanName(false); - string newVarName = baseName; - int counter = 1; - - while (variableDecls.IsDefined(newVarName)) - { - newVarName = $"{baseName} ({counter++})"; - } - - var newVar = new VariableDeclaration(newVarName, Default(type)); -#if VISUAL_SCRIPTING_1_7 - newVar.typeHandle = new SerializableType(type.AssemblyQualifiedName); -#endif - collection.Add(newVar); - - metadata.RecordUndo(); - - foldouts[newVar] = new VariableFoldout(newVarName, true); - - SetHeightDirty(); - } - - private object Default(Type type) - { - var value = type.PseudoDefault(); - - if (value == null && type == typeof(Gradient)) return new Gradient(); - return value; - } - - private void SaveCoreConfig(BoltCoreConfiguration coreConfig) - { - var metadata = coreConfig.GetMetadata(nameof(coreConfig.typeOptions)); - - metadata.Inspector().SetHeightDirty(); -#if VISUAL_SCRIPTING_1_9_0_OR_GREATER - metadata.GetType() - .GetMethod("SaveImmediately", BindingFlags.Instance | BindingFlags.NonPublic) - .Invoke(metadata, new object[] { true }); -#else - metadata.Save(); -#endif - } - - private bool highlightPlaceholder; - private bool highlightNewNameField; - private const string newNameFieldControl = "Community_Variables_newNameField"; - - private void OnNewNameGUI(Rect newNamePosition) - { - EditorGUI.BeginChangeCheck(); - - GUI.SetNextControlName(newNameFieldControl); - newName = EditorGUI.TextField(newNamePosition, newName, highlightNewNameField ? Styles.newNameFieldHighlighted : Styles.newNameField); - - var e = UnityEngine.Event.current; - if (GUI.GetNameOfFocusedControl() == newNameFieldControl && e.type == EventType.KeyUp && e.keyCode == KeyCode.Return) - { - adaptor.Add(); - GUI.FocusControl(newNameFieldControl); - GUI.changed = true; - } - - if (EditorGUI.EndChangeCheck()) - { - highlightNewNameField = false; - highlightPlaceholder = false; - } - - if (string.IsNullOrEmpty(newName)) - { - GUI.Label(newNamePosition, "(New Variable Name)", highlightPlaceholder ? Styles.placeholderHighlighted : Styles.placeholder); - } - } - - protected override float GetHeight(float width, GUIContent label) - { - return adaptor.GetHeight(width, label) + (EditorPrefs.GetBool(ProjectSettingsProviderView.ShowVariablesQuickbarKey, false) && !metadata.HasAttribute() ? (ButtonHeight * 2) + ButtonSpacingY + (ToolbarPadding * 2) : 0); - } - - public class VariableDeclarationsAdaptor : MetadataListAdaptor, IReorderableListDropTarget - { - private const float FoldoutHeight = 30f; - private const float FieldHeight = 18f; - private const float VerticalSpacing = 4f; - private const float DeleteButtonWidth = 18f; - - public ReorderableListControl listControl; - private static readonly FieldInfo listControlFieldInfo = typeof(MetadataCollectionAdaptor).GetField("listControl", BindingFlags.NonPublic | BindingFlags.Instance); - - private static Type InternalListAdaptorType = typeof(VariableDeclarationsInspector).GetNestedType("ListAdaptor", BindingFlags.NonPublic); - - public new readonly PatchedVariableDeclarationsInspector parentInspector; - - public VariableDeclarationsAdaptor(Metadata metadata, PatchedVariableDeclarationsInspector parent) : base(metadata, parent) - { - parentInspector = parent; - - if (listControlFieldInfo != null) - { - listControl = listControlFieldInfo.GetValue(this) as ReorderableListControl; - if (listControl != null) - { - listControl.ContainerStyle = GUIStyle.none; - listControl.Flags = ReorderableListFlags.HideRemoveButtons; - listControl.HorizontalLineColor = EditorGUIUtility.isProSkin ? Color.black : Color.white; - listControl.HorizontalLineAtStart = true; - listControl.HorizontalLineAtEnd = true; - } - } - - alwaysDragAndDrop = true; - } - - protected override bool CanDrop(object item) - { - var variableDeclaration = (VariableDeclaration)item; - - if (((VariableDeclarations)parentInspector.metadata.value).IsDefined(variableDeclaration.name)) - { - EditorUtility.DisplayDialog("Dragged Variable", "A variable with the same name already exists.", "OK"); - return false; - } - - return base.CanDrop(item); - } - -#if DARKER_UI - // I have to do this setup to change the color of the add button - // It's very hacky but seems to work better than tinting the background Texture. - private Color _previousBackgroundColor; - private bool _tintApplied; - private bool initialized; - /// - /// Called before list elements are drawn. - /// Ensures the GUI color is reset properly. - /// - public override void BeginGUI() - { - if (_tintApplied) - { - GUI.backgroundColor = _previousBackgroundColor; - _tintApplied = false; - } - - if (initialized) - { - return; - } - - initialized = true; - - for (int i = 0; i < (metadata.value as VariableDeclarationCollection).Count; i++) - { - var element = metadata[i]; - var valueMetadata = element["value"]; - - var inspector = valueMetadata.Inspector(); - try - { - var valueInspector = typeof(SystemObjectInspector).GetField("inspector", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(inspector); - valueInspector.GetType().GetMethod("ResolveType", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(valueInspector, Array.Empty()); - } - catch { } - } - } - - /// - /// Called after all list elements are drawn but before drawing the Add Item button. - /// Tints the Add button only. - /// - public override void EndGUI() - { - _previousBackgroundColor = GUI.backgroundColor; - GUI.backgroundColor = CommunityStyles.backgroundColor.Brighten(0.36f); - _tintApplied = true; - } -#endif - public override float GetItemHeight(float width, int index) - { - var element = metadata[index]; - var declaration = (VariableDeclaration)element.value; - - if (!parentInspector.foldouts.TryGetValue(declaration, out var foldout)) - { - foldout = new VariableFoldout(declaration.name, false); - parentInspector.foldouts[declaration] = foldout; - } - - if (!foldout.isExpanded) - return FoldoutHeight + VerticalSpacing; - - var valueHeight = LudiqGUI.GetInspectorHeight(parentInspector, element["value"], width, GUIContent.none); - float h = FoldoutHeight + valueHeight + 6f; - - return h; - } - - public override void DrawItemBackground(Rect position, int index) - { -#if DARKER_UI - EditorGUI.DrawRect(position, CommunityStyles.backgroundColor); -#else - EditorGUI.DrawRect(position, ColorPalette.unityBackgroundLight); -#endif - - var restoredColor = Handles.color; - Handles.color = Color.gray * 0.6f; - Handles.DrawAAPolyLine(2f, new Vector3[] - { - new Vector3(position.x, position.y + 1), - new Vector3(position.xMax, position.y + 1), - new Vector3(position.xMax, position.yMax), - new Vector3(position.x, position.yMax), - new Vector3(position.x, position.y) - }); - Handles.color = restoredColor; - } - - private HashSet updatedInspectors = new HashSet(); - - public override void DrawItem(Rect position, int index) - { - var element = metadata[index]; - var declaration = (VariableDeclaration)element.value; - - if (!parentInspector.foldouts.TryGetValue(declaration, out var foldout)) - { - foldout = new VariableFoldout(declaration.name, false); - parentInspector.foldouts[declaration] = foldout; - } - - GraphReference reference = null; - UnityEngine.Object root = null; - Guid[] parentGuids = null; - - if (VariablesWindow.isVariablesWindowContext) - { - reference = VariablesWindow.currentContext?.reference; - root = reference?.rootObject; - parentGuids = reference?.parentElementGuids?.ToArray(); - } - else - { - reference = LudiqGraphsEditorUtility.editedContext?.value?.reference; - root = reference?.rootObject; - parentGuids = reference?.parentElementGuids?.ToArray(); - } - - var ancestor = metadata.Ancestor(m => m.value is VisualScripting.Variables); - if (ancestor != null) - { - if (ancestor != null) - { - root = ancestor.value as VisualScripting.Variables; - } - parentGuids = new Guid[0]; - } - - if (parentInspector.kind == VariableKind.Application) - { - root = ApplicationVariables.asset; - parentGuids = new Guid[0]; - } - else if (parentInspector.kind == VariableKind.Saved) - { - root = SavedVariables.asset; - parentGuids = new Guid[0]; - } - - if (root != null && updatedInspectors.Add(declaration)) - { - foldout.isExpanded = VariableInspectorState.Load(root, parentGuids, declaration.name); - } - - position.x -= 20; - position.width += 20; - - var oldHandleRect = new Rect(position.x + 4, position.y + position.height / 2f - 3, 9, 7); -#if DARKER_UI - EditorGUI.DrawRect(oldHandleRect, CommunityStyles.backgroundColor); -#else - EditorGUI.DrawRect(oldHandleRect, ColorPalette.unityBackgroundLight); -#endif - - float y = position.y + 2f; - Rect boxRect = new Rect(position.x, y, position.width, GetItemHeight(index)); - float lineY = boxRect.y + ((FoldoutHeight - 16f) / 2f) + Spacing - 2; - - float handleSize = 12f; - Rect handleRect = new Rect(position.x + 2, lineY, handleSize, handleSize); - GUI.DrawTexture(handleRect, CommunityStyles.DragHandleTexture); - EditorGUIUtility.AddCursorRect(handleRect, MouseCursor.Pan); - - Rect foldoutRect = new Rect(handleRect.x + handleRect.width + Spacing, lineY, 14, 16); - Texture2D arrow = foldout.isExpanded ? CommunityStyles.ArrowDownTexture : CommunityStyles.ArrowRightTexture; - if (arrow) GUI.DrawTexture(foldoutRect, arrow, ScaleMode.ScaleToFit); - - if (Event.current.type == EventType.MouseDown && foldoutRect.Contains(Event.current.mousePosition)) - { - foldout.isExpanded = !foldout.isExpanded; - parentInspector.foldouts[declaration] = foldout; - Event.current.Use(); - if (root != null) - VariableInspectorState.Save(root, parentGuids, declaration.name, foldout.isExpanded); - } - - var e = Event.current; - - bool draggingObjects = (DragAndDrop.objectReferences != null && DragAndDrop.objectReferences.Length > 0) || - DragAndDrop.GetGenericData(VisualScripting.DraggedListItem.TypeName) != null || - DragAndDrop.GetGenericData(DraggedDictionaryItem.TypeName) != null; - - if (e != null && draggingObjects && e.type == EventType.MouseDrag && e.button == (int)MouseButton.Left && boxRect.Contains(e.mousePosition)) - { - const float expandDelay = 0.35f; - if (!foldout.hoverStartTime.HasValue) - foldout.hoverStartTime = EditorApplication.timeSinceStartup; - - if (EditorApplication.timeSinceStartup - foldout.hoverStartTime.Value > expandDelay) - { - foldout.isExpanded = true; - parentInspector.foldouts[declaration] = foldout; - if (root != null) - VariableInspectorState.Save(root, parentGuids, declaration.name, true); - } - - parentInspector.SetHeightDirty(); - GUI.changed = true; - } - else - { - foldout.hoverStartTime = null; - } -#if !VISUAL_SCRIPTING_1_7 - var iconPosition = new Rect(foldoutRect.x + 15f, foldoutRect.y - 2, FieldHeight, FieldHeight); - var icon = element["value"].value?.GetType().Icon()?[IconSize.Small]; - if (icon == null) - { - icon = typeof(Null).Icon()?[IconSize.Small]; - } - GUI.DrawTexture(iconPosition, icon, ScaleMode.ScaleToFit); -#endif - float spacing = 4f; - float startX = foldoutRect.xMax + spacing; - float endX = position.x + position.width - DeleteButtonWidth - spacing; - float totalAvailable = endX - startX; -#if VISUAL_SCRIPTING_1_7 - float halfWidth = (totalAvailable - spacing) / 2f; - - Rect nameRect = new Rect(startX, lineY - 2f, halfWidth, FieldHeight); - Rect typeRect = new Rect(nameRect.xMax + spacing, lineY - 2f, halfWidth, FieldHeight); -#else - Rect nameRect = new Rect(startX + iconPosition.width, lineY - 2f, totalAvailable - spacing - iconPosition.width, FieldHeight); -#endif - OnNameGUI(nameRect, element["name"]); -#if VISUAL_SCRIPTING_1_7 - using (adaptiveWidth.Override(true)) // Hide the Type label - { - var typeInspector = element["typeHandle"].Inspector(); - typeInspector.Draw(typeRect, GUIContent.none); - } -#endif - Rect deleteRect = new Rect(position.x + position.width - DeleteButtonWidth - 4, lineY - 2f, DeleteButtonWidth, FieldHeight); - if (GUI.Button(deleteRect, "", new GUIStyle(EditorStyles.whiteLabel) - { - normal = { background = CommunityStyles.RemoveItemTexture } - })) - { - Remove(index); - return; - } - - if (foldout.isExpanded) - { - var valueInspector = element["value"].Inspector(); - float contentY = boxRect.y + FoldoutHeight; - EditorGUI.indentLevel++; - var width = position.width - DeleteButtonWidth - 8; - valueInspector.Draw( - new Rect(position.x + 20, contentY, width, - LudiqGUI.GetInspectorHeight(parentInspector, element["value"], width, GUIContent.none)), - GUIContent.none - ); - EditorGUI.indentLevel--; - } - - HandleDragAndDrop(position, handleRect, index, declaration, foldout); - } - - private void HandleDragAndDrop(Rect position, Rect handleRect, int index, VariableDeclaration declaration, VariableFoldout foldout) - { - int controlID = GUIUtility.GetControlID(FocusType.Passive); - var e = Event.current; - - switch (e.GetTypeForControl(controlID)) - { - case EventType.MouseDown: - if (e.button == (int)MouseButton.Left && position.Contains(e.mousePosition) && !handleRect.Contains(Event.current.mousePosition)) - { - GUIUtility.hotControl = controlID; - e.Use(); - } - break; - - case EventType.MouseDrag: - if (GUIUtility.hotControl == controlID) - { - var item = this[index]; - - var list = InternalListAdaptorType.Instantiate(false, metadata, parentInspector) as MetadataListAdaptor; - - GUIUtility.hotControl = 0; - DragAndDrop.PrepareStartDrag(); - DragAndDrop.objectReferences = new UnityEngine.Object[0]; - DragAndDrop.paths = new string[0]; - DragAndDrop.SetGenericData( - VisualScripting.DraggedListItem.TypeName, - new DraggedListItem(list, index, item, (declaration, foldout)) - ); - DragAndDrop.StartDrag(metadata.path); - e.Use(); - } - break; - } - } - - public override void Remove(int index) - { - var declaration = (VariableDeclaration)metadata[index].value; - - parentInspector.foldouts?.Remove(declaration); - - base.Remove(index); - GUIUtility.keyboardControl = 0; - GUIUtility.hotControl = 0; - EditorGUIUtility.editingTextField = false; - GUIUtility.ExitGUI(); - } - - public void OnNameGUI(Rect namePosition, Metadata nameMetadata) - { - namePosition = BeginLabeledBlock(nameMetadata, namePosition, GUIContent.none); - var restoreColor = GUI.backgroundColor; -#if DARKER_UI - GUI.backgroundColor = EditorGUIUtility.isProSkin ? restoreColor.Darken(0.25f) : restoreColor; -#endif - var oldName = (string)nameMetadata.value; - var newName = EditorGUI.DelayedTextField(namePosition, (string)nameMetadata.value, new GUIStyle(EditorStyles.textField) { fontStyle = FontStyle.Bold }); - GUI.backgroundColor = restoreColor; - - if (EndBlock(nameMetadata)) - { - var variableDeclarations = (VariableDeclarationCollection)metadata.value; - var declaration = (VariableDeclaration)nameMetadata.parent.value; - - if (StringUtility.IsNullOrWhiteSpace(newName)) - { - EditorUtility.DisplayDialog("Edit Variable Name", "Please enter a variable name.", "OK"); - return; - } - else if (variableDeclarations.Contains(newName)) - { - EditorUtility.DisplayDialog("Edit Variable Name", "A variable with the same name already exists.", "OK"); - return; - } - - nameMetadata.RecordUndo(); - if (parentInspector.kind == VariableKind.Scene) - { - if (GraphWindow.active != null && GraphWindow.activeReference?.scene != null) - Undo.RecordObject(SceneVariables.Instance(GraphWindow.activeReference.scene.Value).variables, "Changed Scene variable name"); - else - { - Scene? current = null; - for (int i = 0; i < SceneManager.sceneCount; i++) - { - var scene = SceneManager.GetSceneAt(i); - if (!scene.isLoaded) continue; - - var variables = VisualScripting.Variables.Scene(scene); - - if (variables == metadata.parent.value) - { - current = scene; - break; - } - } - - if (current != null) - { - Undo.RecordObject(SceneVariables.Instance(current.Value).variables, "Changed Scene variable name"); - } - } - } - variableDeclarations.EditorRename(declaration, newName); - (parentInspector.metadata.value as VariableDeclarations).Set(newName, declaration.value); - nameMetadata.value = newName; - - switch (parentInspector.kind) - { - case VariableKind.Graph: - if (EditorWindow.focusedWindow == GraphWindow.active) - GraphUtility.UpdateAllGraphVariables((FlowGraph)GraphWindow.activeContext.graph, oldName, newName); - else if (VariablesWindow.isVariablesWindowContext && VariablesWindow.currentContext != null) - GraphUtility.UpdateAllGraphVariables((FlowGraph)VariablesWindow.currentContext.graph, oldName, newName); - break; - case VariableKind.Object: - { - var ancestor = metadata.Ancestor(m => m.value is VisualScripting.Variables); - if (ancestor != null && ancestor.value != null) - { - var gameObject = (ancestor.value as VisualScripting.Variables).gameObject; - GraphUtility.UpdateAllObjectVariables(gameObject, oldName, newName); - } - else if (EditorWindow.focusedWindow == GraphWindow.active && GraphWindow.activeReference != null) - { - if (GraphWindow.activeReference.gameObject != null) - GraphUtility.UpdateAllObjectVariables(GraphWindow.activeReference.gameObject, oldName, newName); - } - } - break; - case VariableKind.Scene: - { - var ancestor = metadata.Ancestor(m => m.value is VisualScripting.Variables); - if (ancestor != null && ancestor.value != null) - { - var scene = (ancestor.value as VisualScripting.Variables).gameObject.scene; - GraphUtility.UpdateAllSceneVariables(scene, oldName, newName); - } - else if (EditorWindow.focusedWindow == GraphWindow.active && GraphWindow.activeReference != null) - { - if (GraphWindow.activeReference.scene != null) - GraphUtility.UpdateAllSceneVariables(GraphWindow.activeReference.scene.Value, oldName, newName); - else - { - Scene? current = null; - for (int i = 0; i < SceneManager.sceneCount; i++) - { - var scene = SceneManager.GetSceneAt(i); - if (!scene.isLoaded) continue; - - var variables = VisualScripting.Variables.Scene(scene); - - if (variables == metadata.parent.value) - { - current = scene; - break; - } - } - - if (current == null) - { - Debug.LogWarning( - $"[Rename Variables] Could not find the scene that this variable is in please ensure that the scene is valid and loaded." - ); - break; - } - - GraphUtility.UpdateAllSceneVariables(current.Value, oldName, newName); - } - } - } - break; - case VariableKind.Application: - { - if (Application.isPlaying) - { - Debug.LogWarning($"[Rename Variables] Cannot rename all Application variables while in play mode!"); - break; - } - bool choice = EditorUtility.DisplayDialog( - "Update ALL Application Variables?", - "This will go through ALL scenes and macros to find every Variable Unit " - + $"using {oldName} and update it to {newName}.\n\n" - + "This operation is FINAL and cannot be undone!", - "Update All", - "Rename Only" - ); - - if (choice) - { - GraphUtility.RenameApplicationVariables(oldName, newName); - } - } - break; - case VariableKind.Saved: - { - if (Application.isPlaying) - { - Debug.LogWarning($"[Rename Variables] Cannot rename all Saved variables while in play mode!"); - break; - } - bool choice = EditorUtility.DisplayDialog( - "Update ALL Saved Variables?", - "This will go through ALL scenes and macros to find every Variable Unit " - + $"using {oldName} and update it to {newName}.\n\n" - + "This operation is FINAL and cannot be undone!", - "Update All", - "Rename Only" - ); - - if (choice) - { - GraphUtility.RenameSavedVariables(oldName, newName); - } - } - break; - } - } - } - - protected override bool CanAdd() - { - if (StringUtility.IsNullOrWhiteSpace(parentInspector.newName)) - { - parentInspector.highlightPlaceholder = true; - EditorUtility.DisplayDialog("New Variable", "Please enter a variable name.", "OK"); - return false; - } - else if (((VariableDeclarations)parentInspector.metadata.value).IsDefined(parentInspector.newName)) - { - parentInspector.highlightNewNameField = true; - EditorUtility.DisplayDialog("New Variable", "A variable with the same name already exists.", "OK"); - return false; - } - - return true; - } - - protected override object ConstructItem() - { - var newItem = new VariableDeclaration(parentInspector.newName, null); - parentInspector.newName = null; - parentInspector.highlightPlaceholder = false; - parentInspector.highlightNewNameField = false; - return newItem; - } - - public new void ProcessDropInsertion(int insertionIndex) - { - if (Event.current.type == EventType.DragPerform) - { - var draggedItem = DragAndDrop.GetGenericData(VisualScripting.DraggedListItem.TypeName) as DraggedListItem; - - if (draggedItem != null) - { - if (InternalListAdaptorType.GetField("parentInspector", BindingFlags.Instance | BindingFlags.Public).GetValue(draggedItem.sourceListAdaptor) != parentInspector) - { - if (!CanDrop(draggedItem.item)) - return; - - parentInspector.foldouts ??= new Dictionary(); - - parentInspector.foldouts[draggedItem.variableState.Item1] = draggedItem.variableState.Item2; - } - else - { - Move(draggedItem.index, insertionIndex); - return; - } - } - } - - base.ProcessDropInsertion(insertionIndex); - } - } - } -} diff --git a/Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationsInspector.cs b/Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationsInspector.cs new file mode 100644 index 00000000..27f8e17e --- /dev/null +++ b/Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationsInspector.cs @@ -0,0 +1,437 @@ +using UnityEditor; +using UnityEngine; +using System; +using System.Collections.Generic; +using System.Reflection; +using Unity.VisualScripting.Community.Libraries.Humility; +using Unity.VisualScripting.ReorderableList.Internal; +using Unity.VisualScripting.ReorderableList; +using System.IO; + +namespace Unity.VisualScripting.Community +{ + public class PatchedVariableDeclarationsInspector : VariableDeclarationsInspector + { + private static class Layout + { + public const float Spacing = 4f; + public const float ButtonHeight = 27f; + public const float ButtonSpacingX = 4f; + public const float ButtonSpacingY = 4f; + public const float CornerRadius = 10f; + public const float ToolbarPadding = 6f; + public const int QuickAddColumns = 4; + public const int QuickAddRows = 2; + public const int TitleHeight = 20; + } + + private const string NewVariableString = "newVariable"; + private const string QuickTypeTooltip = "Left-Click: Add single type\nRight-Click: Add List"; + private const string QuickOtherTypeTooltip = "Left-Click: Add single type\nHold Shift when pressing the Create Type button: Prompt to add to settings & regenerate"; + + internal string newName; + internal bool addedItem; + internal VariableDeclaration addedDeclaration; + public ReorderableListControl listControl { get; private set; } + + // Reflection Caching + private static readonly FieldInfo AdaptorField = typeof(VariableDeclarationsInspector).GetField("adaptor", BindingFlags.Instance | BindingFlags.NonPublic); + private static readonly FieldInfo NewNameField = typeof(VariableDeclarationsInspector).GetField("newName", BindingFlags.Instance | BindingFlags.NonPublic); + private static readonly MethodInfo AdaptorFieldMethod = typeof(MetadataCollectionAdaptor).GetMethod("Field", BindingFlags.Instance | BindingFlags.Public); + private static readonly FieldInfo listControlFieldInfo = typeof(MetadataCollectionAdaptor).GetField("listControl", BindingFlags.NonPublic | BindingFlags.Instance); + + private static readonly IOptimizedInvoker adaptorFieldMethodInvoker; + internal static readonly IOptimizedAccessor adaptorFieldAccessor; + private static readonly IOptimizedAccessor newNameFieldAccessor; + + static PatchedVariableDeclarationsInspector() + { + adaptorFieldMethodInvoker = AdaptorFieldMethod.Prewarm(); + adaptorFieldAccessor = AdaptorField.Prewarm(); + newNameFieldAccessor = NewNameField.Prewarm(); + } + + public PatchedVariableDeclarationsInspector(Metadata metadata) : base(metadata) { } + + public override void Initialize() + { + base.Initialize(); + + var adaptor = (MetadataListAdaptor)adaptorFieldAccessor.GetValue(this); + + if (listControlFieldInfo != null) + { + listControl = listControlFieldInfo.GetValueOptimized(adaptor) as ReorderableListControl; + + if (listControl != null) + { + listControl.Flags = ReorderableListFlags.HideAddButton | ReorderableListFlags.DisableContextMenu; + listControl.AddMenuClicked += (sender, args) => + { + LudiqGUI.FuzzyDropdown(args.ButtonPosition, GetOptions(), typeof(object), (option) => + { + addedDeclaration = Add(OperateOnString(NewVariableString), option as Type); + addedItem = true; + }); + }; + } + } + } + + private IFuzzyOptionTree GetOptions() => new TypeOptionTree(Codebase.GetTypeSet(TypeSet.SettingsTypes), TypeFilter.Any); + + public VariableDeclaration Add(string name, Type type) + { + var adaptor = (MetadataListAdaptor)adaptorFieldAccessor.GetValue(this); + + newNameFieldAccessor.SetValue(this, name); + adaptor.Add(); + GUI.changed = true; + + var collection = metadata["collection"]; + var newElement = collection[collection.Count - 1]; + newElement["name"].value = name; + newElement["value"].value = type.PseudoDefault(); + + var declaration = (VariableDeclaration)newElement.value; +#if VISUAL_SCRIPTING_1_7 + newElement["typeHandle"].value = new SerializableType(type.AssemblyQualifiedName); +#endif + return declaration; + } + + private string OperateOnString(string requestedName) + { + var declarations = metadata.value as VariableDeclarations; + string baseName = string.IsNullOrEmpty(requestedName) ? "Unnamed Variable" : requestedName; + string resolvedName = baseName; + + int counter = 1; + while (declarations.IsDefined(resolvedName)) + { + resolvedName = $"{baseName} ({counter++})"; + } + + return resolvedName; + } + + protected override float GetHeight(float width, GUIContent label) + { + float height = base.GetHeight(width, label); + + if (EditorPrefs.GetBool(ProjectSettingsProviderView.ShowVariablesQuickbarKey, false) && !metadata.HasAttribute()) + { + height += (Layout.ButtonHeight * 2) + Layout.ButtonSpacingY + (Layout.ToolbarPadding * 2); + } + + return height + Layout.TitleHeight; + } + + protected override void OnGUI(Rect position, GUIContent label) + { + if (metadata.value == null) return; + + position.x = 0; + + if (EditorPrefs.GetBool(ProjectSettingsProviderView.ShowVariablesQuickbarKey, false) && !metadata.HasAttribute()) + { + DrawQuickAddToolbar(position); + + float offset = (Layout.ButtonHeight * 2) + Layout.ButtonSpacingY + (Layout.ToolbarPadding * 2); + position.y += offset; + position.height -= offset; + } + + position.height = base.GetHeight(position.width, label) + 20; + + adaptorFieldMethodInvoker.Invoke(adaptorFieldAccessor.GetValue(this), position, new GUIContent("Variables")); + } + + private static readonly GUIContent[] quickTypesLabels = + { + new GUIContent("Float", typeof(float).Icon()[IconSize.Small], QuickTypeTooltip), + new GUIContent("Int", typeof(int).Icon()[IconSize.Small], QuickTypeTooltip), + new GUIContent("Bool", typeof(bool).Icon()[IconSize.Small], QuickTypeTooltip), + new GUIContent("String", typeof(string).Icon()[IconSize.Small], QuickTypeTooltip), + new GUIContent("Vector", typeof(Vector4).Icon()[IconSize.Small], QuickTypeTooltip), + new GUIContent("Color", typeof(Color).Icon()[IconSize.Small], QuickTypeTooltip), + new GUIContent("Object", typeof(GameObject).Icon()[IconSize.Small], QuickTypeTooltip), + new GUIContent("Other", typeof(Generic).Icon()[IconSize.Small], QuickOtherTypeTooltip) + }; + + private void DrawQuickAddToolbar(Rect position) + { + float totalHeight = (Layout.ButtonHeight * Layout.QuickAddRows) + Layout.ButtonSpacingY + (Layout.ToolbarPadding * 2); + Rect toolbarRect = new Rect(position.x, position.y, position.width, totalHeight); +#if DARKER_UI + EditorGUI.DrawRect(toolbarRect, CommunityStyles.backgroundColor); +#else + EditorGUI.DrawRect(toolbarRect, ColorPalette.unityBackgroundLight); +#endif + float availableWidth = toolbarRect.width - Layout.ToolbarPadding * 2; + float totalSpacingX = Layout.ButtonSpacingX * (Layout.QuickAddColumns - 1); + float buttonWidthAdjusted = (availableWidth - totalSpacingX) / Layout.QuickAddColumns; + + float xStart = toolbarRect.x + Layout.ToolbarPadding; + float yStart = toolbarRect.y + Layout.ToolbarPadding; + + for (int i = 0; i < quickTypesLabels.Length; i++) + { + int row = i / Layout.QuickAddColumns; + int col = i % Layout.QuickAddColumns; + + float x = xStart + col * (buttonWidthAdjusted + Layout.ButtonSpacingX); + float y = yStart + row * (Layout.ButtonHeight + Layout.ButtonSpacingY); + + Rect buttonRect = new Rect(x, y, buttonWidthAdjusted, Layout.ButtonHeight); + + if (DrawAddButton(buttonRect, quickTypesLabels[i], out var mouse)) + { + bool isRight = mouse == MouseButton.Right; + string typeLabel = quickTypesLabels[i].text; + + if (typeLabel == "Bool") + { + AddQuickVariable(isRight ? typeof(List) : typeof(bool), true); + continue; + } + if (typeLabel == "Other") + { + TypeBuilderWindow.ShowWindow(buttonRect, (t) => AddQuickVariable(t, Event.current.shift), typeof(object), true, Array.Empty()); + continue; + } + + var menu = new GenericMenu(); + switch (typeLabel) + { + case "Float": + menu.AddItem(new GUIContent("float"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(float), true)); + menu.AddItem(new GUIContent("double"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(double), true)); + menu.AddItem(new GUIContent("decimal"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(decimal), true)); + break; + + case "Int": + menu.AddItem(new GUIContent("int"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(int))); + menu.AddItem(new GUIContent("short"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(short), true)); + menu.AddItem(new GUIContent("long"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(long), true)); + menu.AddItem(new GUIContent("byte"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(byte), true)); + menu.AddItem(new GUIContent("sbyte"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(sbyte), true)); + menu.AddSeparator(""); + menu.AddItem(new GUIContent("uint"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(uint), true)); + menu.AddItem(new GUIContent("ushort"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(ushort), true)); + menu.AddItem(new GUIContent("ulong"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(ulong), true)); + break; + + case "String": + menu.AddItem(new GUIContent("String"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(string))); + menu.AddItem(new GUIContent("Char"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(char), true)); + break; + + case "Vector": + menu.AddItem(new GUIContent("Vector 2"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Vector2), true)); + menu.AddItem(new GUIContent("Vector 3"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Vector3), true)); + menu.AddItem(new GUIContent("Vector 4"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Vector4), true)); + menu.AddSeparator(""); + menu.AddItem(new GUIContent("Vector 2 Int"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Vector2Int), true)); + menu.AddItem(new GUIContent("Vector 3 Int"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Vector3Int), true)); + break; + + case "Color": + menu.AddItem(new GUIContent("Color"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Color))); + menu.AddItem(new GUIContent("HDRColor"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(HDRColor), true)); + menu.AddItem(new GUIContent("Gradient"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Gradient), true)); + break; + + case "Object": + menu.AddItem(new GUIContent("Game Object"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(GameObject))); + menu.AddItem(new GUIContent("Transform"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Transform))); + menu.AddSeparator(""); + menu.AddItem(new GUIContent("Physics/Rigid Body"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Rigidbody), true)); + menu.AddItem(new GUIContent("Physics/Rigid Body 2D"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Rigidbody2D), true)); + menu.AddItem(new GUIContent("Physics/Collider"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Collider), true)); + menu.AddItem(new GUIContent("Physics/Collider 2D"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Collider2D), true)); + menu.AddItem(new GUIContent("Physics/Box Collider"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(BoxCollider), true)); + menu.AddItem(new GUIContent("Physics/Box Collider 2D"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(BoxCollider2D), true)); + menu.AddItem(new GUIContent("Physics/Sphere Collider"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(SphereCollider), true)); + menu.AddItem(new GUIContent("Physics/Circle Collider"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(CircleCollider2D), true)); + menu.AddSeparator(""); + menu.AddItem(new GUIContent("Rendering/Mesh Renderer"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(MeshRenderer), true)); + menu.AddItem(new GUIContent("Rendering/Camera"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Camera), true)); + menu.AddSeparator(""); + menu.AddItem(new GUIContent("Audio Source"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(AudioSource), true)); + menu.AddItem(new GUIContent("Animator"), false, () => AddQuickVariable(isRight ? typeof(List) : typeof(Animator), true)); + break; + } + menu.DropDown(buttonRect); + } + } + } + + private static GUIStyle _labelStyle; + private static GUIStyle labelStyle + { + get + { + if (_labelStyle == null) + { + _labelStyle = new GUIStyle(EditorStyles.label) + { + border = new RectOffset((int)Layout.CornerRadius, (int)Layout.CornerRadius, (int)Layout.CornerRadius, (int)Layout.CornerRadius), + padding = new RectOffset(4, 4, 2, 2), + alignment = TextAnchor.MiddleLeft, + normal = { textColor = !EditorGUIUtility.isProSkin ? Color.black : Color.white } + }; + } + return _labelStyle; + } + } + + private static bool DrawAddButton(Rect rect, GUIContent content, out MouseButton? mouseButton) + { + var e = Event.current; + bool containsMouse = e != null && rect.Contains(e.mousePosition); + bool isClick = containsMouse && e.type == EventType.MouseDown && e.button == 0; + bool isRightClick = containsMouse && e.type == EventType.MouseDown && e.button == 1; + + var previous = EditorGUIUtility.GetIconSize(); + EditorGUIUtility.SetIconSize(new Vector2(16, 16)); + + var color = Color.gray.Brighten(0.1f); + if (isClick || isRightClick) color = CommunityStyles.backgroundColor; + else if (containsMouse) color = CommunityStyles.backgroundColor.Brighten(0.3f); + + LudiqGUI.DrawEmptyRect(rect, color); + EditorGUI.LabelField(rect, content, labelStyle); + EditorGUIUtility.SetIconSize(previous); + + var texRect = new Rect(rect.xMax - 14, rect.y + 9, EditorGUIUtility.isProSkin ? 8 : 10, 10); + GUI.DrawTexture(texRect, ReorderableListResources.GetTexture(ReorderableListTexture.Icon_Add_Normal)); + + if (isClick) + { + mouseButton = MouseButton.Left; + e.Use(); + return true; + } + if (isRightClick) + { + mouseButton = MouseButton.Right; + e.Use(); + return true; + } + + mouseButton = null; + return false; + } + + private static readonly string SettingsFilePath = Path.Combine("ProjectSettings", "VisualScripting_ShownTypePopups.json"); + + private static HashSet LoadSeenTypes() + { + if (File.Exists(SettingsFilePath)) + { + try + { + string json = File.ReadAllText(SettingsFilePath); + var wrapper = JsonUtility.FromJson(json); + if (wrapper?.items != null) + { + return new HashSet(wrapper.items); + } + } + catch (Exception ex) + { + Debug.LogWarning($"Failed to load shown type popups settings: {ex.Message}"); + } + } + return new HashSet(); + } + + private static void SaveSeenTypes(HashSet seenTypes) + { + try + { + var wrapper = new SerializationWrapper { items = new List(seenTypes) }; + string json = JsonUtility.ToJson(wrapper, true); + File.WriteAllText(SettingsFilePath, json); + } + catch (Exception ex) + { + Debug.LogWarning($"Failed to save shown type popups settings: {ex.Message}"); + } + } + + [Serializable] + private class SerializationWrapper + { + public List items; + } + + private void AddQuickVariable(Type type, bool ask = false) + { + string typeKey = type.AssemblyQualifiedName; + HashSet seenTypes = LoadSeenTypes(); + bool hasSeenPopup = seenTypes.Contains(typeKey); + + var coreConfig = BoltCore.Configuration; + + if (ask && !coreConfig.typeOptions.Contains(type) && !hasSeenPopup && !type.IsGenericType) + { + int choice = EditorUtility.DisplayDialogComplex( + "Add Type to Settings", + $"The type '{type.As().CSharpName(false, false, false)}' is not currently in your settings types.\n\nWould you like to add it?", + "Add", "No", "Add && Regenerate" + ); + + if (choice == 0 || choice == 2) + { + coreConfig.typeOptions.Add(type); + SaveCoreConfig(coreConfig); + Codebase.UpdateSettings(); + if (choice == 2) UnitBase.Rebuild(); + } + + seenTypes.Add(typeKey); + SaveSeenTypes(seenTypes); + } + + var variableDecls = (VariableDeclarations)metadata.value; + var collection = (VariableDeclarationCollection)metadata["collection"].value; + + string baseName = type.HumanName(true); + string newVarName = baseName; + int counter = 1; + + while (variableDecls.IsDefined(newVarName)) + { + newVarName = $"{baseName} ({counter++})"; + } + + var newVar = new VariableDeclaration(newVarName, Default(type)); +#if VISUAL_SCRIPTING_1_7 + newVar.typeHandle = new SerializableType(type.AssemblyQualifiedName); +#endif + collection.Add(newVar); + metadata.RecordUndo(); + SetHeightDirty(); + } + + private object Default(Type type) + { + if (type == typeof(Gradient)) return new Gradient(); + + return type.PseudoDefault(); + } + + private void SaveCoreConfig(BoltCoreConfiguration coreConfig) + { + var meta = coreConfig.GetMetadata(nameof(coreConfig.typeOptions)); + meta.Inspector().SetHeightDirty(); +#if VISUAL_SCRIPTING_1_9_0_OR_GREATER + meta.GetType().GetMethod("SaveImmediately", BindingFlags.Instance | BindingFlags.NonPublic).InvokeOptimized(meta, new object[] { true }); +#else + meta.Save(); +#endif + } + } +} \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationsInpsector.cs.meta b/Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationsInspector.cs.meta similarity index 100% rename from Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationsInpsector.cs.meta rename to Editor/Nodes/Fundamentals/Inspectors/Variables/PatchedVariableDeclerationsInspector.cs.meta diff --git a/Editor/Nodes/Fundamentals/Inspectors/Variables/VariableFoldout.cs b/Editor/Nodes/Fundamentals/Inspectors/Variables/VariableFoldout.cs deleted file mode 100644 index fb4acc8e..00000000 --- a/Editor/Nodes/Fundamentals/Inspectors/Variables/VariableFoldout.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Unity.VisualScripting.Community -{ - public class VariableFoldout - { - public string name; - public bool isExpanded; - public double? hoverStartTime; - public VariableFoldout(string name, bool expanded) { this.name = name; this.isExpanded = expanded; } - } -} \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Inspectors/Variables/VariableFoldout.cs.meta b/Editor/Nodes/Fundamentals/Inspectors/Variables/VariableFoldout.cs.meta deleted file mode 100644 index b58dc9cb..00000000 --- a/Editor/Nodes/Fundamentals/Inspectors/Variables/VariableFoldout.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 05ada80a9dc67ba4babca8296ab5b3e6 \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Inspectors/Vector2IntInspector.cs b/Editor/Nodes/Fundamentals/Inspectors/Vector2IntInspector.cs index 1fb9f38f..49d9ca07 100644 --- a/Editor/Nodes/Fundamentals/Inspectors/Vector2IntInspector.cs +++ b/Editor/Nodes/Fundamentals/Inspectors/Vector2IntInspector.cs @@ -4,28 +4,60 @@ namespace Unity.VisualScripting.Community { [Inspector(typeof(Vector2Int))] - public class Vector2IntInspector : Inspector + public class Vector2IntInspector : VectorInspector { public Vector2IntInspector(Metadata metadata) : base(metadata) { } - protected override float GetHeight(float width, GUIContent label) - { - return EditorGUIUtility.singleLineHeight; - } - protected override void OnGUI(Rect position, GUIContent label) { var value = (Vector2Int)metadata.value; BeginBlock(metadata, position); - var newValue = EditorGUI.Vector2IntField(position, label, value); + Vector2Int newValue; + + if (position.width <= Styles.compactThreshold) + { + newValue = CompactVector2IntField(position, GUIContent.none, (Vector2Int)metadata.value); + } + else + { + newValue = EditorGUI.Vector2IntField(position, label, value); + } + if (EndBlock(metadata)) { metadata.RecordUndo(); metadata.value = newValue; } } + + public static Vector2Int CompactVector2IntField(Rect position, GUIContent label, Vector2Int value) + { + position = EditorGUI.PrefixLabel(position, label); + + float totalSpacing = LudiqStyles.compactHorizontalSpacing; + float elementWidth = (position.width - totalSpacing) / 2f; + + var xPosition = new Rect( + position.x, + position.y, + elementWidth, + EditorGUIUtility.singleLineHeight + ); + + var yPosition = new Rect( + xPosition.xMax + LudiqStyles.compactHorizontalSpacing, + position.y, + elementWidth, + EditorGUIUtility.singleLineHeight + ); + + return new Vector2Int( + LudiqGUI.DraggableIntField(xPosition, value.x), + LudiqGUI.DraggableIntField(yPosition, value.y) + ); + } } } \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Inspectors/Vector3IntInspector.cs b/Editor/Nodes/Fundamentals/Inspectors/Vector3IntInspector.cs index 1cdbcf6c..67f198f4 100644 --- a/Editor/Nodes/Fundamentals/Inspectors/Vector3IntInspector.cs +++ b/Editor/Nodes/Fundamentals/Inspectors/Vector3IntInspector.cs @@ -4,28 +4,68 @@ namespace Unity.VisualScripting.Community { [Inspector(typeof(Vector3Int))] - public class Vector3IntInspector : Inspector + public class Vector3IntInspector : VectorInspector { public Vector3IntInspector(Metadata metadata) : base(metadata) { } - protected override float GetHeight(float width, GUIContent label) - { - return EditorGUIUtility.singleLineHeight; - } - protected override void OnGUI(Rect position, GUIContent label) { var value = (Vector3Int)metadata.value; BeginBlock(metadata, position); - var newValue = EditorGUI.Vector3IntField(position, label, value); + Vector3Int newValue; + + if (position.width <= Styles.compactThreshold) + { + newValue = CompactVector3IntField(position, GUIContent.none, (Vector3Int)metadata.value); + } + else + { + newValue = EditorGUI.Vector3IntField(position, label, value); + } + if (EndBlock(metadata)) { metadata.RecordUndo(); metadata.value = newValue; } } + + public static Vector3Int CompactVector3IntField(Rect position, GUIContent label, Vector3Int value) + { + position = EditorGUI.PrefixLabel(position, label); + + float totalSpacing = LudiqStyles.compactHorizontalSpacing * 2; + float elementWidth = (position.width - totalSpacing) / 3f; + + var xPosition = new Rect( + position.x, + position.y, + elementWidth, + EditorGUIUtility.singleLineHeight + ); + + var yPosition = new Rect( + xPosition.xMax + LudiqStyles.compactHorizontalSpacing, + position.y, + elementWidth, + EditorGUIUtility.singleLineHeight + ); + + var zPosition = new Rect( + yPosition.xMax + LudiqStyles.compactHorizontalSpacing, + position.y, + elementWidth, + EditorGUIUtility.singleLineHeight + ); + + return new Vector3Int( + LudiqGUI.DraggableIntField(xPosition, value.x), + LudiqGUI.DraggableIntField(yPosition, value.y), + LudiqGUI.DraggableIntField(zPosition, value.z) + ); + } } } \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Resources/Align.png b/Editor/Nodes/Fundamentals/Resources/Align.png index e5a80dac..27f8eb0a 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/Align.png and b/Editor/Nodes/Fundamentals/Resources/Align.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/Align.png~ b/Editor/Nodes/Fundamentals/Resources/Align.png~ new file mode 100644 index 00000000..b6492152 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/Align.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/Align@Pro.png b/Editor/Nodes/Fundamentals/Resources/Align@Pro.png index ba029f48..10e59f6a 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/Align@Pro.png and b/Editor/Nodes/Fundamentals/Resources/Align@Pro.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/Align@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/Align@Pro.png.meta index 3eb35a18..1e3ae2fb 100644 --- a/Editor/Nodes/Fundamentals/Resources/Align@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Align@Pro.png.meta @@ -1,10 +1,10 @@ fileFormatVersion: 2 -guid: f3e2dfee3cfda644ba60a18ab1c88773 +guid: 1cd1c99cb03300345991e85fdfececea TextureImporter: internalIDToNameTable: - first: - 213: -7802815188228000839 - second: Align_0 + 213: 4314550837289281709 + second: Align@Pro_0 externalObjects: {} serializedVersion: 13 mipmaps: @@ -57,7 +57,7 @@ TextureImporter: alphaUsage: 1 alphaIsTransparency: 1 spriteTessellationDetail: -1 - textureType: 2 + textureType: 8 textureShape: 1 singleChannelComponent: 0 flipbookRows: 1 @@ -75,19 +75,6 @@ TextureImporter: maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - ignorePlatformSupport: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 4 - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 @@ -97,7 +84,7 @@ TextureImporter: androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 4 - buildTarget: Android + buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -113,13 +100,13 @@ TextureImporter: serializedVersion: 2 sprites: - serializedVersion: 2 - name: Align_0 + name: Align@Pro_0 rect: serializedVersion: 2 x: 0 y: 0 - width: 32 - height: 30 + width: 16 + height: 16 alignment: 0 pivot: {x: 0, y: 0} border: {x: 0, y: 0, z: 0, w: 0} @@ -128,8 +115,8 @@ TextureImporter: physicsShape: [] tessellationDetail: -1 bones: [] - spriteID: 9b3b5a96de4d6b390800000000000000 - internalID: -7802815188228000839 + spriteID: da8edf5802d50eb30800000000000000 + internalID: 4314550837289281709 vertices: [] indices: edges: [] @@ -148,7 +135,7 @@ TextureImporter: spriteCustomMetadata: entries: [] nameFileIdTable: - Align_0: -7802815188228000839 + Align@Pro_0: 4314550837289281709 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Editor/Nodes/Fundamentals/Resources/BlueNode.png b/Editor/Nodes/Fundamentals/Resources/BlueNode.png index 1a3850de..92510509 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/BlueNode.png and b/Editor/Nodes/Fundamentals/Resources/BlueNode.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/BlueNode.png~ b/Editor/Nodes/Fundamentals/Resources/BlueNode.png~ new file mode 100644 index 00000000..405e59a6 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/BlueNode.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/BlueNode@Pro.png b/Editor/Nodes/Fundamentals/Resources/BlueNode@Pro.png index 7d41b724..405e59a6 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/BlueNode@Pro.png and b/Editor/Nodes/Fundamentals/Resources/BlueNode@Pro.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/BlueNode@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/BlueNode@Pro.png.meta index 053e8d0e..6a7bf353 100644 --- a/Editor/Nodes/Fundamentals/Resources/BlueNode@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/BlueNode@Pro.png.meta @@ -24,7 +24,7 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 flipGreenChannel: 0 - isReadable: 0 + isReadable: 1 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 diff --git a/Editor/Nodes/Fundamentals/Resources/BlueNode@Pro.png~ b/Editor/Nodes/Fundamentals/Resources/BlueNode@Pro.png~ new file mode 100644 index 00000000..ef43c588 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/BlueNode@Pro.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_And.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_And.png.meta index 804cb46f..21ce6d6f 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_And.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_And.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 41e4cdb209a3b5844920950cab1a48f2 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -1779779268800075709 + second: Branch_And_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_And_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 34821984f24fc47e0800000000000000 + internalID: -1779779268800075709 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_And@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_And@Pro.png.meta index 66fad5c8..98591f80 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_And@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_And@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: c4ee510e6ce59574cb2fd0dc3d5c28ac TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 8433287221034758638 + second: Branch_And@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_And@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: ee13e9acb0e090570800000000000000 + internalID: 8433287221034758638 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_Equal.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_Equal.png.meta index 47491bdf..157e5bef 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_Equal.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_Equal.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 5325db33bc788a847a02f7c2a0dd2284 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 8069040108011092611 + second: Branch_Equal_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_Equal_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 38a71640a3dfaff60800000000000000 + internalID: 8069040108011092611 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_Equal@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_Equal@Pro.png.meta index 606b458b..eaf00e2c 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_Equal@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_Equal@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 4e578341c3d6dae47984528c2befdf6e TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -8786634562288884009 + second: Branch_Equal@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_Equal@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 7d6e99f4b6a9f0680800000000000000 + internalID: -8786634562288884009 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_Greater.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_Greater.png.meta index eb31bb25..afb54342 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_Greater.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_Greater.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 0216448bfa3c59a4280cbbfcfa8becdd TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -6398303727221698234 + second: Branch_Greater_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_Greater_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 64194e5e8a8a437a0800000000000000 + internalID: -6398303727221698234 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_Greater@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_Greater@Pro.png.meta index e1f61642..8d036eeb 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_Greater@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_Greater@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 67fdcc0997c74f94c88d7a4537a97548 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 8850959077054922427 + second: Branch_Greater@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_Greater@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: bbeb06dd26ce4da70800000000000000 + internalID: 8850959077054922427 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_Greater_Equal.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_Greater_Equal.png.meta index 9b7b6852..7df8d03e 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_Greater_Equal.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_Greater_Equal.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 8decbd53327d91d428f8faec3e796f47 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 2154258476637647736 + second: Branch_Greater_Equal_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_Greater_Equal_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 8737c56bba675ed10800000000000000 + internalID: 2154258476637647736 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_Greater_Equal@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_Greater_Equal@Pro.png.meta index 55af3393..01cba52c 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_Greater_Equal@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_Greater_Equal@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: b497811870be5094ba24b63756468679 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 5235735447084793950 + second: Branch_Greater_Equal@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_Greater_Equal@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: e50096526a119a840800000000000000 + internalID: 5235735447084793950 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_Less.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_Less.png.meta index ab673f04..24da1872 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_Less.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_Less.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: de04b70930cc11847b43a241061002ee TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -2512731857809075076 + second: Branch_Less_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_Less_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: c749b7730bbf02dd0800000000000000 + internalID: -2512731857809075076 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_Less@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_Less@Pro.png.meta index d745bbe3..4936ac25 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_Less@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_Less@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 00d07e74abdf3134bb276636ff58a890 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 8682910822915480095 + second: Branch_Less@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_Less@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: f1a9540b365ef7870800000000000000 + internalID: 8682910822915480095 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_Less_Equal.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_Less_Equal.png.meta index 47857f91..7f3d45b7 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_Less_Equal.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_Less_Equal.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 9ab9f05fc7904124b855d2a4713eaaf0 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 3523671142265371824 + second: Branch_Less_Equal_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_Less_Equal_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 0bcb5041c3896e030800000000000000 + internalID: 3523671142265371824 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_Less_Equal@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_Less_Equal@Pro.png.meta index 3ebab72d..760b2f4e 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_Less_Equal@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_Less_Equal@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 8e4285eafc0a09f4c96aec6ecc414296 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 6779399788553766383 + second: Branch_Less_Equal@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_Less_Equal@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: fe50b1b5034451e50800000000000000 + internalID: 6779399788553766383 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_Or.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_Or.png.meta index d1fd365c..34f29c86 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_Or.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_Or.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: d6675b4cbe0ab914d99449207fe4132f TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -507279977547992436 + second: Branch_Or_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_Or_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: c8275905c87c5f8f0800000000000000 + internalID: -507279977547992436 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Branch_Or@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/Branch_Or@Pro.png.meta index 12c0b375..884a7193 100644 --- a/Editor/Nodes/Fundamentals/Resources/Branch_Or@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Branch_Or@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 4fc91e395e7837d4c935020d471e3fe0 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 407345041965553026 + second: Branch_Or@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: Branch_Or@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 2859f5f482e27a500800000000000000 + internalID: 407345041965553026 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/Distribute.png b/Editor/Nodes/Fundamentals/Resources/Distribute.png index bdf3a600..56e7c3f1 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/Distribute.png and b/Editor/Nodes/Fundamentals/Resources/Distribute.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/Distribute.png~ b/Editor/Nodes/Fundamentals/Resources/Distribute.png~ new file mode 100644 index 00000000..6857a769 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/Distribute.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/Distribute@Pro.png b/Editor/Nodes/Fundamentals/Resources/Distribute@Pro.png index 211327fc..3d406d29 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/Distribute@Pro.png and b/Editor/Nodes/Fundamentals/Resources/Distribute@Pro.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/Distribute@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/Distribute@Pro.png.meta index 8b66715c..3eff39fe 100644 --- a/Editor/Nodes/Fundamentals/Resources/Distribute@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/Distribute@Pro.png.meta @@ -5,9 +5,6 @@ TextureImporter: - first: 213: 2697913526184963604 second: Distribute@Pro_0 - - first: - 213: -7034541577598151508 - second: Distribute@Pro_1 externalObjects: {} serializedVersion: 13 mipmaps: @@ -49,7 +46,7 @@ TextureImporter: nPOTScale: 0 lightmap: 0 compressionQuality: 50 - spriteMode: 1 + spriteMode: 2 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 @@ -60,7 +57,7 @@ TextureImporter: alphaUsage: 1 alphaIsTransparency: 1 spriteTessellationDetail: -1 - textureType: 2 + textureType: 8 textureShape: 1 singleChannelComponent: 0 flipbookRows: 1 @@ -75,19 +72,6 @@ TextureImporter: platformSettings: - serializedVersion: 4 buildTarget: DefaultTexturePlatform - maxTextureSize: 32 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - ignorePlatformSupport: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 4 - buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -100,7 +84,7 @@ TextureImporter: androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 4 - buildTarget: Android + buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -122,7 +106,7 @@ TextureImporter: x: 0 y: 0 width: 16 - height: 32 + height: 16 alignment: 0 pivot: {x: 0, y: 0} border: {x: 0, y: 0, z: 0, w: 0} @@ -137,33 +121,11 @@ TextureImporter: indices: edges: [] weights: [] - - serializedVersion: 2 - name: Distribute@Pro_1 - rect: - serializedVersion: 2 - x: 15 - y: 0 - width: 15 - height: 32 - alignment: 0 - pivot: {x: 0, y: 0} - border: {x: 0, y: 0, z: 0, w: 0} - customData: - outline: [] - physicsShape: [] - tessellationDetail: -1 - bones: [] - spriteID: ca4db8da4b9406e90800000000000000 - internalID: -7034541577598151508 - vertices: [] - indices: - edges: [] - weights: [] outline: [] customData: physicsShape: [] bones: [] - spriteID: 5e97eb03825dee720800000000000000 + spriteID: internalID: 0 vertices: [] indices: @@ -174,7 +136,6 @@ TextureImporter: entries: [] nameFileIdTable: Distribute@Pro_0: 2697913526184963604 - Distribute@Pro_1: -7034541577598151508 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Editor/Nodes/Fundamentals/Resources/EditorWindow.png.meta b/Editor/Nodes/Fundamentals/Resources/EditorWindow.png.meta index d723d7f1..81b167b3 100644 --- a/Editor/Nodes/Fundamentals/Resources/EditorWindow.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/EditorWindow.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: e70611c7b5b2ec945bc9aacef47e4efd TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -8485257677393968811 + second: EditorWindow_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: EditorWindow_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 551c647691f4e3a80800000000000000 + internalID: -8485257677393968811 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/EditorWindow_Variable.png.meta b/Editor/Nodes/Fundamentals/Resources/EditorWindow_Variable.png.meta index fe437d87..c8fbd454 100644 --- a/Editor/Nodes/Fundamentals/Resources/EditorWindow_Variable.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/EditorWindow_Variable.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 97911a3e230b0074f817c88a08ae0873 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 753110343188717244 + second: EditorWindow_Variable_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: EditorWindow_Variable_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: cbe9f62fdd5937a00800000000000000 + internalID: 753110343188717244 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/GrayNode.png b/Editor/Nodes/Fundamentals/Resources/GrayNode.png index 1f4f2a0c..da0e406e 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/GrayNode.png and b/Editor/Nodes/Fundamentals/Resources/GrayNode.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/GrayNode.png~ b/Editor/Nodes/Fundamentals/Resources/GrayNode.png~ new file mode 100644 index 00000000..663727ef Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/GrayNode.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/GrayNode@Pro.png b/Editor/Nodes/Fundamentals/Resources/GrayNode@Pro.png index 9d2c947e..03f67dba 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/GrayNode@Pro.png and b/Editor/Nodes/Fundamentals/Resources/GrayNode@Pro.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/GrayNode@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/GrayNode@Pro.png.meta index 59c29a21..15ca8d8d 100644 --- a/Editor/Nodes/Fundamentals/Resources/GrayNode@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/GrayNode@Pro.png.meta @@ -24,7 +24,7 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 flipGreenChannel: 0 - isReadable: 0 + isReadable: 1 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 @@ -74,7 +74,7 @@ TextureImporter: buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 - textureFormat: -1 + textureFormat: 4 textureCompression: 0 compressionQuality: 50 crunchedCompression: 0 diff --git a/Editor/Nodes/Fundamentals/Resources/GrayNode@Pro.png~ b/Editor/Nodes/Fundamentals/Resources/GrayNode@Pro.png~ new file mode 100644 index 00000000..d8638c31 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/GrayNode@Pro.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/GreenNode.png b/Editor/Nodes/Fundamentals/Resources/GreenNode.png index 49c96035..2e82229f 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/GreenNode.png and b/Editor/Nodes/Fundamentals/Resources/GreenNode.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/GreenNode.png~ b/Editor/Nodes/Fundamentals/Resources/GreenNode.png~ new file mode 100644 index 00000000..49c96035 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/GreenNode.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/GreenNode@Pro.png b/Editor/Nodes/Fundamentals/Resources/GreenNode@Pro.png index f4509b58..f748d819 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/GreenNode@Pro.png and b/Editor/Nodes/Fundamentals/Resources/GreenNode@Pro.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/GreenNode@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/GreenNode@Pro.png.meta index 5977ca53..354119fc 100644 --- a/Editor/Nodes/Fundamentals/Resources/GreenNode@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/GreenNode@Pro.png.meta @@ -24,7 +24,7 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 flipGreenChannel: 0 - isReadable: 0 + isReadable: 1 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 @@ -46,12 +46,12 @@ TextureImporter: nPOTScale: 0 lightmap: 0 compressionQuality: 50 - spriteMode: 2 - spriteExtrude: 1 - spriteMeshType: 1 + spriteMode: 1 + spriteExtrude: 32 + spriteMeshType: 0 alignment: 0 spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 + spritePixelsToUnits: 109.08 spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 @@ -72,7 +72,7 @@ TextureImporter: platformSettings: - serializedVersion: 4 buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 + maxTextureSize: 64 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 0 @@ -138,7 +138,7 @@ TextureImporter: customData: physicsShape: [] bones: [] - spriteID: + spriteID: 5e97eb03825dee720800000000000000 internalID: 0 vertices: [] indices: diff --git a/Editor/Nodes/Fundamentals/Resources/GreenNode@Pro.png~ b/Editor/Nodes/Fundamentals/Resources/GreenNode@Pro.png~ new file mode 100644 index 00000000..a84ce940 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/GreenNode@Pro.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/OrangeNode.png b/Editor/Nodes/Fundamentals/Resources/OrangeNode.png index 4144ebc1..433d1f56 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/OrangeNode.png and b/Editor/Nodes/Fundamentals/Resources/OrangeNode.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/OrangeNode.png~ b/Editor/Nodes/Fundamentals/Resources/OrangeNode.png~ new file mode 100644 index 00000000..433d1f56 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/OrangeNode.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/OrangeNode@Pro.png b/Editor/Nodes/Fundamentals/Resources/OrangeNode@Pro.png index e435f0f0..c1933869 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/OrangeNode@Pro.png and b/Editor/Nodes/Fundamentals/Resources/OrangeNode@Pro.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/OrangeNode@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/OrangeNode@Pro.png.meta index e7db6303..840b6a28 100644 --- a/Editor/Nodes/Fundamentals/Resources/OrangeNode@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/OrangeNode@Pro.png.meta @@ -24,7 +24,7 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 flipGreenChannel: 0 - isReadable: 0 + isReadable: 1 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 diff --git a/Editor/Nodes/Fundamentals/Resources/OrangeNode@Pro.png~ b/Editor/Nodes/Fundamentals/Resources/OrangeNode@Pro.png~ new file mode 100644 index 00000000..0a0167d3 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/OrangeNode@Pro.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected.png b/Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected.png deleted file mode 100644 index b00a8f80..00000000 Binary files a/Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected.png and /dev/null differ diff --git a/Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected@Pro.png b/Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected@Pro.png~ similarity index 100% rename from Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected@Pro.png rename to Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected@Pro.png~ diff --git a/Editor/Nodes/Fundamentals/Resources/RedNode.png b/Editor/Nodes/Fundamentals/Resources/RedNode.png index a5a02eb3..8473e9dc 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/RedNode.png and b/Editor/Nodes/Fundamentals/Resources/RedNode.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/RedNode.png~ b/Editor/Nodes/Fundamentals/Resources/RedNode.png~ new file mode 100644 index 00000000..f89e02df Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/RedNode.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/RedNode@Pro.png b/Editor/Nodes/Fundamentals/Resources/RedNode@Pro.png index 1ce0a877..1db0f9a8 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/RedNode@Pro.png and b/Editor/Nodes/Fundamentals/Resources/RedNode@Pro.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/RedNode@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/RedNode@Pro.png.meta index a07bbe66..750eb5fb 100644 --- a/Editor/Nodes/Fundamentals/Resources/RedNode@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/RedNode@Pro.png.meta @@ -24,7 +24,7 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 flipGreenChannel: 0 - isReadable: 0 + isReadable: 1 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 diff --git a/Editor/Nodes/Fundamentals/Resources/RedNode@Pro.png~ b/Editor/Nodes/Fundamentals/Resources/RedNode@Pro.png~ new file mode 100644 index 00000000..243dced8 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/RedNode@Pro.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/RedNodeSelected.png b/Editor/Nodes/Fundamentals/Resources/RedNodeSelected.png deleted file mode 100644 index a336b855..00000000 Binary files a/Editor/Nodes/Fundamentals/Resources/RedNodeSelected.png and /dev/null differ diff --git a/Editor/Nodes/Fundamentals/Resources/RedNodeSelected@Pro.png b/Editor/Nodes/Fundamentals/Resources/RedNodeSelected@Pro.png~ similarity index 100% rename from Editor/Nodes/Fundamentals/Resources/RedNodeSelected@Pro.png rename to Editor/Nodes/Fundamentals/Resources/RedNodeSelected@Pro.png~ diff --git a/Editor/Nodes/Fundamentals/Resources/SelectedBlueNode@Pro.png b/Editor/Nodes/Fundamentals/Resources/SelectedBlueNode@Pro.png new file mode 100644 index 00000000..39c9edeb Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/SelectedBlueNode@Pro.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/RedNodeSelected.png.meta b/Editor/Nodes/Fundamentals/Resources/SelectedBlueNode@Pro.png.meta similarity index 82% rename from Editor/Nodes/Fundamentals/Resources/RedNodeSelected.png.meta rename to Editor/Nodes/Fundamentals/Resources/SelectedBlueNode@Pro.png.meta index 470b0945..fbb6b2ae 100644 --- a/Editor/Nodes/Fundamentals/Resources/RedNodeSelected.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/SelectedBlueNode@Pro.png.meta @@ -1,10 +1,10 @@ fileFormatVersion: 2 -guid: 3e0ce420930779d4e9d57b1d9cdfa23a +guid: cad06512472950b4a95ac0999b0372f4 TextureImporter: internalIDToNameTable: - first: - 213: 5886926472829903730 - second: RedNodeSelected_0 + 213: -8904278001803723941 + second: SelectedBlueNode@Pro_0 externalObjects: {} serializedVersion: 13 mipmaps: @@ -37,7 +37,7 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: 0 + filterMode: 1 aniso: 1 mipBias: 0 wrapU: 1 @@ -57,7 +57,7 @@ TextureImporter: alphaUsage: 1 alphaIsTransparency: 1 spriteTessellationDetail: -1 - textureType: 2 + textureType: 8 textureShape: 1 singleChannelComponent: 0 flipbookRows: 1 @@ -75,19 +75,6 @@ TextureImporter: maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - ignorePlatformSupport: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 4 - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 @@ -97,7 +84,7 @@ TextureImporter: androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 4 - buildTarget: Android + buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -113,7 +100,7 @@ TextureImporter: serializedVersion: 2 sprites: - serializedVersion: 2 - name: RedNodeSelected_0 + name: SelectedBlueNode@Pro_0 rect: serializedVersion: 2 x: 0 @@ -128,8 +115,8 @@ TextureImporter: physicsShape: [] tessellationDetail: -1 bones: [] - spriteID: 273aedfcf6092b150800000000000000 - internalID: 5886926472829903730 + spriteID: b5bf9219556ad6480800000000000000 + internalID: -8904278001803723941 vertices: [] indices: edges: [] @@ -147,7 +134,8 @@ TextureImporter: secondaryTextures: [] spriteCustomMetadata: entries: [] - nameFileIdTable: {} + nameFileIdTable: + SelectedBlueNode@Pro_0: -8904278001803723941 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Editor/Nodes/Fundamentals/Resources/SelectedNode.png b/Editor/Nodes/Fundamentals/Resources/SelectedNode.png index 18681aa7..54189f5e 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/SelectedNode.png and b/Editor/Nodes/Fundamentals/Resources/SelectedNode.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/SelectedNode.png~ b/Editor/Nodes/Fundamentals/Resources/SelectedNode.png~ new file mode 100644 index 00000000..18681aa7 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/SelectedNode.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/SelectedNode@Pro.png b/Editor/Nodes/Fundamentals/Resources/SelectedNode@Pro.png index b36bb76f..fa9b0678 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/SelectedNode@Pro.png and b/Editor/Nodes/Fundamentals/Resources/SelectedNode@Pro.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/SelectedNode@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/SelectedNode@Pro.png.meta index 14382cce..98d03d70 100644 --- a/Editor/Nodes/Fundamentals/Resources/SelectedNode@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/SelectedNode@Pro.png.meta @@ -24,7 +24,7 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 flipGreenChannel: 0 - isReadable: 0 + isReadable: 1 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 @@ -57,7 +57,7 @@ TextureImporter: alphaUsage: 1 alphaIsTransparency: 1 spriteTessellationDetail: -1 - textureType: 8 + textureType: 2 textureShape: 1 singleChannelComponent: 0 flipbookRows: 1 @@ -70,11 +70,11 @@ TextureImporter: swizzle: 50462976 cookieLightType: 0 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 - textureFormat: -1 + textureFormat: 4 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 @@ -83,7 +83,7 @@ TextureImporter: ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 @@ -96,7 +96,7 @@ TextureImporter: ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 2048 resizeAlgorithm: 0 @@ -123,6 +123,7 @@ TextureImporter: alignment: 0 pivot: {x: 0, y: 0} border: {x: 0, y: 0, z: 0, w: 0} + customData: outline: [] physicsShape: [] tessellationDetail: -1 @@ -134,6 +135,7 @@ TextureImporter: edges: [] weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: @@ -143,6 +145,8 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] + spriteCustomMetadata: + entries: [] nameFileIdTable: SelectedNode@Pro_0: -5372993062516891770 mipmapLimitGroupName: diff --git a/Editor/Nodes/Fundamentals/Resources/SelectedNode@Pro.png~ b/Editor/Nodes/Fundamentals/Resources/SelectedNode@Pro.png~ new file mode 100644 index 00000000..3c638edb Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/SelectedNode@Pro.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/SelectedRedNode@Pro.png~ b/Editor/Nodes/Fundamentals/Resources/SelectedRedNode@Pro.png~ new file mode 100644 index 00000000..243dced8 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/SelectedRedNode@Pro.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/TealNode.png b/Editor/Nodes/Fundamentals/Resources/TealNode.png index ce3c93bf..d86c6885 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/TealNode.png and b/Editor/Nodes/Fundamentals/Resources/TealNode.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/TealNode.png~ b/Editor/Nodes/Fundamentals/Resources/TealNode.png~ new file mode 100644 index 00000000..ce3c93bf Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/TealNode.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/TealNode@Pro.png b/Editor/Nodes/Fundamentals/Resources/TealNode@Pro.png index 975e3080..6e6e4020 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/TealNode@Pro.png and b/Editor/Nodes/Fundamentals/Resources/TealNode@Pro.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/TealNode@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/TealNode@Pro.png.meta index 8f64641f..857eaff3 100644 --- a/Editor/Nodes/Fundamentals/Resources/TealNode@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/TealNode@Pro.png.meta @@ -24,7 +24,7 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 flipGreenChannel: 0 - isReadable: 0 + isReadable: 1 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 diff --git a/Editor/Nodes/Fundamentals/Resources/TealNode@Pro.png~ b/Editor/Nodes/Fundamentals/Resources/TealNode@Pro.png~ new file mode 100644 index 00000000..b0c7633d Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/TealNode@Pro.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/ValuePortConnected.png b/Editor/Nodes/Fundamentals/Resources/ValuePortConnected.png new file mode 100644 index 00000000..cfd25e61 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/ValuePortConnected.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected.png.meta b/Editor/Nodes/Fundamentals/Resources/ValuePortConnected.png.meta similarity index 81% rename from Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected.png.meta rename to Editor/Nodes/Fundamentals/Resources/ValuePortConnected.png.meta index 835d72f7..72c8b5b6 100644 --- a/Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/ValuePortConnected.png.meta @@ -1,10 +1,10 @@ fileFormatVersion: 2 -guid: 867c13fba689c6f499fcead401eb5ad2 +guid: b2acab77fe60588489cd95cf17e5fe0f TextureImporter: internalIDToNameTable: - first: - 213: 6660117862059659321 - second: OrangeNodeSelected_0 + 213: -1151656034708878851 + second: ValuePortConnected_0 externalObjects: {} serializedVersion: 13 mipmaps: @@ -37,7 +37,7 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: 0 + filterMode: 1 aniso: 1 mipBias: 0 wrapU: 1 @@ -57,7 +57,7 @@ TextureImporter: alphaUsage: 1 alphaIsTransparency: 1 spriteTessellationDetail: -1 - textureType: 2 + textureType: 8 textureShape: 1 singleChannelComponent: 0 flipbookRows: 1 @@ -75,19 +75,6 @@ TextureImporter: maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - ignorePlatformSupport: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 4 - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 @@ -97,7 +84,7 @@ TextureImporter: androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 4 - buildTarget: Android + buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -113,13 +100,13 @@ TextureImporter: serializedVersion: 2 sprites: - serializedVersion: 2 - name: OrangeNodeSelected_0 + name: ValuePortConnected_0 rect: serializedVersion: 2 x: 0 y: 0 - width: 64 - height: 64 + width: 12 + height: 12 alignment: 0 pivot: {x: 0, y: 0} border: {x: 0, y: 0, z: 0, w: 0} @@ -128,8 +115,8 @@ TextureImporter: physicsShape: [] tessellationDetail: -1 bones: [] - spriteID: 930dc42a8ed7d6c50800000000000000 - internalID: 6660117862059659321 + spriteID: df90ebb20fe7400f0800000000000000 + internalID: -1151656034708878851 vertices: [] indices: edges: [] @@ -147,7 +134,8 @@ TextureImporter: secondaryTextures: [] spriteCustomMetadata: entries: [] - nameFileIdTable: {} + nameFileIdTable: + ValuePortConnected_0: -1151656034708878851 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Editor/Nodes/Fundamentals/Resources/ValuePortConnected.png~ b/Editor/Nodes/Fundamentals/Resources/ValuePortConnected.png~ new file mode 100644 index 00000000..cfd25e61 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/ValuePortConnected.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/ValuePortUnconnected.png b/Editor/Nodes/Fundamentals/Resources/ValuePortUnconnected.png new file mode 100644 index 00000000..6cb8afde Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/ValuePortUnconnected.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/RedNodeSelected@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/ValuePortUnconnected.png.meta similarity index 80% rename from Editor/Nodes/Fundamentals/Resources/RedNodeSelected@Pro.png.meta rename to Editor/Nodes/Fundamentals/Resources/ValuePortUnconnected.png.meta index 52f4f207..50ca699f 100644 --- a/Editor/Nodes/Fundamentals/Resources/RedNodeSelected@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/ValuePortUnconnected.png.meta @@ -1,10 +1,10 @@ fileFormatVersion: 2 -guid: 2b47272953feac74b846e969c2a08e7f +guid: 6f562f1faede4e34e9debb33a898c14c TextureImporter: internalIDToNameTable: - first: - 213: 6058224919682867474 - second: NodeRedbackgroundFocused_0 + 213: -2554239901492636595 + second: ValuePortUnconnected_0 externalObjects: {} serializedVersion: 13 mipmaps: @@ -37,7 +37,7 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: 0 + filterMode: 1 aniso: 1 mipBias: 0 wrapU: 1 @@ -57,7 +57,7 @@ TextureImporter: alphaUsage: 1 alphaIsTransparency: 1 spriteTessellationDetail: -1 - textureType: 2 + textureType: 8 textureShape: 1 singleChannelComponent: 0 flipbookRows: 1 @@ -75,19 +75,6 @@ TextureImporter: maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - ignorePlatformSupport: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 4 - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 @@ -97,7 +84,7 @@ TextureImporter: androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 4 - buildTarget: Android + buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -113,13 +100,13 @@ TextureImporter: serializedVersion: 2 sprites: - serializedVersion: 2 - name: NodeRedbackgroundFocused_0 + name: ValuePortUnconnected_0 rect: serializedVersion: 2 x: 0 y: 0 - width: 64 - height: 64 + width: 16 + height: 16 alignment: 0 pivot: {x: 0, y: 0} border: {x: 0, y: 0, z: 0, w: 0} @@ -128,8 +115,8 @@ TextureImporter: physicsShape: [] tessellationDetail: -1 bones: [] - spriteID: 211ed137773231450800000000000000 - internalID: 6058224919682867474 + spriteID: d441760b7548d8cd0800000000000000 + internalID: -2554239901492636595 vertices: [] indices: edges: [] @@ -148,7 +135,7 @@ TextureImporter: spriteCustomMetadata: entries: [] nameFileIdTable: - NodeRedbackgroundFocused_0: 6058224919682867474 + ValuePortUnconnected_0: -2554239901492636595 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Editor/Nodes/Fundamentals/Resources/ValuePortUnconnected.png~ b/Editor/Nodes/Fundamentals/Resources/ValuePortUnconnected.png~ new file mode 100644 index 00000000..1ca7f9a3 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/ValuePortUnconnected.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/WindowIs.png.meta b/Editor/Nodes/Fundamentals/Resources/WindowIs.png.meta index f629150d..beb95709 100644 --- a/Editor/Nodes/Fundamentals/Resources/WindowIs.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/WindowIs.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: e66aa1081cf6940459a4aa8e0aff8408 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 6068181851916472062 + second: WindowIs_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: WindowIs_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: efe04f36e33863450800000000000000 + internalID: 6068181851916472062 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/YellowNode.png b/Editor/Nodes/Fundamentals/Resources/YellowNode.png index a12174ea..6ff17d85 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/YellowNode.png and b/Editor/Nodes/Fundamentals/Resources/YellowNode.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/YellowNode.png~ b/Editor/Nodes/Fundamentals/Resources/YellowNode.png~ new file mode 100644 index 00000000..a12174ea Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/YellowNode.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/YellowNode@Pro.png b/Editor/Nodes/Fundamentals/Resources/YellowNode@Pro.png index 06bb0d5c..b9232df3 100644 Binary files a/Editor/Nodes/Fundamentals/Resources/YellowNode@Pro.png and b/Editor/Nodes/Fundamentals/Resources/YellowNode@Pro.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/YellowNode@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/YellowNode@Pro.png.meta index f880c125..db4b9271 100644 --- a/Editor/Nodes/Fundamentals/Resources/YellowNode@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/YellowNode@Pro.png.meta @@ -24,7 +24,7 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 flipGreenChannel: 0 - isReadable: 0 + isReadable: 1 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 diff --git a/Editor/Nodes/Fundamentals/Resources/YellowNode@Pro.png~ b/Editor/Nodes/Fundamentals/Resources/YellowNode@Pro.png~ new file mode 100644 index 00000000..488eebe5 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/YellowNode@Pro.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/action.png.meta b/Editor/Nodes/Fundamentals/Resources/action.png.meta index 669b37b0..ebbc4291 100644 --- a/Editor/Nodes/Fundamentals/Resources/action.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/action.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 66a9a41964d966e4c86d233bd6f8d89b TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -2443122451703809864 + second: action_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -32,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -51,17 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -71,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -83,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: WebGL maxTextureSize: 32 resizeAlgorithm: 0 @@ -95,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: action_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 8b8b96b0319481ed0800000000000000 + internalID: -2443122451703809864 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -110,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/action_bind.png.meta b/Editor/Nodes/Fundamentals/Resources/action_bind.png.meta index 632efdec..319eeaee 100644 --- a/Editor/Nodes/Fundamentals/Resources/action_bind.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/action_bind.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 4402956b7feb740498fa22721b9aa9aa TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -7450676809828138797 + second: action_bind_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: action_bind_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 3d004f5bae0e99890800000000000000 + internalID: -7450676809828138797 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/action_invoke.png.meta b/Editor/Nodes/Fundamentals/Resources/action_invoke.png.meta index a6de17c2..39a5217b 100644 --- a/Editor/Nodes/Fundamentals/Resources/action_invoke.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/action_invoke.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 47b3e114f09cd564bb4f4ab043d4ec18 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -4936398509209094756 + second: action_invoke_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -32,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -51,17 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -71,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -83,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: WebGL maxTextureSize: 32 resizeAlgorithm: 0 @@ -95,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: action_invoke_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: c95f2d4c5b36e7bb0800000000000000 + internalID: -4936398509209094756 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -110,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/action_unbind.png.meta b/Editor/Nodes/Fundamentals/Resources/action_unbind.png.meta index 2b8b1a2c..b08dd98c 100644 --- a/Editor/Nodes/Fundamentals/Resources/action_unbind.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/action_unbind.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 6ddeecdeeb651364497e8ada2bafbce2 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -8780413589175645765 + second: action_unbind_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: action_unbind_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: bb94c2c7c54b52680800000000000000 + internalID: -8780413589175645765 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/arrow_switch.png.meta b/Editor/Nodes/Fundamentals/Resources/arrow_switch.png.meta index e1866ec9..67ea40a9 100644 --- a/Editor/Nodes/Fundamentals/Resources/arrow_switch.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/arrow_switch.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 699544638e3fdf34a934cbc62071ce9e TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -8746015916261445969 + second: arrow_switch_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: arrow_switch_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: faee25fccd8ef9680800000000000000 + internalID: -8746015916261445969 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/arrow_switch@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/arrow_switch@Pro.png.meta index 4b132139..cd14b352 100644 --- a/Editor/Nodes/Fundamentals/Resources/arrow_switch@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/arrow_switch@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 8d037404751bfe94089d1cc02cbde389 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 8630225166393941869 + second: arrow_switch@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: arrow_switch@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: d6f1c8e5018b4c770800000000000000 + internalID: 8630225166393941869 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/comments.png.meta b/Editor/Nodes/Fundamentals/Resources/comments.png.meta index aa946c7a..43878d6d 100644 --- a/Editor/Nodes/Fundamentals/Resources/comments.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/comments.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: ccc59113899d16144abfff00c8c6ac00 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 1162305688406262261 + second: comments_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: comments_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 5f10fdd8dd6512010800000000000000 + internalID: 1162305688406262261 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/comments@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/comments@Pro.png.meta index 9728c5bb..998a11b2 100644 --- a/Editor/Nodes/Fundamentals/Resources/comments@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/comments@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: d1269308f936ea04880c12c71a396a69 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -626643602076209070 + second: comments@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: comments@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 250f979c6f6bd47f0800000000000000 + internalID: -626643602076209070 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/compiler.png.meta b/Editor/Nodes/Fundamentals/Resources/compiler.png.meta index f3469f57..73395ff6 100644 --- a/Editor/Nodes/Fundamentals/Resources/compiler.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/compiler.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 89cdddcd64212cd4ba9d1fb6e63456ac TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -7449348272413432575 + second: compiler_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -32,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: compiler_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 105a0aee6399e9890800000000000000 + internalID: -7449348272413432575 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/construction.png.meta b/Editor/Nodes/Fundamentals/Resources/construction.png.meta index bf6741c0..525983ef 100644 --- a/Editor/Nodes/Fundamentals/Resources/construction.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/construction.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: fd9ca61a4ce2a914b9b8d5ff01686054 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -2957230348993709125 + second: construction_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: construction_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: bbbb9396aaec5f6d0800000000000000 + internalID: -2957230348993709125 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/construction@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/construction@Pro.png.meta index 63d3ea75..08a4d529 100644 --- a/Editor/Nodes/Fundamentals/Resources/construction@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/construction@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 3bb43111e09e2ab48a392a5f963eb849 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -587603318458221593 + second: construction@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: construction@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 7ebf47625e968d7f0800000000000000 + internalID: -587603318458221593 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/construction_alarm.png.meta b/Editor/Nodes/Fundamentals/Resources/construction_alarm.png.meta index b5106116..d69b7c84 100644 --- a/Editor/Nodes/Fundamentals/Resources/construction_alarm.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/construction_alarm.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 1077aedace5382343b967adae1f9b61f TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -5821053049004359113 + second: construction_alarm_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: construction_alarm_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 732046bd717773fa0800000000000000 + internalID: -5821053049004359113 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/construction_alarm@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/construction_alarm@Pro.png.meta index 21e504bc..e29fdf93 100644 --- a/Editor/Nodes/Fundamentals/Resources/construction_alarm@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/construction_alarm@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: ebf777a7ff3ae5b4eb37b32930604801 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -2534544111285469864 + second: construction_alarm@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: construction_alarm@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 85d75433f8d73dcd0800000000000000 + internalID: -2534544111285469864 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/csharp_object.png.meta b/Editor/Nodes/Fundamentals/Resources/csharp_object.png.meta index 70ba59ed..b87f8b60 100644 --- a/Editor/Nodes/Fundamentals/Resources/csharp_object.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/csharp_object.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 452cccb926e9cac45be403f222640aa7 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 5703247039503450630 + second: csharp_object_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: csharp_object_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 602c6ef17f0062f40800000000000000 + internalID: 5703247039503450630 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/debug.png.meta b/Editor/Nodes/Fundamentals/Resources/debug.png.meta index 316fb67e..f7e96400 100644 --- a/Editor/Nodes/Fundamentals/Resources/debug.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/debug.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 5f7761fb336a5b34c89e0efe5e4a2284 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 2211457692393877659 + second: debug_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: debug_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: b9031feed0da0be10800000000000000 + internalID: 2211457692393877659 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/debug@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/debug@Pro.png.meta index 25ec31cd..e635d56b 100644 --- a/Editor/Nodes/Fundamentals/Resources/debug@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/debug@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 9c573ad1cf8d5ec4bb7a520d7406a574 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 831943065769279002 + second: debug@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: debug@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: a1ef68c7fc7ab8b00800000000000000 + internalID: 831943065769279002 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/enum.png.meta b/Editor/Nodes/Fundamentals/Resources/enum.png.meta index 93b06eb9..51f7441a 100644 --- a/Editor/Nodes/Fundamentals/Resources/enum.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/enum.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: f01daac08118ed04db30d5d5ab125af9 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -8579170797328981003 + second: enum_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: enum_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 5f32dcd3d99a0f880800000000000000 + internalID: -8579170797328981003 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/flow_reroute.png.meta b/Editor/Nodes/Fundamentals/Resources/flow_reroute.png.meta index 86c6caca..2b5781a5 100644 --- a/Editor/Nodes/Fundamentals/Resources/flow_reroute.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/flow_reroute.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: bfa5f2b45d8df8b4dbf19e8214e2b495 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -7016918166877906877 + second: flow_reroute_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: flow_reroute_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 348d14dba16ee9e90800000000000000 + internalID: -7016918166877906877 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/flow_reroute@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/flow_reroute@Pro.png.meta index 5c3b5d4d..99775568 100644 --- a/Editor/Nodes/Fundamentals/Resources/flow_reroute@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/flow_reroute@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 5921e2c74b20e544da0d07a49c203e71 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -5866422022505269018 + second: flow_reroute@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: flow_reroute@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 6e87b0e8048469ea0800000000000000 + internalID: -5866422022505269018 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/func.png.meta b/Editor/Nodes/Fundamentals/Resources/func.png.meta index 1d9ea5cf..4f0fb330 100644 --- a/Editor/Nodes/Fundamentals/Resources/func.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/func.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 8cb4543fe6d2b5d44a6ecf76b0c7f181 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -7558745195644824016 + second: func_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -32,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -51,17 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -71,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -83,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: WebGL maxTextureSize: 32 resizeAlgorithm: 0 @@ -95,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: func_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 03656e1ea41f91790800000000000000 + internalID: -7558745195644824016 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -110,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/func@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/func@Pro.png.meta index 9478b948..c6dcb0fd 100644 --- a/Editor/Nodes/Fundamentals/Resources/func@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/func@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 945f87ac4eeb289439c1c65452aebe63 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 6962744358758230732 + second: func@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -32,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -51,17 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -71,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -83,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: WebGL maxTextureSize: 32 resizeAlgorithm: 0 @@ -95,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: func@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: ccaa3a5aa13a0a060800000000000000 + internalID: 6962744358758230732 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -110,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/func_bind.png.meta b/Editor/Nodes/Fundamentals/Resources/func_bind.png.meta index 9d59d445..437a4e0b 100644 --- a/Editor/Nodes/Fundamentals/Resources/func_bind.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/func_bind.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 9494ba4e21e52ec4b87cb787216ce376 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 4089846634649229342 + second: func_bind_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: func_bind_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: e18181468dd02c830800000000000000 + internalID: 4089846634649229342 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/func_invoke.png.meta b/Editor/Nodes/Fundamentals/Resources/func_invoke.png.meta index 6a0b7967..0827405b 100644 --- a/Editor/Nodes/Fundamentals/Resources/func_invoke.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/func_invoke.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: af49d631d6f7c6f47befbd392ce8c29f TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 7693846368099355999 + second: func_invoke_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -32,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -51,17 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -71,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -83,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: WebGL maxTextureSize: 32 resizeAlgorithm: 0 @@ -95,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: func_invoke_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: f5dcdfe028806ca60800000000000000 + internalID: 7693846368099355999 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -110,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/func_invoke@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/func_invoke@Pro.png.meta index 1c47659f..18faa3ee 100644 --- a/Editor/Nodes/Fundamentals/Resources/func_invoke@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/func_invoke@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: d157b3ab92da9e34193a97c7178fd76b TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -2546925135384322829 + second: func_invoke@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -32,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -51,17 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -71,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -83,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: WebGL maxTextureSize: 32 resizeAlgorithm: 0 @@ -95,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: func_invoke@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 3fc57e3651187acd0800000000000000 + internalID: -2546925135384322829 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -110,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/func_unbind.png.meta b/Editor/Nodes/Fundamentals/Resources/func_unbind.png.meta index 985ea639..b2ff26c5 100644 --- a/Editor/Nodes/Fundamentals/Resources/func_unbind.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/func_unbind.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: a7d5048e0868c824fa9b1c288a266244 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 3626174985738485996 + second: func_unbind_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -51,7 +56,9 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 @@ -62,8 +69,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -73,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -85,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: func_unbind_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: ce0895eefe2c25230800000000000000 + internalID: 3626174985738485996 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -100,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/maximize_window.png b/Editor/Nodes/Fundamentals/Resources/maximize_window.png new file mode 100644 index 00000000..b5882d1e Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/maximize_window.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/maximize_window.png.meta similarity index 57% rename from Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected@Pro.png.meta rename to Editor/Nodes/Fundamentals/Resources/maximize_window.png.meta index 91faff7c..180fed81 100644 --- a/Editor/Nodes/Fundamentals/Resources/OrangeNodeSelected@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/maximize_window.png.meta @@ -1,10 +1,19 @@ fileFormatVersion: 2 -guid: cf4ac7c8e5d9bdb47a0c1c5cb314d962 +guid: 8805de16189fb0e4b8346f50bca7c529 TextureImporter: internalIDToNameTable: - first: - 213: -2916287662509644985 - second: NodeOrangebackgroundFocused_0 + 213: 483651635342203646 + second: maximize_window_0 + - first: + 213: 7101006333619695446 + second: maximize_window_1 + - first: + 213: 4153977732051321093 + second: maximize_window_2 + - first: + 213: -4090038546554417309 + second: maximize_window_3 externalObjects: {} serializedVersion: 13 mipmaps: @@ -37,7 +46,7 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: 0 + filterMode: 1 aniso: 1 mipBias: 0 wrapU: 1 @@ -57,7 +66,7 @@ TextureImporter: alphaUsage: 1 alphaIsTransparency: 1 spriteTessellationDetail: -1 - textureType: 2 + textureType: 8 textureShape: 1 singleChannelComponent: 0 flipbookRows: 1 @@ -75,19 +84,6 @@ TextureImporter: maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - ignorePlatformSupport: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 4 - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 @@ -97,7 +93,7 @@ TextureImporter: androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 4 - buildTarget: Android + buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -113,13 +109,79 @@ TextureImporter: serializedVersion: 2 sprites: - serializedVersion: 2 - name: NodeOrangebackgroundFocused_0 + name: maximize_window_0 rect: serializedVersion: 2 x: 0 + y: 9 + width: 7 + height: 7 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: efadb9f899646b600800000000000000 + internalID: 483651635342203646 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: maximize_window_1 + rect: + serializedVersion: 2 + x: 8 + y: 9 + width: 8 + height: 7 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 65f633f33a7db8260800000000000000 + internalID: 7101006333619695446 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: maximize_window_2 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 7 + height: 8 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 5014dc31db4e5a930800000000000000 + internalID: 4153977732051321093 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: maximize_window_3 + rect: + serializedVersion: 2 + x: 8 y: 0 - width: 64 - height: 64 + width: 8 + height: 8 alignment: 0 pivot: {x: 0, y: 0} border: {x: 0, y: 0, z: 0, w: 0} @@ -128,8 +190,8 @@ TextureImporter: physicsShape: [] tessellationDetail: -1 bones: [] - spriteID: 743224572d34787d0800000000000000 - internalID: -2916287662509644985 + spriteID: 36f08f2ac934d37c0800000000000000 + internalID: -4090038546554417309 vertices: [] indices: edges: [] @@ -148,7 +210,10 @@ TextureImporter: spriteCustomMetadata: entries: [] nameFileIdTable: - NodeOrangebackgroundFocused_0: -2916287662509644985 + maximize_window_0: 483651635342203646 + maximize_window_1: 7101006333619695446 + maximize_window_2: 4153977732051321093 + maximize_window_3: -4090038546554417309 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Editor/Nodes/Fundamentals/Resources/maximize_window.png~ b/Editor/Nodes/Fundamentals/Resources/maximize_window.png~ new file mode 100644 index 00000000..c1a2b515 Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/maximize_window.png~ differ diff --git a/Editor/Nodes/Fundamentals/Resources/maximize_window@Pro.png b/Editor/Nodes/Fundamentals/Resources/maximize_window@Pro.png new file mode 100644 index 00000000..f11acc5e Binary files /dev/null and b/Editor/Nodes/Fundamentals/Resources/maximize_window@Pro.png differ diff --git a/Editor/Nodes/Fundamentals/Resources/maximize_window@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/maximize_window@Pro.png.meta new file mode 100644 index 00000000..930391d1 --- /dev/null +++ b/Editor/Nodes/Fundamentals/Resources/maximize_window@Pro.png.meta @@ -0,0 +1,221 @@ +fileFormatVersion: 2 +guid: f088d90dc25b1a74a8c9cb497360816a +TextureImporter: + internalIDToNameTable: + - first: + 213: 522147507449358955 + second: maximize_window@Pro_0 + - first: + 213: 6437306139057194154 + second: maximize_window@Pro_1 + - first: + 213: 4073647287266456412 + second: maximize_window@Pro_2 + - first: + 213: -1757327065219563420 + second: maximize_window@Pro_3 + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: + - serializedVersion: 2 + name: maximize_window@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 9 + width: 7 + height: 7 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: b6aefdd346a0f3700800000000000000 + internalID: 522147507449358955 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: maximize_window@Pro_1 + rect: + serializedVersion: 2 + x: 9 + y: 9 + width: 7 + height: 7 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: aa402f0c3d7e55950800000000000000 + internalID: 6437306139057194154 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: maximize_window@Pro_2 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 7 + height: 7 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: c5330c9ef90888830800000000000000 + internalID: 4073647287266456412 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: maximize_window@Pro_3 + rect: + serializedVersion: 2 + x: 8 + y: 0 + width: 8 + height: 8 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 460886b4858bc97e0800000000000000 + internalID: -1757327065219563420 + vertices: [] + indices: + edges: [] + weights: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: + maximize_window@Pro_0: 522147507449358955 + maximize_window@Pro_1: 6437306139057194154 + maximize_window@Pro_2: 4073647287266456412 + maximize_window@Pro_3: -1757327065219563420 + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/multi_array.png.meta b/Editor/Nodes/Fundamentals/Resources/multi_array.png.meta index c5f404fa..526551cf 100644 --- a/Editor/Nodes/Fundamentals/Resources/multi_array.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/multi_array.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 9f00e7c622dd4564396b0b8de4909fae TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -7576459816472948428 + second: multi_array_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: multi_array_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 431db1050f10bd690800000000000000 + internalID: -7576459816472948428 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/multi_array@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/multi_array@Pro.png.meta index a084a6fe..92a92821 100644 --- a/Editor/Nodes/Fundamentals/Resources/multi_array@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/multi_array@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: d3fb4a6b841b3cd46ae3d4a31400519a TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -274064474052485005 + second: multi_array@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: multi_array@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 3702c8a10d3523cf0800000000000000 + internalID: -274064474052485005 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/value_reroute.png.meta b/Editor/Nodes/Fundamentals/Resources/value_reroute.png.meta index 02a5df92..e845ae97 100644 --- a/Editor/Nodes/Fundamentals/Resources/value_reroute.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/value_reroute.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 2a25bc6b0361b4944a2ddbf88bfde9f3 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -6974927983582013048 + second: value_reroute_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: value_reroute_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 88999a424f3143f90800000000000000 + internalID: -6974927983582013048 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/value_reroute@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/value_reroute@Pro.png.meta index 3f99e578..370a56db 100644 --- a/Editor/Nodes/Fundamentals/Resources/value_reroute@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/value_reroute@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 3775222eebaadb346a068e93636abcd9 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -6476312399558390610 + second: value_reroute@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,12 +95,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: value_reroute@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: eac4dd18f248f16a0800000000000000 + internalID: -6476312399558390610 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -96,9 +134,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/variableevent.png.meta b/Editor/Nodes/Fundamentals/Resources/variableevent.png.meta index 2ad28a5c..8c7219c2 100644 --- a/Editor/Nodes/Fundamentals/Resources/variableevent.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/variableevent.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: d89bc54c16777624e9d0ab2139b4e46c TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 7598949062803533970 + second: variableevent_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: variableevent_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 29031b269e3e47960800000000000000 + internalID: 7598949062803533970 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/variableevent@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/variableevent@Pro.png.meta index 9b636f6c..e7bb855a 100644 --- a/Editor/Nodes/Fundamentals/Resources/variableevent@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/variableevent@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: ceca253ec9e02714eaa7e21489129647 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 7168171767424500122 + second: variableevent@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: variableevent@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: a91425e6e367a7360800000000000000 + internalID: 7168171767424500122 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/weather_clouds.png.meta b/Editor/Nodes/Fundamentals/Resources/weather_clouds.png.meta index 3ac749e9..356e1eea 100644 --- a/Editor/Nodes/Fundamentals/Resources/weather_clouds.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/weather_clouds.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 1d88ff96bc2a36648a7e6203b71cf510 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 8688097949491428416 + second: weather_clouds_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: weather_clouds_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 04c7c35bd03529870800000000000000 + internalID: 8688097949491428416 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Resources/weather_clouds@Pro.png.meta b/Editor/Nodes/Fundamentals/Resources/weather_clouds@Pro.png.meta index d4b6dcee..30dfbab5 100644 --- a/Editor/Nodes/Fundamentals/Resources/weather_clouds@Pro.png.meta +++ b/Editor/Nodes/Fundamentals/Resources/weather_clouds@Pro.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: c82c8de1ca0582e4e9a7b0a64b48391c TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: -5802412334592017593 + second: weather_clouds@Pro_0 externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,12 +37,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 1 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -50,16 +56,23 @@ TextureImporter: spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationMethod: 0 spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 32 resizeAlgorithm: 0 @@ -69,9 +82,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 32 resizeAlgorithm: 0 @@ -81,9 +95,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 32 resizeAlgorithm: 0 @@ -93,12 +108,36 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: weather_clouds@Pro_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 32 + height: 32 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 74b3c4469b0b97fa0800000000000000 + internalID: -5802412334592017593 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -108,9 +147,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Nodes/Fundamentals/Widgets/ArrowWidget.cs b/Editor/Nodes/Fundamentals/Widgets/ArrowWidget.cs index 4ec437f7..de47a12f 100644 --- a/Editor/Nodes/Fundamentals/Widgets/ArrowWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/ArrowWidget.cs @@ -21,18 +21,20 @@ public ArrowWidget(FlowCanvas canvas, Arrow unit) : base(canvas, unit) public override float zIndex { - get - { - return float.MaxValue; - } + get => float.MaxValue; set { } } - +#if NEW_UNIT_UI + protected override bool AllowRectSnapping => false; +#endif public override bool canClip => false; Vector3 lineStart; Vector3 lineEnd; + public override void DrawForeground() { + Color originalHandlesColor = Handles.color; + Vector3 unitCenter = new Vector3(position.x + position.width / 2f, position.y + position.height / 2f); Vector3 direction = Quaternion.Euler(0f, 0f, unit.rotationAngle) * Vector3.right; @@ -56,7 +58,6 @@ public override void DrawForeground() Vector3 arrowTipEnd = lineEnd + (lineEnd - lineStart).normalized * arrowHeight; if (unit.ShowTopArrow) DrawArrow(arrowTipStart, lineStart, unit.ArrowColor); - if (unit.ShowBottomArrow) DrawArrow(arrowTipEnd, lineEnd, unit.ArrowColor); if (unit.ShowCenter) @@ -66,7 +67,7 @@ public override void DrawForeground() DrawTextField((lineStart + lineEnd) / 2f, unit.Text); - Handles.color = Color.white; + Handles.color = originalHandlesColor; SendToBack(); } @@ -83,28 +84,25 @@ private void DrawArrow(Vector3 arrowTip, Vector3 arrowBase, Color arrowColor) arrowTip + arrowSide2 * arrowWidth }; + Color prev = Handles.color; Handles.color = arrowColor; Handles.DrawAAConvexPolygon(arrowPoints); + Handles.color = prev; } private void DrawUnitPosition(Vector3 unitCenter) { float halfSize = arrowHandle / 2f; - if (isMouseOver) - { - Handles.color = Color.black; - } - else - { - Handles.color = Color.white; - } + Color prev = Handles.color; + Handles.color = isMouseOver ? Color.black : Color.white; Handles.DrawAAConvexPolygon( unitCenter + new Vector3(-halfSize, -halfSize, 0f), unitCenter + new Vector3(-halfSize, halfSize, 0f), unitCenter + new Vector3(halfSize, halfSize, 0f), unitCenter + new Vector3(halfSize, -halfSize, 0f) ); + Handles.color = prev; } protected override IEnumerable contextOptions => base.contextOptions.Where(c => c.label != "Replace..."); @@ -177,7 +175,7 @@ public override void HandleInput() if (e.rawType == EventType.MouseDown && !canvas.isSelecting && over) { - if (e.mouseButton == 0) + if (e.mouseButton == MouseButton.Left) { Select(); GUI.changed = true; @@ -189,7 +187,7 @@ public override void HandleInput() e.Use(); } - if (e.clickCount == 2 && e.mouseButton == 0 && overLine) + if (e.clickCount == 2 && overLine) { Vector2 canvasCenter = canvas.pan + canvas.viewport.center; Vector3 furthestEnd = Vector2.Distance(lineStart, canvasCenter) > Vector2.Distance(lineEnd, canvasCenter) ? lineStart : lineEnd; @@ -334,40 +332,42 @@ private static float DistanceToLine(Vector2 point, Vector2 a, Vector2 b) return Vector2.Distance(point, closest); } - private void DrawTextField(Vector3 position, string text) + private void DrawTextField(Vector3 canvasPosition, string text) { - GUIStyle style = new GUIStyle(GUI.skin.label); - style.alignment = TextAnchor.MiddleCenter; + if (string.IsNullOrEmpty(text)) return; - Vector2 screenPos = HandleUtility.WorldToGUIPoint(position); + GUIStyle style = new GUIStyle(GUI.skin.label) + { + alignment = TextAnchor.MiddleCenter + }; GUIContent content = new GUIContent(text); Vector2 textSize = style.CalcSize(content); - Rect labelRect = new Rect(screenPos.x - textSize.x / 2f, screenPos.y - textSize.y / 2f, textSize.x, textSize.y); + Rect labelRect = new Rect(canvasPosition.x - textSize.x / 2f, canvasPosition.y - textSize.y / 2f, textSize.x, textSize.y); - Handles.BeginGUI(); + Color originalColor = GUI.contentColor; + GUI.contentColor = Color.white; GUI.Label(labelRect, content, style); - Handles.EndGUI(); + GUI.contentColor = originalColor; } private void DrawDottedLine(Vector3 start, Vector3 end, float segmentLength, float gapLength = 5f) { Vector3 direction = (end - start).normalized; - Vector3 currentPosition = start; while (Vector3.Distance(currentPosition, end) > segmentLength) { Vector3 segmentEnd = currentPosition + direction * segmentLength; - Handles.DrawAAPolyLine(currentPosition, segmentEnd); + Handles.DrawAAPolyLine(lineWidth, currentPosition, segmentEnd); currentPosition = segmentEnd + direction * gapLength; } if (Vector3.Distance(currentPosition, end) > 0f) { - Handles.DrawAAPolyLine(currentPosition, end); + Handles.DrawAAPolyLine(lineWidth, currentPosition, end); } } } -} +} \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Widgets/CommentNodeWidget.cs b/Editor/Nodes/Fundamentals/Widgets/CommentNodeWidget.cs index 949a8950..87b9bb86 100644 --- a/Editor/Nodes/Fundamentals/Widgets/CommentNodeWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/CommentNodeWidget.cs @@ -27,10 +27,7 @@ public sealed class CommentNodeWidget : UnitWidget public override float zIndex { - get - { - return float.MaxValue; - } + get => float.MaxValue; set { } } @@ -40,21 +37,16 @@ const float borderText = 3f, borderTotal = borderOutside * 2f + borderInside * 2f + borderText * 2f; - Rect - wholeRect, - borderRect, - textRect; - - Vector2 - textAreaSize; - + Rect wholeRect, borderRect, textRect; + Vector2 textAreaSize; int hash; GUIStyle textGUI, titleGUI; public override Rect position { - get => unit.wholeRect; set => unit.wholeRect = value; + get => unit.wholeRect; + set => unit.wholeRect = value; } public override bool canClip => false; @@ -72,45 +64,37 @@ void MigrateRects() textRect = default; } } + private bool createdStyles; + public override void DrawBackground() { if (!createdStyles) { createdStyles = true; - // Move creation of styles here stop GUI errors since this widget could be created on load - // Not during OnGUI textGUI = new GUIStyle(GUI.skin.label) { richText = true, wordWrap = true }; titleGUI = new GUIStyle(GUI.skin.label) { richText = true, wordWrap = true, alignment = TextAnchor.MiddleLeft, fontSize = 10 }; } if (hash == 0) hash = unit.GetHashCode(); - // If first time running, create a palette. if (!CommentNodeInspector.initialised) { CommentNodeInspector.UpdatePalette(); CommentNodeInspector.initialised = true; } - // If unit locked to palette, grab the assigned color if (unit.lockedToPalette) { unit.color = CommentNodeInspector.colorPalette[unit.customPalette ? 1 : 0, unit.paletteSelection.row, unit.paletteSelection.col] / 3f; unit.fontColor = CommentNodeInspector.fontPalette[unit.customPalette ? 2 : unit.fontColorize ? 1 : 0, unit.paletteSelection.row, unit.paletteSelection.col]; } - // Set text area GUI style textGUI.fontStyle = unit.fontBold && unit.fontItalic ? FontStyle.BoldAndItalic : unit.fontBold ? FontStyle.Bold : unit.fontItalic ? FontStyle.Italic : FontStyle.Normal; textGUI.fontSize = unit.fontSize; textGUI.alignment = unit.alignCentre ? TextAnchor.MiddleCenter : TextAnchor.MiddleLeft; - // Get text area xy size textAreaSize = textGUI.CalcSizeWithConstraints(new GUIContent(unit.comment), new Vector2(Mathf.Round(unit.maxWidth - borderTotal), 1000f)); textAreaSize.y = textGUI.CalcHeight(new GUIContent(unit.comment), unit.maxWidth - borderTotal); - // Set whole area rect unit.wholeRect = new Rect(unit.position.x, unit.position.y, unit.hasTitle ? Mathf.Max(titleGUI.CalcSize(new GUIContent(unit.title)).x + borderTotal, Mathf.Clamp(textAreaSize.x + borderTotal, unit.autoWidth ? borderTotal : unit.maxWidth, unit.maxWidth)) : Mathf.Clamp(textAreaSize.x + borderTotal, unit.autoWidth ? borderTotal : unit.maxWidth, unit.maxWidth), Mathf.Clamp(textAreaSize.y + borderTotal, borderTotal, 1000)); - // Resource - https://unitylist.com/p/5c3/Unity-editor-icons - - // Draw border if mouse present if (unit.wholeRect.Contains(e.mousePosition) || selection.Contains(unit)) { GUI.DrawTexture(unit.wholeRect, Texture2D.whiteTexture, ScaleMode.ScaleAndCrop, true, 0, unit.color * new Color(0.5f, 0.5f, 0.5f, 0.5f), 0, borderOutside); @@ -118,7 +102,7 @@ public override void DrawBackground() List invalidIndexs = new List(); int index = 0; - // Draw connections to other units + foreach (var connectedElement in unit.connectedElements) { if (connectedElement == null || !canvas.widgetProvider.IsValid(connectedElement)) @@ -128,13 +112,14 @@ public override void DrawBackground() } var elementWidget = canvas.Widget(connectedElement); var lineColor = unit.color; + if (unit.curvedLine) { Vector3 start = new Vector3(unit.position.x + unit.wholeRect.width / 2, unit.position.y + unit.wholeRect.height / 2, 0); Vector3 end = GetElementPosition(connectedElement, elementWidget); var targetEdge = CompareVectors(start, end); Vector3 connectionEnd = CorrectLineEnd(targetEdge, new Vector2(GetEdgePosition(elementWidget.position, targetEdge, connectedElement).x, GetEdgePosition(elementWidget.position, targetEdge, connectedElement).y)); - // Draw the connection + GraphGUI.DrawConnection( lineColor, start, @@ -159,9 +144,12 @@ public override void DrawBackground() var targetEdge = CompareVectors(start, end); Vector3 connectionEnd = CorrectLineEnd(targetEdge, new Vector2(GetEdgePosition(elementWidget.position, targetEdge, connectedElement).x, GetEdgePosition(elementWidget.position, targetEdge, connectedElement).y)); Vector3[] points = { start, connectionEnd }; + + Color prevHandles = Handles.color; Handles.color = lineColor; Handles.DrawAAPolyLine(5f, points); - Handles.color = Color.white; + Handles.color = prevHandles; + Edge edge = CompareVectors(start, end); Vector3 arrowBase = GetEdgePosition(elementWidget.position, edge, connectedElement); DrawArrowheadAtEnd(arrowBase, edge, lineColor); @@ -174,13 +162,12 @@ public override void DrawBackground() unit.connectedElements.RemoveAt(_index); } - // Get inner area rect unit.borderRect = unit.wholeRect.Offset(xy: borderOutside, centre: true); - // Draw border GUI.DrawTexture(unit.borderRect, Texture2D.whiteTexture, ScaleMode.ScaleAndCrop, true, 0, unit.color, 0, 7); GUI.DrawTexture(unit.borderRect, Texture2D.whiteTexture, ScaleMode.ScaleAndCrop, true, 0, unit.color * (2f - unit.color.grayscale), borderInside, 7); } + private Vector2 GetElementPosition(IGraphElement graphElement, IGraphElementWidget elementWidget) { if (graphElement is GraphGroup graphGroup) @@ -251,24 +238,23 @@ void DrawArrowheadAtEnd(Vector3 arrowBase, Edge edge, Color color) throw new System.ArgumentException("Invalid edge specified for arrowhead."); } - // Calculate arrowhead points (tip + two side points) Vector3 leftPoint = arrowBase + (direction * arrowLength) + (perpendicular * arrowWidth); Vector3 rightPoint = arrowBase + (direction * arrowLength) - (perpendicular * arrowWidth); - // Create the arrowhead polygon points (tip and sides) Vector3[] arrowPoints = new Vector3[] { - arrowBase, - leftPoint, - rightPoint + arrowBase, + leftPoint, + rightPoint }; + Color prevColor = Handles.color; Handles.color = color; - Handles.DrawAAConvexPolygon(arrowPoints); - - Handles.color = Color.white; + Handles.DrawAAPolyLine(3f, new Vector3[] { leftPoint, arrowBase, rightPoint, leftPoint }); + Handles.color = prevColor; } + #if VISUAL_SCRIPTING_1_8_0_OR_GREATER public Vector2 GetEdgePosition(Rect target, Edge edge, IGraphElement graphElement) { @@ -276,11 +262,7 @@ public Vector2 GetEdgePosition(Rect target, Edge edge, IGraphElement graphElemen { case Edge.Top: { - if (graphElement is GraphGroup or StickyNote) - { - return new Vector2(target.center.x, target.yMin); - } - else if (graphElement is CommentNode) + if (graphElement is GraphGroup || graphElement is StickyNote || graphElement is CommentNode) { return new Vector2(target.center.x, target.yMin); } @@ -288,11 +270,7 @@ public Vector2 GetEdgePosition(Rect target, Edge edge, IGraphElement graphElemen } case Edge.Bottom: { - if (graphElement is GraphGroup or StickyNote) - { - new Vector2(target.center.x, target.yMax); - } - else if (graphElement is CommentNode) + if (graphElement is GraphGroup || graphElement is StickyNote || graphElement is CommentNode) { return new Vector2(target.center.x, target.yMax); } @@ -329,11 +307,7 @@ public Vector2 GetEdgePosition(Rect target, Edge edge, IGraphElement graphElemen { case Edge.Top: { - if (graphElement is GraphGroup) - { - return new Vector2(target.center.x, target.yMin); - } - else if (graphElement is CommentNode) + if (graphElement is GraphGroup || graphElement is CommentNode) { return new Vector2(target.center.x, target.yMin); } @@ -341,11 +315,7 @@ public Vector2 GetEdgePosition(Rect target, Edge edge, IGraphElement graphElemen } case Edge.Bottom: { - if (graphElement is GraphGroup) - { - new Vector2(target.center.x, target.yMax); - } - else if (graphElement is CommentNode) + if (graphElement is GraphGroup || graphElement is CommentNode) { return new Vector2(target.center.x, target.yMax); } @@ -376,6 +346,7 @@ public Vector2 GetEdgePosition(Rect target, Edge edge, IGraphElement graphElemen } } #endif + public Edge CompareVectors(Vector2 first, Vector2 second) { float deltaX = second.x - first.x; @@ -405,12 +376,16 @@ public Edge CalculateStartEnd(Vector2 first, Vector2 second) return (deltaX > 0) ? Edge.Left : Edge.Right; } } - +#if NEW_UNIT_UI + protected override bool AllowRectSnapping => false; +#endif public override void HandleInput() { base.HandleInput(); - if (canvas.selection.Contains(unit)) + bool isEditingText = GUI.GetNameOfFocusedControl() == "commentField" + hash; + + if (!isEditingText && canvas.selection.Contains(unit) && e.freeType == EventType.KeyDown && !e.ctrlOrCmd && !e.alt && !e.shift) { if (e.keyCode == KeyCode.C) { @@ -423,12 +398,12 @@ public override void HandleInput() } } Reposition(); + e.Use(); } else if (e.keyCode == KeyCode.X) { metadata["connectedElements"].RecordUndo(); - var connectedElements = new List(); - connectedElements.AddRange(unit.connectedElements); + var connectedElements = new List(unit.connectedElements); foreach (var element in connectedElements) { if (unit.connectedElements.Contains(element) && canvas.selection.Contains(element)) @@ -437,6 +412,7 @@ public override void HandleInput() } } Reposition(); + e.Use(); } } } @@ -468,58 +444,54 @@ protected override IEnumerable contextOptions public override void DrawForeground() { - GUI.contentColor = Color.white; - if (unit.hasTitle) - EditorGUI.LabelField(new Rect(unit.position.x + borderOutside + 7f, unit.position.y, unit.wholeRect.width, borderOutside), unit.title, titleGUI); - - GUI.contentColor = unit.fontColor; + Color originalContentColor = GUI.contentColor; - unit.textRect = unit.borderRect.Offset(xy: borderText, centre: true); - // If mouse hovering over unit - if (unit.textRect.Contains(e.mousePosition)) + try { - GUI.SetNextControlName("commentField" + hash.ToString()); - EditorGUI.BeginChangeCheck(); - var comment = EditorGUI.TextArea(unit.textRect, unit.comment, textGUI); - if (EditorGUI.EndChangeCheck()) + if (unit.hasTitle) { - metadata["comment"].RecordUndo(); - metadata["comment"].value = comment; + GUI.contentColor = Color.white; + EditorGUI.LabelField(new Rect(unit.position.x + borderOutside + 7f, unit.position.y, unit.wholeRect.width, borderOutside), unit.title, titleGUI); } - return; - } - // Draw main comment - // If unit text selected - else if (GUI.GetNameOfFocusedControl() == "commentField" + hash.ToString()) - { - EditorGUI.BeginChangeCheck(); - var comment = EditorGUI.TextArea(unit.textRect, unit.comment, textGUI); - if (EditorGUI.EndChangeCheck()) + + GUI.contentColor = unit.fontColor; + unit.textRect = unit.borderRect.Offset(xy: borderText, centre: true); + + string controlName = "commentField" + hash; + if (unit.textRect.Contains(e.mousePosition) || GUI.GetNameOfFocusedControl() == controlName) { - metadata["comment"].RecordUndo(); - metadata["comment"].value = comment; + GUI.SetNextControlName(controlName); + EditorGUI.BeginChangeCheck(); + var comment = EditorGUI.TextArea(unit.textRect, unit.comment, textGUI); + if (EditorGUI.EndChangeCheck()) + { + metadata["comment"].RecordUndo(); + metadata["comment"].value = comment; + } + return; } - GUI.contentColor = Color.white; - return; - } - // Draw outline? - if (unit.hasOutline) - { - GUI.contentColor = unit.fontColor.maxColorComponent > 0.5f ? unit.color * 0.9f * (unit.color.maxColorComponent / 1f) : (unit.color * 0.9f * (1f / unit.color.maxColorComponent)).WithAlpha(1f); + if (unit.hasOutline) + { + GUI.contentColor = unit.fontColor.maxColorComponent > 0.5f + ? unit.color * 0.9f * (unit.color.maxColorComponent / 1f) + : (unit.color * 0.9f * (1f / unit.color.maxColorComponent)).WithAlpha(1f); + + float outline = Mathf.Max(unit.fontSize / 60f, 1f); + EditorGUI.LabelField(unit.textRect.Offset(x: -outline, y: -outline), unit.comment, new GUIStyle(textGUI) { fontSize = unit.fontSize + 1 }); + EditorGUI.LabelField(unit.textRect.Offset(x: outline, y: outline), unit.comment, new GUIStyle(textGUI) { fontSize = unit.fontSize + 1 }); + EditorGUI.LabelField(unit.textRect.Offset(x: -outline, y: outline), unit.comment, new GUIStyle(textGUI) { fontSize = unit.fontSize + 1 }); + EditorGUI.LabelField(unit.textRect.Offset(x: outline, y: -outline), unit.comment, new GUIStyle(textGUI) { fontSize = unit.fontSize + 1 }); + GUI.contentColor = unit.fontColor; + } - float outline = Mathf.Max(unit.fontSize / 60f, 1f); - EditorGUI.LabelField(unit.textRect.Offset(x: -outline, y: -outline), unit.comment, new GUIStyle(textGUI) { fontSize = unit.fontSize + 1 }); - EditorGUI.LabelField(unit.textRect.Offset(x: outline, y: outline), unit.comment, new GUIStyle(textGUI) { fontSize = unit.fontSize + 1 }); - EditorGUI.LabelField(unit.textRect.Offset(x: -outline, y: outline), unit.comment, new GUIStyle(textGUI) { fontSize = unit.fontSize + 1 }); - EditorGUI.LabelField(unit.textRect.Offset(x: outline, y: -outline), unit.comment, new GUIStyle(textGUI) { fontSize = unit.fontSize + 1 }); - GUI.contentColor = unit.fontColor; + EditorGUI.LabelField(unit.textRect, unit.comment, textGUI); + unit.position = unit.wholeRect.position; + } + finally + { + GUI.contentColor = originalContentColor; } - - EditorGUI.LabelField(unit.textRect, unit.comment, textGUI); - GUI.contentColor = Color.white; - - unit.position = unit.wholeRect.position; } } } \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Widgets/FuzzyLiteralWidget.cs b/Editor/Nodes/Fundamentals/Widgets/FuzzyLiteralWidget.cs index c9b47361..087194d0 100644 --- a/Editor/Nodes/Fundamentals/Widgets/FuzzyLiteralWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/FuzzyLiteralWidget.cs @@ -13,7 +13,7 @@ public FuzzyLiteralWidget(FlowCanvas canvas, FuzzyLiteral unit) : base(canvas, u public override void DrawForeground() { - var Literal = new Literal(unit.type, unit.value); + var Literal = new Literal(unit.type ?? typeof(int), unit.value ?? 0); var unitPosition = unit.position; var preservation = UnitPreservation.Preserve(unit); context.BeginEdit(); diff --git a/Editor/Nodes/Fundamentals/Widgets/LiteralWidget.cs b/Editor/Nodes/Fundamentals/Widgets/LiteralWidget.cs index d8a3c518..f17eb67b 100644 --- a/Editor/Nodes/Fundamentals/Widgets/LiteralWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/LiteralWidget.cs @@ -1,4 +1,4 @@ -# if NEW_UNIT_UI +#if NEW_UNIT_UI using UnityEditor; using UnityEngine; using System.Linq; @@ -55,74 +55,73 @@ public override void CachePosition() var edgeX = edgeOrigin.x; var edgeY = edgeOrigin.y; - const float compactX = 0.8f; + iconPosition = new Rect(edgeX, edgeY, 0, 0); + titlePosition = new Rect(edgeX, edgeY, 0, 0); - var titleWidth = Styles.title.CalcSize(titleContent).x; - var iconSize = Styles.iconSize; - var innerY = edgeY; - var innerX = edgeX; - - iconPosition = new Rect(innerX, innerY, iconSize, iconSize); - - titlePosition = new Rect( - iconPosition.xMax + Styles.spaceAfterIcon * compactX, - innerY, - titleWidth, - iconSize - ); + var validOutput = outputs.OfType().FirstOrDefault(); - var totalWidth = titlePosition.xMax + 20f - edgeX; - var totalHeight = iconSize; + var invalidInputs = inputs.Cast().ToList(); + var invalidOutputs = outputs.Cast() + .Where(p => p != validOutput) + .ToList(); + float addonWidth = 0f; + float addonHeight = 0f; if (showHeaderAddon) { - var width = GetHeaderAddonWidth(); - var height = GetHeaderAddonHeight(width); - - headerAddonPosition = new Rect( - titlePosition.x, - titlePosition.yMax + 2f, - width, - height - ); - - totalWidth = Mathf.Max(totalWidth, headerAddonPosition.xMax + 20f - edgeX); - totalHeight = headerAddonPosition.yMax - edgeY; + addonWidth = GetHeaderAddonWidth(); + addonHeight = GetHeaderAddonHeight(addonWidth); } - var validOutput = outputs.OfType().FirstOrDefault(); - var invalidOutputs = outputs - .Where(p => p is InvalidOutputWidget) - .Cast() - .ToList(); - - float portsStartY = edgeY + totalHeight + Styles.spaceBetweenPorts; - + float inspectorX = edgeX + 5f; +#if !NEW_UNIT_STYLE + headerAddonPosition = new Rect(inspectorX, edgeY + 4.5f, addonWidth, addonHeight); +#else + headerAddonPosition = new Rect(inspectorX, edgeY + 2f, addonWidth, addonHeight); +#endif if (validOutput != null) { - float visualCenterY = Styles.spaceBetweenPorts + edgeY + (totalHeight / 2f) - (validOutput.GetHeight() / 2f); - validOutput.y = visualCenterY; + validOutput.y = headerAddonPosition.y + (addonHeight / 2f) - (validOutput.GetHeight() / 2f); +#if !NEW_UNIT_STYLE + validOutput.y += 2.5f; +#endif + } - portsStartY += validOutput.GetHeight() + Styles.spaceBetweenPorts; + bool hasInvalidPorts = false; + float inputY = headerAddonPosition.y + addonHeight + 10f; + float maxInputWidth = 0f; + foreach (var port in invalidInputs) + { + hasInvalidPorts = true; - totalWidth += validOutput.GetInnerWidth(); + port.y = inputY; + inputY += port.GetHeight() + Styles.spaceBetweenPorts; + maxInputWidth = Mathf.Max(maxInputWidth, port.GetInnerWidth()); } + float outputY = (validOutput != null) ? validOutput.y + validOutput.GetHeight() + Styles.spaceBetweenPorts : headerAddonPosition.y; + float maxOutputWidth = (validOutput != null) ? validOutput.GetInnerWidth() : 0f; + + var invalidOutputY = headerAddonPosition.y + addonHeight + 10f; + foreach (var port in invalidOutputs) { - port.y = portsStartY; - portsStartY += port.GetHeight() + Styles.spaceBetweenPorts; + hasInvalidPorts = true; - totalWidth = Mathf.Max( - totalWidth, - port.GetInnerWidth() + 20f - ); + port.y = invalidOutputY; + invalidOutputY += port.GetHeight() + Styles.spaceBetweenPorts; + maxOutputWidth = Mathf.Max(maxOutputWidth, port.GetInnerWidth()); } - if (invalidOutputs.Count > 0) - { - totalHeight = portsStartY - edgeY; - } + float totalWidth = 15f + addonWidth + maxInputWidth + maxOutputWidth; + +#if NEW_UNIT_STYLE + const float heightPadding = 0; +#else + const float heightPadding = 5; +#endif + + float totalHeight = !hasInvalidPorts ? headerAddonPosition.height + heightPadding : Mathf.Max(headerAddonPosition.height + heightPadding, inputY - edgeY, outputY - edgeY); _position = new Rect(edgeX, edgeY, totalWidth, totalHeight); } diff --git a/Editor/Nodes/Fundamentals/Widgets/ManualEventWidget.cs b/Editor/Nodes/Fundamentals/Widgets/ManualEventWidget.cs index b9346ae8..5c241c3c 100644 --- a/Editor/Nodes/Fundamentals/Widgets/ManualEventWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/ManualEventWidget.cs @@ -15,8 +15,12 @@ public ManualEventWidget(FlowCanvas canvas, ManualEvent unit) : base(canvas, uni public override void DrawForeground() { base.DrawForeground(); - - var buttonPosition = new Rect(position.x + 1, position.y + 40 + 5, position.width - 8 + 6, 24); +#if NEW_UNIT_STYLE + const int yPadding = 48; +#else + const int yPadding = 45; +#endif + var buttonPosition = new Rect(position.x + 1, position.y + yPadding, position.width - 8 + 6, 24); if (GUI.Button(buttonPosition, "Trigger")) { diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ControlConnectionWidget.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ControlConnectionWidget.cs index cbef37c3..d6409f91 100644 --- a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ControlConnectionWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ControlConnectionWidget.cs @@ -35,57 +35,9 @@ protected override void DrawDroplet(Rect position) } } - protected override void DrawConnection() - { - var color = this.color; - - var sourceWidget = canvas.Widget(connection.source); - var destinationWidget = canvas.Widget(connection.destination); - - var highlight = !canvas.isCreatingConnection && (sourceWidget.isMouseOver || destinationWidget.isMouseOver); - - var willDisconnect = sourceWidget.willDisconnect || destinationWidget.willDisconnect; - - if (willDisconnect) - { - color = UnitConnectionStyles.disconnectColor; - } - else if (highlight) - { - color = UnitConnectionStyles.highlightColor; - } - else if (colorIfActive) - { - if (EditorApplication.isPaused) - { - if (EditorTimeBinding.frame == ConnectionDebugData.lastInvokeFrame) - { - color = UnitConnectionStyles.activeColor; - } - } - else - { - color = Color.Lerp(UnitConnectionStyles.activeColor, color, (EditorTimeBinding.time - ConnectionDebugData.lastInvokeTime) / UnitWidget.Styles.invokeFadeDuration); - } - } + protected override Edge sourceEdge => Edge.Bottom; - float minBend = 20f; - - var thickness = 3; - - GraphGUI.DrawConnection( - color, - sourceHandleEdgeCenter, - destinationHandleEdgeCenter, - Edge.Bottom, - Edge.Top, - null, - Vector2.zero, - UnitConnectionStyles.relativeBend, - minBend, - thickness - ); - } + protected override Edge destinationEdge => Edge.Top; #endregion diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ControlInputWidget.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ControlInputWidget.cs index 2836cfbe..786d8beb 100644 --- a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ControlInputWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ControlInputWidget.cs @@ -9,9 +9,11 @@ public ControlInputWidget(FlowCanvas canvas, ControlInput port) : base(canvas, p protected override Edge edge => Edge.Top; - protected override Texture handleTextureConnected => PathUtil.Load("ConnectedHandle", CommunityEditorPath.Fundamentals)?[12]; + protected override Edge connectionEndEdge => Edge.Bottom; - protected override Texture handleTextureUnconnected => PathUtil.Load("UnconnectedHandle", CommunityEditorPath.Fundamentals)?[12]; + protected override Texture handleTextureConnected => CommunityStyles.controlPortConnected; + + protected override Texture handleTextureUnconnected => CommunityStyles.controlPortUnconnected; protected override bool colorIfActive => !BoltFlow.Configuration.animateControlConnections || !BoltFlow.Configuration.animateValueConnections; @@ -42,6 +44,8 @@ public override void CachePosition() identifierPosition = identifierPosition.Encompass(labelPosition); this.labelPosition = labelPosition; } + + surroundPosition = Styles.surroundPadding.Add(identifierPosition); } } } diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ControlOutputWidget.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ControlOutputWidget.cs index f8c16e2b..aebd22eb 100644 --- a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ControlOutputWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ControlOutputWidget.cs @@ -7,26 +7,15 @@ public class ControlOutputWidget : UnitOutputPortWidget { public ControlOutputWidget(FlowCanvas canvas, ControlOutput port) : base(canvas, port) { } - protected override Texture handleTextureConnected => PathUtil.Load("ConnectedHandle", CommunityEditorPath.Fundamentals)?[12]; + protected override Texture handleTextureConnected => CommunityStyles.controlPortConnected; - protected override Texture handleTextureUnconnected => PathUtil.Load("UnconnectedHandle", CommunityEditorPath.Fundamentals)?[12]; + protected override Texture handleTextureUnconnected => CommunityStyles.controlPortUnconnected; protected override Edge edge => Edge.Bottom; - protected override bool colorIfActive => !BoltFlow.Configuration.animateControlConnections || !BoltFlow.Configuration.animateValueConnections; - - // public override void CachePosition() - // { - // base.CachePosition(); - // var unitPosition = unitWidget.position; + protected override Edge connectionEndEdge => Edge.Top; - // var y = unitPosition.yMax + Styles.spaceBetweenEdgeAndHandle * 2; - - // handlePosition = new Rect(x, y, Styles.handleSize.x, Styles.handleSize.y); - // _position = handlePosition; - // identifierPosition = handlePosition; - // surroundPosition = Styles.surroundPadding.Add(identifierPosition); - // } + protected override bool colorIfActive => !BoltFlow.Configuration.animateControlConnections || !BoltFlow.Configuration.animateValueConnections; } } #endif \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/HorizontalUnitWidget.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/HorizontalUnitWidget.cs new file mode 100644 index 00000000..e5771d43 --- /dev/null +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/HorizontalUnitWidget.cs @@ -0,0 +1,1014 @@ +#if NEW_UNIT_UI && !ENABLE_VERTICAL_FLOW +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; +using Unity.VisualScripting.Community.Libraries.Humility; +namespace Unity.VisualScripting.Community +{ + public class UnitWidget : NodeWidget, IUnitWidget where TUnit : class, IUnit + { + public UnitWidget(FlowCanvas canvas, TUnit unit) : base(canvas, unit) + { + unit.onPortsChanged += CacheDefinition; + unit.onPortsChanged += SubWidgetsChanged; + } + + public override void Dispose() + { + base.Dispose(); + + unit.onPortsChanged -= CacheDefinition; + unit.onPortsChanged -= SubWidgetsChanged; + } + + public override IEnumerable subWidgets => unit.ports.Select(port => canvas.Widget(port)); + + #region Model + + protected TUnit unit => element; + + IUnit IUnitWidget.unit => unit; + + protected IUnitDebugData unitDebugData => GetDebugData(); + + private UnitDescription description; + + private UnitAnalysis analysis => unit.Analysis(context); + + protected readonly List ports = new List(); + + protected readonly List inputs = new List(); + + protected readonly List outputs = new List(); + + private readonly List settingNames = new List(); + + protected readonly List settings = new List(); + + + protected override void CacheItemFirstTime() + { + base.CacheItemFirstTime(); + CacheDefinition(); + } + + protected virtual void CacheDefinition() + { + inputs.Clear(); + outputs.Clear(); + ports.Clear(); + inputs.AddRange(unit.inputs.Select(port => canvas.Widget(port))); + outputs.AddRange(unit.outputs.Select(port => canvas.Widget(port))); + ports.AddRange(inputs); + ports.AddRange(outputs); + + Reposition(); + } + + protected override void CacheDescription() + { + description = unit.Description(); + + titleContent.text = description.shortTitle; + titleContent.tooltip = description.summary; + surtitleContent.text = description.surtitle; + subtitleContent.text = description.subtitle; + + Reposition(); + } + + protected override void CacheMetadata() + { + settingNames.Clear(); + + settingNames.AddRange(metadata.valueType + .GetMembers() + .Where(mi => mi.HasAttribute()) + .OrderBy(mi => mi.GetAttributes().OfType().FirstOrDefault()?.order ?? int.MaxValue) + .ThenBy(mi => mi.MetadataToken) + .Select(mi => mi.Name)); + + foreach (var name in settingNames) + { + settings.Add(metadata[name]); + } + + lock (settingLabelsContents) + { + settingLabelsContents.Clear(); + + foreach (var setting in settings) + { + var settingLabel = setting.GetAttribute().label; + + GUIContent settingContent; + + if (string.IsNullOrEmpty(settingLabel)) + { + settingContent = null; + } + else + { + settingContent = new GUIContent(settingLabel); + } + + settingLabelsContents.Add(setting, settingContent); + } + } + + Reposition(); + } + + public virtual Inspector GetPortInspector(IUnitPort port, Metadata metadata) + { + return metadata.Inspector(); + } + + #endregion + + + #region Lifecycle + + public override bool foregroundRequiresInput => showSettings || unit.valueInputs.Any(vip => vip.hasDefaultValue); + + protected virtual IEnumerable SnapTargets + { + get + { + foreach (var e in graph.elements) + { + if (e != element && !(e is IUnitConnection)) + { + yield return e; + } + } + } + } + + private List _cachedSnapTargets; + + public override void HandleInput() + { + if (AllowRectSnapping && isDragging && e.ctrlOrCmd) + { + if (_cachedSnapTargets == null) + { + _cachedSnapTargets = new List(); + foreach (var target in SnapTargets) + { + _cachedSnapTargets.Add(SnapTarget(target)); + } + } + + var snapResult = RectUtility.CheckSnap(outerPosition, _cachedSnapTargets, threshold: 15f); + snapLines.Clear(); + + if (snapResult.snapped) + { + var pos = BoltCore.Configuration.snapToGrid ? GraphGUI.SnapToGrid(snapResult.snapPosition) : snapResult.snapPosition; + _position = OuterToEdgePosition(new Rect(pos.x, pos.y, _position.width, _position.height)); + + if (snapResult.hasVerticalLine) snapLines.Add(snapResult.verticalLine); + if (snapResult.hasHorizontalLine) snapLines.Add(snapResult.horizontalLine); + + Reposition(); + } + } + else + { + if (_cachedSnapTargets != null) + { + _cachedSnapTargets = null; + snapLines.Clear(); + } + } + + if (canvas.isCreatingConnection) + { + if (e.IsMouseDown(MouseButton.Left)) + { + var source = canvas.connectionSource; + var destination = source.CompatiblePort(unit); + + if (destination != null) + { + UndoUtility.RecordEditedObject("Connect Nodes"); + source.ValidlyConnectTo(destination); + canvas.connectionSource = null; + canvas.Widget(source.unit).Reposition(); + canvas.Widget(destination.unit).Reposition(); + GUI.changed = true; + } + + e.Use(); + } + else if (e.IsMouseDown(MouseButton.Right)) + { + canvas.CancelConnection(); + e.Use(); + } + } + + base.HandleInput(); + } + + private Rect SnapTarget(IGraphItem e) + { + if (e is Unit unit) + { + return canvas.Widget(unit).outerPosition; + } + return canvas.Widget(e).position; + } + #endregion + + + #region Contents + + protected readonly GUIContent titleContent = new GUIContent(); + + protected readonly GUIContent surtitleContent = new GUIContent(); + + protected readonly GUIContent subtitleContent = new GUIContent(); + + protected readonly Dictionary settingLabelsContents = new Dictionary(); + + #endregion + + + #region Positioning + + protected override bool snapToGrid => BoltCore.Configuration.snapToGrid; + + protected virtual Color? PortsbackgroundColor => null; + + public override IEnumerable positionDependers => ports.Cast(); + + protected Rect _position; + + public override Rect position + { + get { return _position; } + set { unit.position = value.position; } + } + + public Rect titlePosition { get; protected set; } + + public Rect surtitlePosition { get; protected set; } + + public Rect subtitlePosition { get; protected set; } + + public Rect iconPosition { get; protected set; } + + public List iconsPositions { get; protected set; } = new List(); + + public Dictionary settingsPositions { get; } = new Dictionary(); + + public Rect headerAddonPosition { get; protected set; } + + public Rect portsBackgroundPosition { get; protected set; } + + public override void CachePosition() + { + List _settings = settings.ToList(); + float inputsWidth = 0f; + for (int i = 0; i < inputs.Count; i++) + { + inputsWidth = Mathf.Max(inputsWidth, inputs[i].GetInnerWidth()); + } + + float outputsWidth = 0f; + for (int i = 0; i < outputs.Count; i++) + { + outputsWidth = Mathf.Max(outputsWidth, outputs[i].GetInnerWidth()); + } + + float portsWidth = inputsWidth + Styles.spaceBetweenInputsAndOutputs + outputsWidth; + + settingsPositions.Clear(); + float settingsWidth = 0f; + + if (showSettings) + { + for (int i = 0; i < _settings.Count; i++) + { + var setting = _settings[i]; + float settingWidth = 0f; + var labelContent = settingLabelsContents[setting]; + + if (labelContent != null) + { + settingWidth += Styles.settingLabel.CalcSize(labelContent).x; + } + + settingWidth += setting.Inspector().GetAdaptiveWidth(); + settingWidth = Mathf.Min(settingWidth, Styles.maxSettingsWidth); + + settingsPositions.Add(setting, new Rect(0, 0, settingWidth, 0)); + settingsWidth = Mathf.Max(settingsWidth, settingWidth); + } + } + + float headerAddonWidth = showHeaderAddon ? GetHeaderAddonWidth() : 0f; + float headerTextWidth = Styles.title.CalcSize(titleContent).x; + + if (showSurtitle) + headerTextWidth = Mathf.Max(headerTextWidth, Styles.surtitle.CalcSize(surtitleContent).x); + + if (showSubtitle) + headerTextWidth = Mathf.Max(headerTextWidth, Styles.subtitle.CalcSize(subtitleContent).x); + + float iconsWidth = 0f; + if (showIcons && description.icons.Length > 0) + { + int iconsColumns = Mathf.CeilToInt((float)description.icons.Length / Styles.iconsPerColumn); + iconsWidth = (iconsColumns * Styles.iconsSize) + ((iconsColumns - 1) * Styles.iconsSpacing); + } + + float headerWidth = Mathf.Max(headerTextWidth + iconsWidth, Mathf.Max(settingsWidth, headerAddonWidth)) + + Styles.iconSize + Styles.spaceAfterIcon; + + float innerWidth = Mathf.Max(portsWidth, headerWidth); + float edgeWidth = InnerToEdgePosition(new Rect(0, 0, innerWidth, 0)).width; + + Vector2 edgeOrigin = unit.position; + float edgeX = edgeOrigin.x; + float edgeY = edgeOrigin.y; + + Vector2 innerOrigin = EdgeToInnerPosition(new Rect(edgeOrigin, Vector2.zero)).position; + float innerX = innerOrigin.x; + float innerY = innerOrigin.y; + + iconPosition = new Rect(innerX, innerY, Styles.iconSize, Styles.iconSize); + float headerTextX = iconPosition.xMax + Styles.spaceAfterIcon; + + float y = innerY; + float headerHeight = 0f; + + if (showSurtitle) + { + float h = Styles.surtitle.CalcHeight(surtitleContent, headerTextWidth); + surtitlePosition = new Rect(headerTextX, y, headerTextWidth, h); + float step = h + Styles.spaceAfterSurtitle; + headerHeight += step; + y += step; + } + + if (showTitle) + { + float h = Styles.title.CalcHeight(titleContent, headerTextWidth); + titlePosition = new Rect(headerTextX, y, headerTextWidth, h); + headerHeight += h; + y += h; + } + + if (showSubtitle) + { + headerHeight += Styles.spaceBeforeSubtitle; + y += Styles.spaceBeforeSubtitle; + float h = Styles.subtitle.CalcHeight(subtitleContent, headerTextWidth); + subtitlePosition = new Rect(headerTextX, y, headerTextWidth, h); + headerHeight += h; + y += h; + } + + iconsPositions.Clear(); + if (showIcons) + { + int row = 0, col = 0; + for (int i = 0; i < description.icons.Length; i++) + { + iconsPositions.Add(new Rect( + innerX + innerWidth - ((col + 1) * Styles.iconsSize) - (col * Styles.iconsSpacing), + innerY + (row * (Styles.iconsSize + Styles.iconsSpacing)), + Styles.iconsSize, Styles.iconsSize)); + + if (++row % Styles.iconsPerColumn == 0) { col++; row = 0; } + } + } + + if (showSettings && _settings.Count > 0) + { + headerHeight += Styles.spaceBeforeSettings; + float settingsTotalHeight = 0f; + + for (int i = 0; i < _settings.Count; i++) + { + var setting = _settings[i]; + float sWidth = settingsPositions[setting].width; + using (LudiqGUIUtility.currentInspectorWidth.Override(sWidth)) + { + float sHeight = LudiqGUI.GetInspectorHeight(null, setting, sWidth, settingLabelsContents[setting] ?? GUIContent.none); + settingsPositions[setting] = new Rect(headerTextX, y, sWidth, sHeight); + + float step = sHeight + Styles.spaceBetweenSettings; + settingsTotalHeight += step; + y += step; + } + } + + settingsTotalHeight -= Styles.spaceBetweenSettings; + y -= Styles.spaceBetweenSettings; + headerHeight += settingsTotalHeight + Styles.spaceAfterSettings; + y += Styles.spaceAfterSettings; + } + + if (showHeaderAddon) + { + float h = GetHeaderAddonHeight(headerAddonWidth); + headerAddonPosition = new Rect(headerTextX, y, headerAddonWidth, h); + headerHeight += h; + y += h; + } + + if (headerHeight < Styles.iconSize) + { + float centeringOffset = (Styles.iconSize - headerHeight) * 0.5f; + if (showTitle) titlePosition = new Rect(titlePosition.x, titlePosition.y + centeringOffset, titlePosition.width, titlePosition.height); + if (showSubtitle) subtitlePosition = new Rect(subtitlePosition.x, subtitlePosition.y + centeringOffset, subtitlePosition.width, subtitlePosition.height); + if (showHeaderAddon) headerAddonPosition = new Rect(headerAddonPosition.x, headerAddonPosition.y + centeringOffset, headerAddonPosition.width, headerAddonPosition.height); + + if (showSettings) + { + for (int i = 0; i < _settings.Count; i++) + { + var rect = settingsPositions[_settings[i]]; + rect.y += centeringOffset; + settingsPositions[_settings[i]] = rect; + } + } + headerHeight = Styles.iconSize; + } + + y = innerY + headerHeight; + float innerHeight = headerHeight; + + if (showPorts) + { + innerHeight += Styles.spaceBeforePorts; + y += Styles.spaceBeforePorts; + + float portsBackgroundY = y; + float portsPaddingTop = Styles.portsBackground.padding.top; + y += portsPaddingTop; + innerHeight += portsPaddingTop; + + float portStartY = y; + float inH = 0f, outH = 0f; + + for (int i = 0; i < inputs.Count; i++) + { + inputs[i].y = y; + float h = inputs[i].GetHeight(); + inH += h + Styles.spaceBetweenPorts; + y += h + Styles.spaceBetweenPorts; + } + if (inputs.Count > 0) inH -= Styles.spaceBetweenPorts; + + y = portStartY; + for (int i = 0; i < outputs.Count; i++) + { + outputs[i].y = y; + float h = outputs[i].GetHeight(); + outH += h + Styles.spaceBetweenPorts; + y += h + Styles.spaceBetweenPorts; + } + if (outputs.Count > 0) outH -= Styles.spaceBetweenPorts; + + float maxPortsH = Mathf.Max(inH, outH); + innerHeight += maxPortsH + Styles.portsBackground.padding.bottom; + + portsBackgroundPosition = new Rect(edgeX, portsBackgroundY, edgeWidth, maxPortsH + portsPaddingTop + Styles.portsBackground.padding.bottom); + } + + float finalEdgeHeight = InnerToEdgePosition(new Rect(0, 0, 0, innerHeight)).height; + _position = new Rect(edgeX, edgeY, edgeWidth, finalEdgeHeight); + } + + protected virtual float GetHeaderAddonWidth() + { + return 0; + } + + protected virtual float GetHeaderAddonHeight(float width) + { + return 0; + } + + #endregion + + + #region Drawing + + protected virtual NodeColorMix baseColor => NodeColor.Gray; + + protected override NodeColorMix color + { + get + { + if (unitDebugData.runtimeException != null) + { + return NodeColor.Red; + } + + var color = baseColor; + + if (analysis.warnings.Count > 0) + { + var mostSevereWarning = Warning.MostSevereLevel(analysis.warnings); + + switch (mostSevereWarning) + { + case WarningLevel.Error: + color = NodeColor.Red; + break; + + case WarningLevel.Severe: + color = NodeColor.Orange; + break; + + case WarningLevel.Caution: + color = NodeColor.Yellow; + + break; + } + } + + if (EditorApplication.isPaused) + { + if (EditorTimeBinding.frame == unitDebugData.lastInvokeFrame) + { + return NodeColor.Blue; + } + } + else + { + var mix = color; + mix.blue = Mathf.Lerp(1, 0, (EditorTimeBinding.time - unitDebugData.lastInvokeTime) / Styles.invokeFadeDuration); + + return mix; + } + + return color; + } + } + + protected override NodeShape shape => NodeShape.Square; + + protected virtual bool showTitle => !string.IsNullOrEmpty(description.shortTitle); + + protected virtual bool showSurtitle => !string.IsNullOrEmpty(description.surtitle); + + protected virtual bool showSubtitle => !string.IsNullOrEmpty(description.subtitle); + + protected virtual bool showIcons => description.icons.Length > 0; + + protected virtual bool showSettings => settingNames.Count > 0; + + protected virtual bool showHeaderAddon => false; + + protected virtual bool showPorts => ports.Count > 0; + + protected override bool dim + { + get + { + var dim = BoltCore.Configuration.dimInactiveNodes && !analysis.isEntered; + + if (isMouseOver || isSelected) + { + dim = false; + } + + if (BoltCore.Configuration.dimIncompatibleNodes && canvas.isCreatingConnection) + { + dim = !unit.ports.Any(p => canvas.connectionSource == p || canvas.connectionSource.CanValidlyConnectTo(p)); + } + + return dim; + } + } + + protected virtual bool AllowRectSnapping => true; + private List snapLines = new List(); + + protected void DrawSnapLines() + { + if (snapLines == null || snapLines.Count == 0) + return; + + Handles.color = new Color32(64, 113, 156, 255); + foreach (var line in snapLines) + { + Handles.DrawLine(line.start, line.end); + } + } + + private void ConvertToEmbed() + { + NodeSelection.Convert(GraphSource.Embed); + } + + private void ConvertToMacro() + { + NodeSelection.Convert(GraphSource.Macro); + } + + public override void DrawForeground() + { + if (AllowRectSnapping && isDragging && e.ctrlOrCmd) + DrawSnapLines(); + + BeginDim(); + + base.DrawForeground(); + + DrawIcon(); + + if (showSurtitle) + { + DrawSurtitle(); + } + + if (showTitle) + { + DrawTitle(); + } + + if (showSubtitle) + { + DrawSubtitle(); + } + + if (showIcons) + { + DrawIcons(); + } + + if (showSettings) + { + DrawSettings(); + } + + if (showHeaderAddon) + { + DrawHeaderAddon(); + } + + if (showPorts) + { + DrawPortsBackground(); + } + + EndDim(); + } + + protected void DrawIcon() + { + var icon = description.icon ?? BoltFlow.Icons.unit; + + if (icon != null && icon[(int)iconPosition.width]) + { + GUI.DrawTexture(iconPosition, icon[(int)iconPosition.width]); + } + } + + protected void DrawTitle() + { + GUI.Label(titlePosition, titleContent, invertForeground ? Styles.titleInverted : Styles.title); + } + + protected void DrawSurtitle() + { + GUI.Label(surtitlePosition, surtitleContent, invertForeground ? Styles.surtitleInverted : Styles.surtitle); + } + + protected void DrawSubtitle() + { + GUI.Label(subtitlePosition, subtitleContent, invertForeground ? Styles.subtitleInverted : Styles.subtitle); + } + + protected void DrawIcons() + { + for (int i = 0; i < description.icons.Length; i++) + { + var icon = description.icons[i]; + var position = iconsPositions[i]; + + GUI.DrawTexture(position, icon?[(int)position.width]); + } + } + + private void DrawSettings() + { + if (graph.zoom < FlowCanvas.inspectorZoomThreshold) + { + return; + } + + EditorGUI.BeginDisabledGroup(!e.IsRepaint && isMouseThrough && !isMouseOver); + + EditorGUI.BeginChangeCheck(); + + foreach (var setting in settings) + { + DrawSetting(setting); + } + + if (EditorGUI.EndChangeCheck()) + { + unit.Define(); + Reposition(); + } + + EditorGUI.EndDisabledGroup(); + } + + protected void DrawSetting(Metadata setting) + { + var settingPosition = settingsPositions[setting]; + + using (LudiqGUIUtility.currentInspectorWidth.Override(settingPosition.width)) + using (Inspector.expandTooltip.Override(false)) + { + var label = settingLabelsContents[setting]; + + if (label == null) + { + LudiqGUI.Inspector(setting, settingPosition, GUIContent.none); + } + else + { + using (Inspector.defaultLabelStyle.Override(Styles.settingLabel)) + using (LudiqGUIUtility.labelWidth.Override(Styles.settingLabel.CalcSize(label).x)) + { + LudiqGUI.Inspector(setting, settingPosition, label); + } + } + } + } + + protected virtual void DrawHeaderAddon() { } + + private IUnitPortWidget Single(IUnitPort targetPort) + { + IUnitPortWidget widget = null; + for (int i = 0; i < ports.Count; i++) + { + if (ports[i].port == targetPort) + { + widget = ports[i]; + break; + } + } + return widget; + } + + protected void DrawPortsBackground() + { + if (canvas.showRelations) + { + foreach (var relation in unit.relations) + { + var sourcePort = relation.source; + var destinationPort = relation.destination; + IUnitPortWidget sourceWidget = Single(sourcePort); + IUnitPortWidget destinationWidget = Single(destinationPort); + var start = sourceWidget.handlePosition.center; + var end = destinationWidget.handlePosition.center; + + var startTangent = start; + var endTangent = end; + + if (relation.source is IUnitInputPort && + relation.destination is IUnitInputPort) + { + startTangent -= new Vector2(20, 0); + endTangent -= new Vector2(32, 0); + } + else + { + startTangent += new Vector2(innerPosition.width / 2, 0); + endTangent += new Vector2(-innerPosition.width / 2, 0); + } + + Handles.DrawBezier + ( + start, + end, + startTangent, + endTangent, + ColorPalette.unityBackgroundMid, + null, + 3 + ); + } + } + else + { + if (e.IsRepaint) + { + Styles.portsBackground.Draw(portsBackgroundPosition, false, false, false, false); + } + } + } + + #endregion + + #region Selecting + + public override bool canSelect => true; + + #endregion + + + #region Dragging + + public override bool canDrag => true; + + public override void ExpandDragGroup(HashSet dragGroup) + { + if (BoltCore.Configuration.carryChildren) + { + foreach (var output in unit.outputs) + { + foreach (var connection in output.connections) + { + if (dragGroup.Contains(connection.destination.unit)) + { + continue; + } + + dragGroup.Add(connection.destination.unit); + + canvas.Widget(connection.destination.unit).ExpandDragGroup(dragGroup); + } + } + } + } + + #endregion + + + #region Deleting + + public override bool canDelete => true; + + #endregion + + + #region Clipboard + + public override void ExpandCopyGroup(HashSet copyGroup) + { + copyGroup.UnionWith(unit.connections.Cast()); + } + + #endregion + + + #region Context + + protected override IEnumerable contextOptions + { + get + { + yield return new DropdownOption((Action)ReplaceUnit, "Replace..."); + + foreach (var baseOption in base.contextOptions) + { + yield return baseOption; + } + + if (selection.Count > 0) + { + yield return new DropdownOption((Action)ConvertToEmbed, "Selection/To Embed Subgraph"); + yield return new DropdownOption((Action)ConvertToMacro, "Selection/To Macro Subgraph"); + } + } + } + + private void ReplaceUnit() + { + UnitWidgetHelper.ReplaceUnit(unit, reference, context, selection, e); + } + + #endregion + + + public static class Styles + { + static Styles() + { + // Disabling word wrap because Unity's CalcSize and CalcHeight + // are broken w.r.t. pixel-perfection and matrix + + title = new GUIStyle(BoltCore.Styles.nodeLabel); + title.padding = new RectOffset(0, 5, 0, 2); + title.margin = new RectOffset(0, 0, 0, 0); + title.fontSize = 12; + title.alignment = TextAnchor.MiddleLeft; + title.wordWrap = false; + + surtitle = new GUIStyle(BoltCore.Styles.nodeLabel); + surtitle.padding = new RectOffset(0, 5, 0, 0); + surtitle.margin = new RectOffset(0, 0, 0, 0); + surtitle.fontSize = 10; + surtitle.alignment = TextAnchor.MiddleLeft; + surtitle.wordWrap = false; + + subtitle = new GUIStyle(surtitle); + subtitle.padding.bottom = 2; + + titleInverted = new GUIStyle(title); + titleInverted.normal.textColor = ColorPalette.unityBackgroundDark; + + surtitleInverted = new GUIStyle(surtitle); + surtitleInverted.normal.textColor = ColorPalette.unityBackgroundDark; + + subtitleInverted = new GUIStyle(subtitle); + subtitleInverted.normal.textColor = ColorPalette.unityBackgroundDark; + +#if NEW_UNIT_STYLE + if (EditorGUIUtility.isProSkin) + { + portsBackground = new GUIStyle + { + padding = new RectOffset(0, 0, 6, 5), + border = new RectOffset(0, 0, 2, 2) + }; + + portsBackground.normal.background = CommunityStyles.MakeBorderedTexture(CommunityStyles.backgroundColor, CommunityStyles.backgroundColor.Darken(0.05f)); + } + else + { + portsBackground = new GUIStyle + { + normal = { background = CommunityStyles.MakeBorderedTexture(CommunityStyles.backgroundColor, CommunityStyles.backgroundColor.Brighten(0.05f)) }, + padding = new RectOffset(0, 0, 6, 5) + }; + } +#else + portsBackground = VisualScripting.UnitWidget.Styles.portsBackground; +#endif + + settingLabel = new GUIStyle(BoltCore.Styles.nodeLabel); + settingLabel.padding.left = 0; + settingLabel.padding.right = 5; + settingLabel.wordWrap = false; + settingLabel.clipping = TextClipping.Clip; + } + + public static readonly GUIStyle title; + + public static readonly GUIStyle surtitle; + + public static readonly GUIStyle subtitle; + + public static readonly GUIStyle titleInverted; + + public static readonly GUIStyle surtitleInverted; + + public static readonly GUIStyle subtitleInverted; + + public static readonly GUIStyle settingLabel; + + public static readonly float spaceAroundLineIcon = 5; + + public static readonly float spaceBeforePorts = 5; + + public static readonly float spaceBetweenInputsAndOutputs = 8; + + public static readonly float spaceBeforeSettings = 2; + + public static readonly float spaceBetweenSettings = 3; + + public static readonly float spaceBetweenPorts = 3; + + public static readonly float spaceAfterSettings = 0; + + public static readonly float maxSettingsWidth = 150; + + public static readonly GUIStyle portsBackground; + + public static readonly float iconSize = IconSize.Medium; + + public static readonly float iconsSize = IconSize.Small; + + public static readonly float iconsSpacing = 3; + + public static readonly int iconsPerColumn = 2; + + public static readonly float spaceAfterIcon = 6; + + public static readonly float spaceAfterSurtitle = 2; + + public static readonly float spaceBeforeSubtitle = 0; + + public static readonly float invokeFadeDuration = 0.5f; + } + } +} +#endif \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/HorizontalUnitWidget.cs.meta b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/HorizontalUnitWidget.cs.meta new file mode 100644 index 00000000..8c9103b2 --- /dev/null +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/HorizontalUnitWidget.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 16c7cb4fbc25b75499cf34e72a9988f0 diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnifiedVariableUnitWidget.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnifiedVariableUnitWidget.cs index b4dc113f..2a3eba86 100644 --- a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnifiedVariableUnitWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnifiedVariableUnitWidget.cs @@ -9,21 +9,41 @@ namespace Unity.VisualScripting.Community { public sealed class UnifiedVariableUnitWidget : UnitWidget { - private bool isRenaming; - private List<(UnifiedVariableUnit, UnityEngine.Object)> renameTargets = new List<(UnifiedVariableUnit, UnityEngine.Object)>(); - private static List targets = new List(); + #region Reflection Caching + + private static readonly FieldInfo CollectionField = + typeof(VariableDeclarations).GetField("collection", BindingFlags.Instance | BindingFlags.NonPublic); + + private static readonly MethodInfo SetNameMethod = + typeof(VariableDeclaration).GetProperty("name", BindingFlags.Instance | BindingFlags.Public)?.GetSetMethod(true); + + #endregion - private static FieldInfo collectionField = typeof(VariableDeclarations).GetField("collection", BindingFlags.Instance | BindingFlags.NonPublic); - private MethodInfo setNameMethod = typeof(VariableDeclaration).GetProperty("name", BindingFlags.Instance | BindingFlags.Public).GetSetMethod(true); + private static readonly List ActiveRenameTargets = new List(); + private static UnifiedVariableUnit closestToMouse; + + private readonly List<(UnifiedVariableUnit, UnityEngine.Object)> renameTargets = new List<(UnifiedVariableUnit, UnityEngine.Object)>(); + private readonly Func nameInspectorConstructor; + private readonly string controlName; private VariableDeclarationCollection collection; private VariableDeclarationCollection savedCollection; private GameObject storedObject; + private VariableKind previousKind; - private static UnifiedVariableUnit closestToMouse; + private VariableNameInspector nameInspector; + private string newProjectName; + private string oldProjectName; + private bool isRenaming; - private VariableKind previousKind; - private readonly string controlName; + protected override NodeColorMix baseColor => NodeColorMix.TealReadable; + + public UnifiedVariableUnitWidget(FlowCanvas canvas, UnifiedVariableUnit unit) : base(canvas, unit) + { + controlName = $"{unit}_VariableNameInspector"; + + nameInspectorConstructor = metadata => new VariableNameInspector(metadata, GetNameSuggestions, OnVariableRenamed, controlName); + } public override void CachePosition() { @@ -37,364 +57,350 @@ public override void CachePosition() storedObject = null; } + if (collection == null) + { + ResolveVariableCollections(); + } + } + + public override void DrawForeground() + { + base.DrawForeground(); + + if (ActiveRenameTargets.Contains(unit)) + { + GraphGUI.DrawDragAndDropPreviewLabel(new Vector2(edgePosition.x, outerPosition.yMax), "Renaming", typeof(string).Icon()); + } + } + + public override void HandleInput() + { + if (ShouldStartRename()) + { + ExecuteStartRename(); + } + else if (ShouldEndRename()) + { + ExecuteEndRename(); + } + else if (!selection.Contains(unit)) + { + isRenaming = false; + } + + base.HandleInput(); + } + + public override Inspector GetPortInspector(IUnitPort port, Metadata metadata) + { + if (port == unit.name) + { + InspectorProvider.instance.Renew(ref nameInspector, metadata, nameInspectorConstructor); + return nameInspector; + } + + return base.GetPortInspector(port, metadata); + } + + protected override IEnumerable contextOptions + { + get + { + foreach (var option in base.contextOptions) + { + yield return option; + } + + if (!unit.name.hasValidConnection && Flow.CanPredict(unit.name, reference)) + { + yield return new DropdownOption((Action)FindAll, "Find/All"); + yield return new DropdownOption((Action)FindSetters, "Find/Setters"); + yield return new DropdownOption((Action)FindGetters, "Find/Getters"); + } + } + } + + #region Variable Collection Handling + + private void ResolveVariableCollections() + { switch (unit.kind) { case VariableKind.Graph: - if (collection == null) - collection = (VariableDeclarationCollection)collectionField.GetValue(VisualScripting.Variables.Graph(reference)); + collection = GetCollection(VisualScripting.Variables.Graph(reference)); break; - case VariableKind.Object: - if (collection != null) break; - - if (!Flow.CanPredict(unit.@object, reference)) break; - var value = Flow.Predict(unit.@object, reference); - if (value is GameObject @object) + case VariableKind.Object: + if (Flow.CanPredict(unit.@object, reference) && Flow.Predict(unit.@object, reference) is GameObject go) { - if (@object != null && storedObject != @object) + if (go != null && storedObject != go) { - storedObject = @object; - collection = (VariableDeclarationCollection)collectionField.GetValue(VisualScripting.Variables.Object(@object)); + storedObject = go; + collection = GetCollection(VisualScripting.Variables.Object(go)); } } - break; + case VariableKind.Scene: - if (collection == null && reference.scene != null) - collection = (VariableDeclarationCollection)collectionField.GetValue(VisualScripting.Variables.Scene(reference.scene)); + if (reference.scene != null) + collection = GetCollection(VisualScripting.Variables.Scene(reference.scene)); break; + case VariableKind.Application: - if (collection == null) - collection = (VariableDeclarationCollection)collectionField.GetValue(VisualScripting.Variables.Application); + collection = GetCollection(VisualScripting.Variables.Application); break; + case VariableKind.Saved: - if (collection == null) - collection = (VariableDeclarationCollection)collectionField.GetValue(VisualScripting.Variables.Saved); - if (savedCollection == null) - savedCollection = (VariableDeclarationCollection)collectionField.GetValue(SavedVariables.saved); + collection = GetCollection(VisualScripting.Variables.Saved); + savedCollection = GetCollection(SavedVariables.saved); break; } } - private string newProjectName; - private string oldProjectName; - public UnifiedVariableUnitWidget(FlowCanvas canvas, UnifiedVariableUnit unit) : base(canvas, unit) + private static VariableDeclarationCollection GetCollection(VariableDeclarations declarations) { - controlName = unit.ToString() + "_VariableNameInspector"; - nameInspectorConstructor = (metadata) => new VariableNameInspector(metadata, GetNameSuggestions, (oldName, newName) => + return declarations != null ? (VariableDeclarationCollection)CollectionField?.GetValue(declarations) : null; + } + + #endregion + + #region Renaming Logic + + private void OnVariableRenamed(string oldName, string newName) + { + if (!isRenaming) return; + + switch (unit.kind) { - if (isRenaming) - { - switch (unit.kind) - { - case VariableKind.Graph: - { - var declarations = VisualScripting.Variables.Graph(reference); - RenameVariable(oldName, newName, declarations); - } - break; - case VariableKind.Object: - { - if (storedObject == null) break; - - var declarations = VisualScripting.Variables.Object(storedObject); - RenameVariable(oldName, newName, declarations); - } - break; - case VariableKind.Scene: - { - if (reference.scene == null) break; - - var declarations = VisualScripting.Variables.Scene(reference.scene); - RenameVariable(oldName, newName, declarations); - } - break; - case VariableKind.Application: - { - var declarations = VisualScripting.Variables.Application; - newName = RenameVariable(oldName, newName, declarations); - - newProjectName = newName; - } - break; - case VariableKind.Saved: - { - var mainDeclarations = VisualScripting.Variables.Saved; - - newName = RenameVariable(oldName, newName, mainDeclarations); - - if (!Application.isPlaying) - { - var saved = SavedVariables.saved; - - newName = RenameVariable(oldName, newName, saved); - } - - newProjectName = newName; - } - break; - } + case VariableKind.Graph: + RenameVariable(oldName, newName, VisualScripting.Variables.Graph(reference)); + break; - var group = Undo.GetCurrentGroup(); - foreach (var target in renameTargets) - { - if (target.Item1.name.hasValidConnection) continue; + case VariableKind.Object: + if (storedObject != null) + RenameVariable(oldName, newName, VisualScripting.Variables.Object(storedObject)); + break; - if (target.Item2 != null) - Undo.RecordObject(target.Item2, $"Renamed '{oldName}' variable to '{newName}'"); + case VariableKind.Scene: + if (reference.scene != null) + RenameVariable(oldName, newName, VisualScripting.Variables.Scene(reference.scene)); + break; - target.Item1.name.SetDefaultValue(newName); - } - Undo.CollapseUndoOperations(group); + case VariableKind.Application: + newName = RenameVariable(oldName, newName, VisualScripting.Variables.Application); + newProjectName = newName; + break; - if (GUI.GetNameOfFocusedControl() != controlName) + case VariableKind.Saved: + newName = RenameVariable(oldName, newName, VisualScripting.Variables.Saved); + if (!Application.isPlaying) { - isRenaming = false; - targets.Clear(); + newName = RenameVariable(oldName, newName, SavedVariables.saved); } + newProjectName = newName; + break; + } + + int group = Undo.GetCurrentGroup(); + foreach (var (targetUnit, targetObject) in renameTargets) + { + if (targetUnit.name.hasValidConnection) continue; + + if (targetObject != null) + { + Undo.RecordObject(targetObject, $"Renamed '{oldName}' variable to '{newName}'"); } - }, controlName); + + targetUnit.name.SetDefaultValue(newName); + } + Undo.CollapseUndoOperations(group); + + if (GUI.GetNameOfFocusedControl() != controlName) + { + isRenaming = false; + ActiveRenameTargets.Clear(); + } } private string RenameVariable(string oldName, string newName, VariableDeclarations declarations) { - if (declarations.IsDefined(oldName)) - { - var declaration = declarations.GetDeclaration(oldName); + if (declarations == null || !declarations.IsDefined(oldName)) + return newName; - newName = OperateOnString(declarations, newName); + var declaration = declarations.GetDeclaration(oldName); + newName = EnsureUniqueName(declarations, newName); + + collection?.EditorRename(declaration, newName); + SetNameMethod?.Invoke(declaration, new object[] { newName }); - collection.EditorRename(declaration, newName); - setNameMethod.Invoke(declaration, new object[] { newName }); - } return newName; } - private string OperateOnString(VariableDeclarations declarations, string newName) + private static string EnsureUniqueName(VariableDeclarations declarations, string candidateName) { - if (string.IsNullOrEmpty(newName)) - { - int counter = 1; + string baseName = string.IsNullOrEmpty(candidateName) ? "Unnamed Variable" : candidateName; + string finalName = baseName; + int counter = 1; - var baseName = "Unnamed Variable"; - newName = baseName; - while (declarations.IsDefined(newName)) - { - newName = $"{baseName} ({counter++})"; - } - } - else if (declarations.IsDefined(newName)) + while (declarations.IsDefined(finalName)) { - int counter = 1; - - var baseName = newName; - newName = baseName; - while (declarations.IsDefined(newName)) - { - newName = $"{baseName} ({counter++})"; - } + finalName = $"{baseName} ({counter++})"; } - return newName; + + return finalName; } - public override void DrawForeground() + private bool ShouldStartRename() { - base.DrawForeground(); - if (targets.Contains(unit)) - GraphGUI.DrawDragAndDropPreviewLabel(new Vector2(edgePosition.x, outerPosition.yMax), "Renaming", typeof(string).Icon()); + return !unit.name.hasValidConnection && e != null && e.keyCode == KeyCode.F2 && selection.Contains(unit); } - public override void HandleInput() + private void ExecuteStartRename() { - if (!unit.name.hasValidConnection && e != null && e.keyCode == KeyCode.F2 && selection.Contains(unit)) + if (selection.Count(s => s is UnifiedVariableUnit) > 1) { - if (selection.Count(e => e is UnifiedVariableUnit) > 1) - { - if (closestToMouse == null) closestToMouse = unit; - else if (Vector2.Distance(unit.position, e.mousePosition) < Vector2.Distance(closestToMouse.position, e.mousePosition)) - { - closestToMouse = unit; - } - } - else + if (closestToMouse == null || Vector2.Distance(unit.position, e.mousePosition) < Vector2.Distance(closestToMouse.position, e.mousePosition)) { closestToMouse = unit; } - - if (closestToMouse != null && closestToMouse != unit) return; - - if (IsSceneRequired() && reference.gameObject == null) - { - Debug.LogWarning( - $"[Rename Variables] The selected variable is an {unit.kind} variable inside an Asset. " + - $"{reference.rootObject.GetType().DisplayName()}'s do not have access to the scene this graph is used in. Rename the variable directly from the GameObject or Scene itself." - ); - return; - } - - EditorGUI.FocusTextInControl(controlName); - switch (unit.kind) - { - case VariableKind.Flow: - targets = GraphUtility.GetFlowVariablesRenameTargets(unit, unit.defaultValues[unit.name.key] as string, reference); - renameTargets = targets.Select(t => (t, null)).ToList(); - isRenaming = true; - break; - case VariableKind.Graph: - targets = GraphUtility.GetGraphVariablesRenameTargets(graph as FlowGraph, unit.defaultValues[unit.name.key] as string); - renameTargets = targets.Select(t => (t, null)).ToList(); - isRenaming = true; - break; - case VariableKind.Object: - if (Flow.CanPredict(unit.@object, reference)) - { - var value = Flow.Predict(unit.@object, reference); - if (value is GameObject @object) - { - renameTargets = GraphUtility.GetObjectVariablesRenameTargets(reference, @object, unit.defaultValues[unit.name.key] as string); - targets = renameTargets.Select(t => t.Item1).ToList(); - isRenaming = true; - } - } - break; - case VariableKind.Scene: - if (reference.scene != null && SceneVariables.InstantiatedIn(reference.scene.Value)) - { - renameTargets = GraphUtility.GetSceneVariablesRenameTargets(reference, reference.scene, unit.defaultValues[unit.name.key] as string); - targets = renameTargets.Select(t => t.Item1).ToList(); - isRenaming = true; - } - break; - default: - if (Application.isPlaying) - { - Debug.LogWarning($"[Rename Variables] Cannot rename all {unit.kind} variables while in play mode!"); - break; - } - isRenaming = true; - renameTargets = GraphUtility.GetCurrentlyAccessibleProjectUnits(unit.defaultValues[unit.name.key] as string, unit.kind); - targets = renameTargets.Select(t => t.Item1).ToList(); - oldProjectName = unit.defaultValues[unit.name.key] as string; - break; - } } - else if (isRenaming && (!selection.Contains(unit) || - GUI.GetNameOfFocusedControl() != controlName || - e.keyCode == KeyCode.Return || e.keyCode == KeyCode.Escape || !canvas.isMouseOver)) + else { - isRenaming = false; - targets.Clear(); - switch (unit.kind) - { - case VariableKind.Application: - { - bool choice = oldProjectName != newProjectName && EditorUtility.DisplayDialog( - "Update ALL Application Variables?", - "This will go through ALL scenes and macros to find every Variable Unit " - + $"using {oldProjectName} and update it to {newProjectName}.\n\n" - + "This operation is FINAL and cannot be undone!", - "Update All", - "Rename Only" - ); - - if (choice) - { - GraphUtility.RenameApplicationVariables(oldProjectName, newProjectName); - } - } - break; - case VariableKind.Saved: - { - bool choice = oldProjectName != newProjectName && EditorUtility.DisplayDialog( - "Update ALL Saved Variables?", - "This will go through ALL scenes and macros to find every Variable Unit " - + $"using {oldProjectName} and update it to {newProjectName}.\n\n" - + "This operation is FINAL and cannot be undone!", - "Update All", - "Rename Only" - ); - - if (choice) - { - GraphUtility.RenameSavedVariables(oldProjectName, newProjectName); - } - } - break; - } - oldProjectName = null; - newProjectName = null; + closestToMouse = unit; } - else if (!selection.Contains(unit)) + + if (closestToMouse != null && closestToMouse != unit) return; + + if (IsSceneRequired() && reference.gameObject == null) { - isRenaming = false; + Debug.LogWarning( + $"[Rename Variables] The selected variable is an {unit.kind} variable inside an Asset. " + + $"{reference.rootObject.GetType().DisplayName()} does not have access to the scene this graph is used in." + ); + return; } - base.HandleInput(); - } - private bool IsSceneRequired() - { - return unit.kind == VariableKind.Object || unit.kind == VariableKind.Scene; - } + EditorGUI.FocusTextInControl(controlName); + string currentName = unit.defaultValues[unit.name.key] as string; - protected override NodeColorMix baseColor => NodeColorMix.TealReadable; + switch (unit.kind) + { + case VariableKind.Flow: + ActiveRenameTargets.Clear(); + ActiveRenameTargets.AddRange(GraphUtility.GetFlowVariablesRenameTargets(unit, currentName, reference)); + renameTargets.Clear(); + renameTargets.AddRange(ActiveRenameTargets.Select(t => (t, null))); + isRenaming = true; + break; - private VariableNameInspector nameInspector; - private Func nameInspectorConstructor; + case VariableKind.Graph: + ActiveRenameTargets.Clear(); + ActiveRenameTargets.AddRange(GraphUtility.GetGraphVariablesRenameTargets(graph as FlowGraph, currentName)); + renameTargets.Clear(); + renameTargets.AddRange(ActiveRenameTargets.Select(t => (t, null))); + isRenaming = true; + break; - public override Inspector GetPortInspector(IUnitPort port, Metadata metadata) - { - if (port == unit.name) - { - InspectorProvider.instance.Renew(ref nameInspector, metadata, nameInspectorConstructor); + case VariableKind.Object: + if (Flow.CanPredict(unit.@object, reference) && Flow.Predict(unit.@object, reference) is GameObject go) + { + renameTargets.Clear(); + renameTargets.AddRange(GraphUtility.GetObjectVariablesRenameTargets(reference, go, currentName)); + ActiveRenameTargets.Clear(); + ActiveRenameTargets.AddRange(renameTargets.Select(t => t.Item1)); + isRenaming = true; + } + break; - return nameInspector; + case VariableKind.Scene: + if (reference.scene != null && SceneVariables.InstantiatedIn(reference.scene.Value)) + { + renameTargets.Clear(); + renameTargets.AddRange(GraphUtility.GetSceneVariablesRenameTargets(reference, reference.scene, currentName)); + ActiveRenameTargets.Clear(); + ActiveRenameTargets.AddRange(renameTargets.Select(t => t.Item1)); + isRenaming = true; + } + break; + + default: + if (Application.isPlaying) + { + Debug.LogWarning($"[Rename Variables] Cannot rename all {unit.kind} variables while in play mode!"); + break; + } + isRenaming = true; + renameTargets.Clear(); + renameTargets.AddRange(GraphUtility.GetCurrentlyAccessibleProjectUnits(currentName, unit.kind)); + ActiveRenameTargets.Clear(); + ActiveRenameTargets.AddRange(renameTargets.Select(t => t.Item1)); + oldProjectName = currentName; + break; } + } - return base.GetPortInspector(port, metadata); + private bool ShouldEndRename() + { + return isRenaming && (!selection.Contains(unit) || + GUI.GetNameOfFocusedControl() != controlName || + e.keyCode == KeyCode.Return || + e.keyCode == KeyCode.Escape || + !canvas.isMouseOver); } - protected override IEnumerable contextOptions + private void ExecuteEndRename() { - get + isRenaming = false; + ActiveRenameTargets.Clear(); + + if (oldProjectName != null && newProjectName != null && oldProjectName != newProjectName) { - foreach (var option in base.contextOptions) + if (unit.kind == VariableKind.Application || unit.kind == VariableKind.Saved) { - yield return option; - } - - if (!unit.name.hasValidConnection && !Flow.CanPredict(unit.name, reference)) - yield break; + bool confirm = EditorUtility.DisplayDialog( + $"Update ALL {unit.kind} Variables?", + $"This will search ALL scenes and macros to update '{oldProjectName}' to '{newProjectName}'.\n\nThis operation is FINAL and cannot be undone!", + "Update All", + "Rename Only" + ); - yield return new DropdownOption((Action)FindAll, "Find/All"); - yield return new DropdownOption((Action)FindSetters, "Find/Setters"); - yield return new DropdownOption((Action)FindGetters, "Find/Getters"); + if (confirm) + { + if (unit.kind == VariableKind.Application) + GraphUtility.RenameApplicationVariables(oldProjectName, newProjectName); + else + GraphUtility.RenameSavedVariables(oldProjectName, newProjectName); + } + } } - } - private void FindAll() - { - var value = Flow.Predict(unit.name, reference); - if (value is string name) - NodeFinderWindow.Open($"{name} [SetVariable: {unit.kind}] | {name} [GetVariable: {unit.kind}]"); + oldProjectName = null; + newProjectName = null; } - private void FindSetters() - { - var value = Flow.Predict(unit.name, reference); - if (value is string name) - NodeFinderWindow.Open($"{name} [SetVariable: {unit.kind}]"); - } + private bool IsSceneRequired() => unit.kind == VariableKind.Object || unit.kind == VariableKind.Scene; + + #endregion + + #region Search Helpers + + private void FindAll() => OpenNodeFinder($"{{0}} [SetVariable: {unit.kind}] | {{0}} [GetVariable: {unit.kind}]"); + private void FindSetters() => OpenNodeFinder($"{{0}} [SetVariable: {unit.kind}]"); + private void FindGetters() => OpenNodeFinder($"{{0}} [GetVariable: {unit.kind}]"); - private void FindGetters() + private void OpenNodeFinder(string querySuffix) { - var value = Flow.Predict(unit.name, reference); - if (value is string name) - NodeFinderWindow.Open($"{name} [GetVariable: {unit.kind}]"); + if (Flow.Predict(unit.name, reference) is string varName) + { + NodeFinderWindow.Open(string.Format(querySuffix, varName)); + } } private IEnumerable GetNameSuggestions() { return EditorVariablesUtility.GetVariableNameSuggestions(unit.kind, reference); } + + #endregion } -} +} \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitConnectionWidget.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitConnectionWidget.cs index 7d96d435..e68e4558 100644 --- a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitConnectionWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitConnectionWidget.cs @@ -166,9 +166,7 @@ protected virtual void DrawConnection() } } - var thickness = 3; - - GraphGUI.DrawConnection(color, sourceHandleEdgeCenter, destinationHandleEdgeCenter, Edge.Right, Edge.Left, null, Vector2.zero, UnitConnectionStyles.relativeBend, UnitConnectionStyles.minBend, thickness); + GraphGUI.DrawConnection(color, sourceHandleEdgeCenter, destinationHandleEdgeCenter, sourceEdge, destinationEdge, null, Vector2.zero, CommunityStyles.relativeBend, CommunityStyles.minBend, CommunityStyles.connectionThickness); } #endregion @@ -197,6 +195,9 @@ protected virtual void DrawConnection() #region Droplets + protected virtual Edge sourceEdge => Edge.Right; + protected virtual Edge destinationEdge => Edge.Left; + protected readonly List droplets = new List(); private float dropTime; @@ -230,8 +231,11 @@ protected virtual void DrawDroplets() else { var t = (droplet - handleAlignmentMargin) / (1 - 2 * handleAlignmentMargin); - - position = GraphGUI.GetPointOnConnection(t, sourceHandleEdgeCenter, destinationHandleEdgeCenter, Edge.Bottom, Edge.Top, UnitConnectionStyles.relativeBend, UnitConnectionStyles.minBend); +#if ENABLE_VERTICAL_FLOW + position = GraphGUI.GetPointOnConnection(t, sourceHandleEdgeCenter, destinationHandleEdgeCenter, sourceEdge, destinationEdge, CommunityStyles.relativeBend, CommunityStyles.minBend); +#else + position = GraphGUI.GetPointOnConnection(t, sourceHandleEdgeCenter, destinationHandleEdgeCenter, sourceEdge, destinationEdge, UnitConnectionStyles.relativeBend, UnitConnectionStyles.minBend); +#endif } var size = GetDropletSize(); diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitPortWidget.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitPortWidget.cs index c151ccdd..11b23950 100644 --- a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitPortWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitPortWidget.cs @@ -292,6 +292,8 @@ public override Rect hotArea } } + protected virtual Vector2 HandleSize => Styles.handleSize; + public override void CachePosition() { var outside = edge.Normal().x; @@ -300,9 +302,9 @@ public override void CachePosition() var handlePosition = new Rect( x, - y + (EditorGUIUtility.singleLineHeight - Styles.handleSize.y + Styles.spaceBetweenEdgeAndHandle) / 2, - Styles.handleSize.x, - Styles.handleSize.y + y + (EditorGUIUtility.singleLineHeight - HandleSize.y + Styles.spaceBetweenEdgeAndHandle) / 2, + HandleSize.x, + HandleSize.y ); if (flip) handlePosition.x -= handlePosition.width; @@ -343,6 +345,21 @@ public override void CachePosition() this.labelPosition = labelPosition; } + var bounds = identifierPosition; + + if (bounds.width < 16f) + { + bounds.x -= (16f - bounds.width) / 2f; + bounds.width = 16f; + } + if (bounds.height < 16f) + { + bounds.y -= (16f - bounds.height) / 2f; + bounds.height = 16f; + } + + identifierPosition = bounds; + surroundPosition = Styles.surroundPadding.Add(identifierPosition); } @@ -450,6 +467,10 @@ public override float zIndex #region Drawing + protected virtual float connectionMinBend => CommunityStyles.minBend; + protected virtual float connectionrelativeBend => CommunityStyles.relativeBend; + protected virtual Edge connectionEndEdge => edge == Edge.Left ? Edge.Right : Edge.Left; + public override bool canClip => base.canClip && canvas.connectionSource != port; protected virtual bool showInspector => false; @@ -786,6 +807,8 @@ private void DrawInspector() } } + protected static readonly Vector2 PortalSize = new Vector2(16, 16); + protected virtual void DrawConnectionSource() { var start = handlePosition.GetEdgeCenter(edge); @@ -795,20 +818,27 @@ protected virtual void DrawConnectionSource() canvas.connectionEnd = mousePosition; } - float minBend = 20f; + Vector2 size = HandleSize; + Texture texture = handleTextureConnected; - GraphGUI.DrawConnection - ( - color, - start, - canvas.connectionEnd, - edge, - null, - handleTextureConnected, - Styles.handleSize, - UnitConnectionStyles.relativeBend, - minBend - ); + if (e.alt && this is ValueInputWidget or ValueOutputWidget) + { + size = PortalSize; + texture = CommunityStyles.valuePortalConnection; + } + + GraphGUI.DrawConnection( + color, + start, + canvas.connectionEnd, + edge, + connectionEndEdge, + texture, + size, + connectionrelativeBend, + connectionMinBend, + CommunityStyles.connectionThickness + ); } private void DrawSurround() diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitWidget.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitWidget.cs deleted file mode 100644 index 078279d8..00000000 --- a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitWidget.cs +++ /dev/null @@ -1,2406 +0,0 @@ -#if NEW_UNIT_UI -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEngine; -using Unity.VisualScripting.Community.Libraries.Humility; -#if ENABLE_VERTICAL_FLOW -namespace Unity.VisualScripting.Community -{ - public class UnitWidget : NodeWidget, IUnitWidget where TUnit : class, IUnit - { - public UnitWidget(FlowCanvas canvas, TUnit unit) : base(canvas, unit) - { - unit.onPortsChanged += CacheDefinition; - unit.onPortsChanged += SubWidgetsChanged; - } - - public override void Dispose() - { - base.Dispose(); - - unit.onPortsChanged -= CacheDefinition; - unit.onPortsChanged -= SubWidgetsChanged; - } - - public override IEnumerable subWidgets => unit.ports.Select(port => canvas.Widget(port)); - - - #region Model - - protected TUnit unit => element; - - IUnit IUnitWidget.unit => unit; - - protected IUnitDebugData unitDebugData => GetDebugData(); - - private UnitDescription description; - - private UnitAnalysis analysis => unit.Analysis(context); - - protected readonly List ports = new List(); - - protected readonly List inputs = new List(); - - protected readonly List outputs = new List(); - - private readonly List settingNames = new List(); - - public override Rect hotArea => outerPosition; - - protected IEnumerable settings - { - get - { - foreach (var settingName in settingNames) - { - yield return metadata[settingName]; - } - } - } - - protected override void CacheItemFirstTime() - { - base.CacheItemFirstTime(); - CacheDefinition(); - } - - protected virtual void CacheDefinition() - { - inputs.Clear(); - outputs.Clear(); - ports.Clear(); - inputs.AddRange(unit.inputs.Select(port => canvas.Widget(port))); - outputs.AddRange(unit.outputs.Select(port => canvas.Widget(port))); - ports.AddRange(inputs); - ports.AddRange(outputs); - - Reposition(); - } - - protected override void CacheDescription() - { - description = unit.Description(); - - titleContent.text = description.shortTitle; - titleContent.tooltip = description.summary; - surtitleContent.text = description.surtitle; - subtitleContent.text = description.subtitle; - - Reposition(); - } - - protected override void CacheMetadata() - { - settingNames.Clear(); - - settingNames.AddRange(metadata.valueType - .GetMembers() - .Where(mi => mi.HasAttribute()) - .OrderBy(mi => mi.GetAttributes().OfType().FirstOrDefault()?.order ?? int.MaxValue) - .ThenBy(mi => mi.MetadataToken) - .Select(mi => mi.Name)); - - lock (settingLabelsContents) - { - settingLabelsContents.Clear(); - - foreach (var setting in settings) - { - var settingLabel = setting.GetAttribute().label; - - GUIContent settingContent; - - if (string.IsNullOrEmpty(settingLabel)) - { - settingContent = null; - } - else - { - settingContent = new GUIContent(settingLabel); - } - - settingLabelsContents.Add(setting, settingContent); - } - } - - Reposition(); - } - - public virtual Inspector GetPortInspector(IUnitPort port, Metadata metadata) - { - return metadata.Inspector(); - } - - #endregion - - - #region Lifecycle - - public override bool foregroundRequiresInput => showSettings || unit.valueInputs.Any(vip => vip.hasDefaultValue); - - public override void HandleInput() - { - if (isDragging && e.ctrlOrCmd) - { - List otherRects = graph.elements.Where(e => e != element && !(e is IUnitConnection)) - .Select(SnapTarget) - .ToList(); - - var snapResult = RectUtility.CheckSnap(outerPosition, otherRects, threshold: 15f); - - if (snapResult.snapped) - { - var pos = BoltCore.Configuration.snapToGrid ? GraphGUI.SnapToGrid(snapResult.snapPosition) : snapResult.snapPosition; - _position = OuterToEdgePosition(new Rect(pos.x, pos.y, _position.width, _position.height)); - snapLines = snapResult.snapLines; - Reposition(); - } - else - { - snapLines.Clear(); - } - } - - if (canvas.isCreatingConnection) - { - if (e.IsMouseDown(MouseButton.Left)) - { - var source = canvas.connectionSource; - var destination = source.CompatiblePort(unit); - - if (destination != null) - { - UndoUtility.RecordEditedObject("Connect Nodes"); - source.ValidlyConnectTo(destination); - canvas.connectionSource = null; - canvas.Widget(source.unit).Reposition(); - canvas.Widget(destination.unit).Reposition(); - GUI.changed = true; - } - - e.Use(); - } - else if (e.IsMouseDown(MouseButton.Right)) - { - canvas.CancelConnection(); - e.Use(); - } - } - - base.HandleInput(); - } - - private Rect SnapTarget(IGraphElement e) - { - if (e is Unit unit) - { - return canvas.Widget(unit).outerPosition; - } - return canvas.Widget(e).position; - } - - #endregion - - - #region Contents - - protected readonly GUIContent titleContent = new GUIContent(); - - protected readonly GUIContent surtitleContent = new GUIContent(); - - protected readonly GUIContent subtitleContent = new GUIContent(); - - protected readonly Dictionary settingLabelsContents = new Dictionary(); - - #endregion - - - #region Positioning - - protected override bool snapToGrid => BoltCore.Configuration.snapToGrid; - protected virtual bool isSpecialPortsColor => _isSpecialColor; - protected virtual Color? PortsbackgroundColor => null; - - public override IEnumerable positionDependers => ports.Cast(); - - protected Rect _position; - - public override Rect position - { - get { return _position; } - set { unit.position = value.position; } - } - - public Rect titlePosition { get; protected set; } - - public Rect surtitlePosition { get; protected set; } - - public Rect subtitlePosition { get; protected set; } - - public Rect iconPosition { get; protected set; } - - public List iconsPositions { get; protected set; } = new List(); - - public Dictionary settingsPositions { get; } = new Dictionary(); - - public Rect headerAddonPosition { get; protected set; } - - public Rect portsBackgroundPosition { get; protected set; } - - private bool _isSpecialColor; - - public override void CachePosition() - { - const float compactY = 0.5f; - const float compactX = 0.8f; - - // TODO: Make invalid control ports vertical. - var valueInputs = inputs - .Where(p => - p is ValueInputWidget || - p is InvalidInputWidget) - .Cast(); - - var valueOutputs = outputs - .Where(p => - p is ValueOutputWidget || - p is InvalidOutputWidget) - .Cast(); - - var controlInputs = inputs.OfType().ToList(); - var controlOutputs = outputs.OfType().ToList(); - - var valueInputsWidth = valueInputs.Any() ? valueInputs.Max(p => p.GetInnerWidth()) : 0f; - var outputsWidth = valueOutputs.Any() ? valueOutputs.Max(p => p.GetInnerWidth()) : 0f; - - var portsWidth = valueInputsWidth + Styles.spaceBetweenInputsAndOutputs + outputsWidth; - - const float spaceBetweenControlPorts = 10; - - portsWidth = Mathf.Max(portsWidth, (controlInputs.Any() ? Mathf.Min(90f, controlInputs.Max(p => p.GetInnerWidth()) + spaceBetweenControlPorts) : 0f) * controlInputs.Count); - portsWidth = Mathf.Max(portsWidth, (controlOutputs.Any() ? Mathf.Min(90f, controlOutputs.Max(p => p.GetInnerWidth()) + spaceBetweenControlPorts) : 0f) * controlOutputs.Count); - - settingsPositions.Clear(); - var settingsWidth = 0f; - - if (showSettings) - { - foreach (var setting in settings) - { - var settingLabelContent = settingLabelsContents[setting]; - var settingWidth = 0f; - - if (settingLabelContent != null) - settingWidth += Styles.settingLabel.CalcSize(settingLabelContent).x; - - settingWidth += setting.Inspector().GetAdaptiveWidth(); - settingWidth = Mathf.Min(settingWidth, Styles.maxSettingsWidth); - - settingsPositions.Add(setting, new Rect(0, 0, settingWidth, 0)); - settingsWidth = Mathf.Max(settingsWidth, settingWidth); - } - } - - var headerAddonWidth = showHeaderAddon ? GetHeaderAddonWidth() : 0f; - var titleWidth = Styles.title.CalcSize(titleContent).x; - var headerTextWidth = titleWidth; - - if (showSurtitle) - headerTextWidth = Mathf.Max(headerTextWidth, Styles.surtitle.CalcSize(surtitleContent).x); - if (showSubtitle) - headerTextWidth = Mathf.Max(headerTextWidth, Styles.subtitle.CalcSize(subtitleContent).x); - - var iconsWidth = 0f; - if (showIcons) - { - var iconsColumns = Mathf.Ceil((float)description.icons.Length / Styles.iconsPerColumn); - iconsWidth = iconsColumns * Styles.iconsSize + ((iconsColumns - 1) * Styles.iconsSpacing * compactX); - } - - var headerWidth = Mathf.Max(headerTextWidth + iconsWidth, - Mathf.Max(settingsWidth, headerAddonWidth)) + Styles.iconSize + (Styles.spaceAfterIcon * compactX); - - var innerWidth = Mathf.Max(portsWidth, headerWidth); - var edgeWidth = InnerToEdgePosition(new Rect(0, 0, innerWidth, 0)).width; - - var edgeOrigin = unit.position; - var edgeX = edgeOrigin.x; - var edgeY = edgeOrigin.y; - - var innerOrigin = EdgeToInnerPosition(new Rect(edgeOrigin, Vector2.zero)).position; - var innerX = innerOrigin.x; - var innerY = innerOrigin.y; - - var y = innerY; - var headerHeight = 0f; - -#if NEW_UNIT_STYLE - var controlInputsHeight = controlInputs.Any(c => c.showLabel) ? controlInputs.Max(p => p.GetHeight()) : 0f; -#else - var controlInputsHeight = controlInputs.Any(c => c.showLabel) ? controlInputs.Max(p => p.GetHeight()) + 4 : 0f; -#endif - headerHeight += controlInputsHeight; - y += controlInputsHeight; - - iconPosition = new Rect(innerX, y, Styles.iconSize, Styles.iconSize); - var headerTextX = iconPosition.xMax + Styles.spaceAfterIcon * compactX; - - if (showSurtitle) - { - var h = Styles.surtitle.CalcHeight(surtitleContent, headerTextWidth); - surtitlePosition = new Rect(headerTextX, y, headerTextWidth, h); - headerHeight += h + Styles.spaceAfterSurtitle * compactY; - y += h + Styles.spaceAfterSurtitle * compactY; - } - - if (showTitle) - { - var h = Styles.title.CalcHeight(titleContent, headerTextWidth); - titlePosition = new Rect(headerTextX, y, headerTextWidth, h); - headerHeight += h; - y += h; - } - - if (showSubtitle) - { - headerHeight += Styles.spaceBeforeSubtitle * compactY; - y += Styles.spaceBeforeSubtitle * compactY; - - var h = Styles.subtitle.CalcHeight(subtitleContent, headerTextWidth); - subtitlePosition = new Rect(headerTextX, y, headerTextWidth, h); - headerHeight += h; - y += h; - } - - iconsPositions.Clear(); - - if (showIcons) - { - var iconRow = 0; - var iconCol = 0; - - for (int i = 0; i < description.icons.Length; i++) - { - var iconPosition = new Rect - ( - innerX + innerWidth - ((iconCol + 1) * Styles.iconsSize) - ((iconCol) * Styles.iconsSpacing), - innerY + (iconRow * (Styles.iconsSize + Styles.iconsSpacing)), - Styles.iconsSize, - Styles.iconsSize - ); - - iconsPositions.Add(iconPosition); - - iconRow++; - - if (iconRow % Styles.iconsPerColumn == 0) - { - iconCol++; - iconRow = 0; - } - } - } - - if (showSettings) - { - headerHeight += Styles.spaceBeforeSettings * compactY; - y += Styles.spaceBeforeSettings * compactY; - var last = settings.Last(); - foreach (var setting in settings) - { - var settingWidth = settingsPositions[setting].width; - using (LudiqGUIUtility.currentInspectorWidth.Override(settingWidth)) - { - var settingHeight = LudiqGUI.GetInspectorHeight(null, setting, settingWidth, settingLabelsContents[setting] ?? GUIContent.none); - settingsPositions[setting] = new Rect(headerTextX, y, settingWidth, settingHeight); - if (setting != last) - { - y += settingHeight + Styles.spaceBetweenSettings; - headerHeight += settingHeight + Styles.spaceBetweenSettings; - } - else - { - y += settingHeight - Styles.spaceBetweenSettings; - headerHeight += settingHeight - Styles.spaceBetweenSettings; - } - } - } - } - - if (showHeaderAddon) - { - var addonHeight = GetHeaderAddonHeight(headerAddonWidth); - headerAddonPosition = new Rect(headerTextX, y, headerAddonWidth, addonHeight); - y += addonHeight; - headerHeight += addonHeight; - } - - headerHeight = Mathf.Max(headerHeight, Styles.iconSize * 0.7f); - - y = innerY + headerHeight + Styles.spaceBeforePorts; - var innerHeight = headerHeight; - - var controlOutputsHeight = 0f; - if (showPorts) - { - bool hasValuePorts = ports.Any(p => p.port is ValueInput or ValueOutput or InvalidInput or InvalidOutput); - - if (hasValuePorts) - { - innerHeight += Styles.spaceBeforePorts * compactY; - y += Styles.spaceBeforePorts * compactY; - } - - float portsBackgroundY = y; - float portsBackgroundHeight = hasValuePorts ? Styles.portsBackground.padding.top * compactY : 0f; - y += portsBackgroundHeight; - - var portStartY = y; - - float inputsHeight = 0f; - foreach (var input in inputs) - { - if (input is ControlInputWidget) continue; - float h = input.GetHeight(); - input.y = y; - y += h + Styles.spaceBetweenPorts * compactY; - inputsHeight += h + Styles.spaceBetweenPorts * compactY; - } - - float outputsHeight = 0f; - foreach (var output in outputs) - { - if (output is ControlOutputWidget) continue; - float h = output.GetHeight(); - output.y = portStartY + outputsHeight; - outputsHeight += h + Styles.spaceBetweenPorts * compactY; - } - - float portsHeight = Mathf.Max(inputsHeight, outputsHeight); - if (hasValuePorts) - { - portsBackgroundHeight += portsHeight + Styles.portsBackground.padding.bottom * compactY; - innerHeight += portsHeight + Styles.portsBackground.padding.bottom * compactY; - } - - if (controlInputs.Count > 0) - { - int portCount = controlInputs.Count; - - float controlY = edgeY - Styles.spaceBeforePorts - Styles.spaceAfterControlInputs; - - float totalSlotSpace = OuterToEdgePosition(new Rect(edgeX, portsBackgroundY, edgeWidth, portsBackgroundHeight)).width - Styles.spaceBeforePorts; - float slotWidth = totalSlotSpace / portCount; - - for (int i = 0; i < portCount; i++) - { - var widget = controlInputs[i]; - float slotCenter = edgeX + (slotWidth * (i + 0.5f)); - widget.x = slotCenter; - widget.y = controlY; - } - } - - if (controlOutputs.Count > 0) - { - int portCount = controlOutputs.Count; - - float maxHeight = 0f; - foreach (var widget in controlOutputs) - { - maxHeight = Mathf.Max(maxHeight, widget.GetHeight()); - } - - controlOutputsHeight = maxHeight + 3; - - float controlY = innerY + innerHeight + Styles.spaceBeforePorts + controlOutputsHeight + Styles.spaceBeforeControlOutputs; - - float totalSlotSpace = OuterToEdgePosition(new Rect(edgeX, portsBackgroundY, edgeWidth, portsBackgroundHeight)).width - Styles.spaceBeforePorts; - float slotWidth = totalSlotSpace / portCount; - - for (int i = 0; i < portCount; i++) - { - var widget = controlOutputs[i]; - float slotCenter = edgeX + (slotWidth * (i + 0.5f)); - widget.x = slotCenter; - widget.y = controlY; - } - } - portsBackgroundPosition = new Rect(edgeX, portsBackgroundY, edgeWidth, portsBackgroundHeight); - } - - var edgeHeight = InnerToEdgePosition(new Rect(0, 0, 0, innerHeight)).height; - _position = new Rect(edgeX, edgeY, edgeWidth, edgeHeight + controlOutputsHeight); - } - - protected virtual float GetHeaderAddonWidth() - { - return 0; - } - - protected virtual float GetHeaderAddonHeight(float width) - { - return 0; - } - - #endregion - - - #region Drawing - private List snapLines = new List(); - - protected void DrawSnapLines() - { - if (snapLines == null || snapLines.Count == 0) - return; - - Handles.color = new Color32(64, 113, 156, 255); - foreach (var line in snapLines) - { - Handles.DrawLine(line.start, line.end); - } - } - - protected virtual NodeColorMix baseColor => NodeColor.Gray; - - protected override NodeColorMix color - { - get - { - _isSpecialColor = false; - - if (unitDebugData.runtimeException != null) - { - return NodeColor.Red; - } - - var color = baseColor; - - if (analysis.warnings.Count > 0) - { - var mostSevereWarning = Warning.MostSevereLevel(analysis.warnings); - - switch (mostSevereWarning) - { - case WarningLevel.Error: - color = NodeColor.Red; - _isSpecialColor = true; - break; - - case WarningLevel.Severe: - color = NodeColor.Orange; - _isSpecialColor = true; - break; - - case WarningLevel.Caution: - color = NodeColor.Yellow; - - break; - } - } - - if (EditorApplication.isPaused) - { - if (EditorTimeBinding.frame == unitDebugData.lastInvokeFrame) - { - return NodeColor.Blue; - } - } - else - { - var mix = color; - mix.blue = Mathf.Lerp(1, 0, (EditorTimeBinding.time - unitDebugData.lastInvokeTime) / Styles.invokeFadeDuration); - - return mix; - } - - return color; - } - } - - protected override NodeShape shape => NodeShape.Square; - - protected virtual bool showTitle => !string.IsNullOrEmpty(description.shortTitle); - - protected virtual bool showSurtitle => !string.IsNullOrEmpty(description.surtitle); - - protected virtual bool showSubtitle => !string.IsNullOrEmpty(description.subtitle); - - protected virtual bool showIcons => description.icons.Length > 0; - - protected virtual bool showSettings => settingNames.Count > 0; - - protected virtual bool showHeaderAddon => false; - - protected virtual bool showPorts => ports.Count > 0; - - protected override bool dim - { - get - { - var dim = BoltCore.Configuration.dimInactiveNodes && !analysis.isEntered; - - if (isMouseOver || isSelected) - { - dim = false; - } - - if (BoltCore.Configuration.dimIncompatibleNodes && canvas.isCreatingConnection) - { - dim = !unit.ports.Any(p => canvas.connectionSource == p || canvas.connectionSource.CanValidlyConnectTo(p)); - } - - return dim; - } - } - public override void DrawOverlay() - { - base.DrawOverlay(); - if (isDragging && e.ctrlOrCmd) - DrawSnapLines(); - } - public override void DrawForeground() - { - BeginDim(); - - base.DrawForeground(); - - DrawIcon(); - - if (showSurtitle) - { - DrawSurtitle(); - } - - if (showTitle) - { - DrawTitle(); - } - - if (showSubtitle) - { - DrawSubtitle(); - } - - if (showIcons) - { - DrawIcons(); - } - - if (showSettings) - { - DrawSettings(); - } - - if (showHeaderAddon) - { - DrawHeaderAddon(); - } - - if (showPorts) - { - DrawPortsBackground(); - } - - EndDim(); - } - - protected void DrawIcon() - { - var icon = description.icon ?? BoltFlow.Icons.unit; - - if (icon != null && icon[(int)iconPosition.width]) - { - GUI.DrawTexture(iconPosition, icon[(int)iconPosition.width]); - } - } - - protected void DrawTitle() - { - GUI.Label(titlePosition, titleContent, invertForeground ? Styles.titleInverted : Styles.title); - } - - protected void DrawSurtitle() - { - GUI.Label(surtitlePosition, surtitleContent, invertForeground ? Styles.surtitleInverted : Styles.surtitle); - } - - protected void DrawSubtitle() - { - GUI.Label(subtitlePosition, subtitleContent, invertForeground ? Styles.subtitleInverted : Styles.subtitle); - } - - protected void DrawIcons() - { - for (int i = 0; i < description.icons.Length; i++) - { - var icon = description.icons[i]; - var position = iconsPositions[i]; - - GUI.DrawTexture(position, icon?[(int)position.width]); - } - } - - private void DrawSettings() - { - if (graph.zoom < FlowCanvas.inspectorZoomThreshold) - { - return; - } - - EditorGUI.BeginDisabledGroup(!e.IsRepaint && isMouseThrough && !isMouseOver); - - EditorGUI.BeginChangeCheck(); - - foreach (var setting in settings) - { - DrawSetting(setting); - } - - if (EditorGUI.EndChangeCheck()) - { - unit.Define(); - Reposition(); - } - - EditorGUI.EndDisabledGroup(); - } - - protected void DrawSetting(Metadata setting) - { - var settingPosition = settingsPositions[setting]; - - using (LudiqGUIUtility.currentInspectorWidth.Override(settingPosition.width)) - using (Inspector.expandTooltip.Override(false)) - { - var label = settingLabelsContents[setting]; - - if (label == null) - { - LudiqGUI.Inspector(setting, settingPosition, GUIContent.none); - } - else - { - using (Inspector.defaultLabelStyle.Override(Styles.settingLabel)) - using (LudiqGUIUtility.labelWidth.Override(Styles.settingLabel.CalcSize(label).x)) - { - LudiqGUI.Inspector(setting, settingPosition, label); - } - } - } - } - - protected virtual void DrawHeaderAddon() { } - - protected void DrawPortsBackground() - { - if (canvas.showRelations) - { - foreach (var relation in unit.relations) - { - var sourcePort = relation.source; - var destinationPort = relation.destination; - - var sourceWidget = ports.Single(pw => pw.port == sourcePort); - var destinationWidget = ports.Single(pw => pw.port == destinationPort); - - Vector2 start = sourceWidget.handlePosition.center; - Vector2 end = destinationWidget.handlePosition.center; - - bool valueToControl = - sourcePort is ValueInput && - destinationPort is ControlInput; - - // Requirement - if (valueToControl) - { - start = sourceWidget.handlePosition.center; - - end = new Vector2( - destinationWidget.handlePosition.center.x, - destinationWidget.handlePosition.yMin - ); - } - - float distance = Vector2.Distance(start, end); - float offset = Mathf.Min(distance * 0.35f, 40f); - - Vector2 startDir; - Vector2 endDir; - - if (valueToControl) - { - startDir = Vector2.up; - endDir = Vector2.down; - } - else - { - startDir = PortDirection(sourcePort); - endDir = PortDirection(destinationPort); - } - - Vector2 startTangent = start + startDir * offset; - Vector2 endTangent = end + endDir * offset; - - Handles.DrawBezier( - start, - end, - startTangent, - endTangent, - ColorPalette.unityBackgroundMid, - null, - 3f - ); - } - - static Vector2 PortDirection(IUnitPort port) - { - return port switch - { - ControlOutput => Vector2.down, - ControlInput => Vector2.up, - - ValueOutput => Vector2.left, - ValueInput => Vector2.right, - - _ => Vector2.right - }; - } - } - else - { - if (e.IsRepaint && ports.Count(p => p.port is ValueInput or ValueOutput) > 0) - { -#if NEW_UNIT_STYLE - var previous = GUI.backgroundColor; - - if (isSpecialPortsColor) - { - GUI.backgroundColor = PortsbackgroundColor ?? ToColor(color); - } - - Styles.portsBackground.Draw(portsBackgroundPosition, false, false, false, false); - - if (isSpecialPortsColor) - GUI.backgroundColor = previous; -#else - Styles.portsBackground.Draw(portsBackgroundPosition, false, false, false, false); -#endif - } - } - } - - private readonly Dictionary colorMap = new Dictionary() - { - { NodeColor.Gray, new Color(0.5f, 0.5f, 0.5f) }, - { NodeColor.Blue, new Color(0.25f, 0.6f, 1f) }, - { NodeColor.Teal, new Color(0f, 0.75f, 0.75f) }, - { NodeColor.Green, new Color(0.4f, 0.8f, 0.4f) }, - { NodeColor.Yellow, new Color(1f, 0.9f, 0.2f) }, - { NodeColor.Orange, new Color(1f, 0.6f, 0.2f) }, - { NodeColor.Red, new Color(1f, 0.3f, 0.3f) } - }; - - public Color ToColor(NodeColorMix mix) - { - mix = mix.normalized; - Color result = Color.black; - foreach (var kvp in mix) - if (colorMap.TryGetValue(kvp.Key, out var c)) - result += c * kvp.Value; - - result.r = Mathf.Clamp01(result.r); - result.g = Mathf.Clamp01(result.g); - result.b = Mathf.Clamp01(result.b); - result.a = 1f; - return result; - } - - #endregion - - - #region Selecting - - public override bool canSelect => true; - - #endregion - - - #region Dragging - - public override bool canDrag => true; - - public override void ExpandDragGroup(HashSet dragGroup) - { - if (BoltCore.Configuration.carryChildren) - { - foreach (var output in unit.outputs) - { - foreach (var connection in output.connections) - { - if (dragGroup.Contains(connection.destination.unit)) - { - continue; - } - - dragGroup.Add(connection.destination.unit); - - canvas.Widget(connection.destination.unit).ExpandDragGroup(dragGroup); - } - } - } - } - - #endregion - - - #region Deleting - - public override bool canDelete => true; - - #endregion - - - #region Clipboard - - public override void ExpandCopyGroup(HashSet copyGroup) - { - copyGroup.UnionWith(unit.connections.Cast()); - } - - #endregion - - - #region Context - - protected override IEnumerable contextOptions - { - get - { - yield return new DropdownOption((Action)ReplaceUnit, "Replace..."); - - foreach (var baseOption in base.contextOptions) - { - yield return baseOption; - } - - if (selection.Count > 0) - { - yield return new DropdownOption((Action)ConvertToEmbed, "Selection/To Embed Subgraph"); - yield return new DropdownOption((Action)ConvertToMacro, "Selection/To Macro Subgraph"); - } - } - } - - private void ConvertToEmbed() - { - NodeSelection.Convert(GraphSource.Embed); - } - - private void ConvertToMacro() - { - NodeSelection.Convert(GraphSource.Macro); - } - - private void ReplaceUnit() - { - UnitWidgetHelper.ReplaceUnit(unit, reference, context, selection, e); - } - - #endregion - - - public static class Styles - { - static Styles() - { - // Disabling word wrap because Unity's CalcSize and CalcHeight - // are broken w.r.t. pixel-perfection and matrix - - title = new GUIStyle(BoltCore.Styles.nodeLabel); - title.padding = new RectOffset(0, 5, 0, 2); - title.margin = new RectOffset(0, 0, 0, 0); - title.fontSize = 12; - title.alignment = TextAnchor.MiddleLeft; - title.wordWrap = false; - - surtitle = new GUIStyle(BoltCore.Styles.nodeLabel); - surtitle.padding = new RectOffset(0, 5, 0, 0); - surtitle.margin = new RectOffset(0, 0, 0, 0); - surtitle.fontSize = 10; - surtitle.alignment = TextAnchor.MiddleLeft; - surtitle.wordWrap = false; - - subtitle = new GUIStyle(surtitle); - subtitle.padding.bottom = 2; - - titleInverted = new GUIStyle(title); - titleInverted.normal.textColor = ColorPalette.unityBackgroundDark; - - surtitleInverted = new GUIStyle(surtitle); - surtitleInverted.normal.textColor = ColorPalette.unityBackgroundDark; - - subtitleInverted = new GUIStyle(subtitle); - subtitleInverted.normal.textColor = ColorPalette.unityBackgroundDark; - -#if NEW_UNIT_STYLE - if (EditorGUIUtility.isProSkin) - { - portsBackground = new GUIStyle - { - padding = new RectOffset(0, 0, 6, 5), - border = new RectOffset(0, 0, 2, 2) - }; - - portsBackground.normal.background = CommunityStyles.MakeBorderedTexture(CommunityStyles.backgroundColor, CommunityStyles.backgroundColor.Darken(0.05f)); - } - else - { - portsBackground = new GUIStyle - { - normal = { background = CommunityStyles.MakeBorderedTexture(CommunityStyles.backgroundColor, CommunityStyles.backgroundColor.Brighten(0.05f)) }, - padding = new RectOffset(0, 0, 6, 5) - }; - } -#else - portsBackground = VisualScripting.UnitWidget.Styles.portsBackground; -#endif - settingLabel = new GUIStyle(BoltCore.Styles.nodeLabel); - settingLabel.padding.left = 0; - settingLabel.padding.right = 5; - settingLabel.wordWrap = false; - settingLabel.clipping = TextClipping.Clip; - } - - public static readonly GUIStyle title; - - public static readonly GUIStyle surtitle; - - public static readonly GUIStyle subtitle; - - public static readonly GUIStyle titleInverted; - - public static readonly GUIStyle surtitleInverted; - - public static readonly GUIStyle subtitleInverted; - - public static readonly GUIStyle settingLabel; - - public static readonly float spaceAroundLineIcon = 5; - - public static readonly float spaceBeforePorts = 8; -#if NEW_UNIT_STYLE - public static readonly float spaceBeforeControlOutputs = 6; - - public static readonly float spaceAfterControlInputs = 20; -#else - public static readonly float spaceBeforeControlOutputs = 5; - public static readonly float spaceAfterControlInputs = 17; -#endif - public static readonly float spaceBetweenInputsAndOutputs = 8; - - public static readonly float spaceBeforeSettings = 2; - - public static readonly float spaceBetweenSettings = 3; - - public static readonly float spaceBetweenPorts = 3; - - public static readonly float spaceAfterSettings = 0; - - public static readonly float maxSettingsWidth = 150; - - public static readonly GUIStyle portsBackground; - - public static readonly float iconSize = 24f; - - public static readonly float iconsSize = IconSize.Small; - - public static readonly float iconsSpacing = 3; - - public static readonly int iconsPerColumn = 2; - - public static readonly float spaceAfterIcon = 3; - - public static readonly float spaceAfterSurtitle = 1; - - public static readonly float spaceBeforeSubtitle = 0; - - public static readonly float invokeFadeDuration = 0.5f; - } - } - - internal class UnitWidgetHelper - { - internal static void ReplaceUnit(IUnit unit, GraphReference reference, IGraphContext context, GraphSelection selection, EventWrapper eventWrapper) - { - var oldUnit = unit; - var unitPosition = oldUnit.position; - var preservation = UnitPreservation.Preserve(oldUnit); - - var options = new UnitOptionTree(new GUIContent("Node")); - options.filter = UnitOptionFilter.Any; -#if VISUAL_SCRIPTING_1_8_0_OR_GREATER - options.filter.NoConnection = false; -#endif - options.reference = reference; - - var activatorPosition = new Rect(eventWrapper.mousePosition, new Vector2(200, 1)); - - LudiqGUI.FuzzyDropdown - ( - activatorPosition, - options, - null, - delegate (object _option) - { - var option = (IUnitOption)_option; - - context.BeginEdit(); - UndoUtility.RecordEditedObject("Replace Node"); - var graph = oldUnit.graph; - oldUnit.graph.units.Remove(oldUnit); - var newUnit = option.InstantiateUnit(); - newUnit.guid = Guid.NewGuid(); - newUnit.position = unitPosition; - graph.units.Add(newUnit); - preservation.RestoreTo(newUnit); - option.PreconfigureUnit(newUnit); - selection.Select(newUnit); - GUI.changed = true; - context.EndEdit(); - } - ); - } - } -} -#else -namespace Unity.VisualScripting.Community -{ - public class UnitWidget : NodeWidget, IUnitWidget where TUnit : class, IUnit - { - public UnitWidget(FlowCanvas canvas, TUnit unit) : base(canvas, unit) - { - unit.onPortsChanged += CacheDefinition; - unit.onPortsChanged += SubWidgetsChanged; - } - - public override void Dispose() - { - base.Dispose(); - - unit.onPortsChanged -= CacheDefinition; - unit.onPortsChanged -= SubWidgetsChanged; - } - - public override IEnumerable subWidgets => unit.ports.Select(port => canvas.Widget(port)); - - - #region Model - - protected TUnit unit => element; - - IUnit IUnitWidget.unit => unit; - - protected IUnitDebugData unitDebugData => GetDebugData(); - - private UnitDescription description; - - private UnitAnalysis analysis => unit.Analysis(context); - - protected readonly List ports = new List(); - - protected readonly List inputs = new List(); - - protected readonly List outputs = new List(); - - private readonly List settingNames = new List(); - - protected IEnumerable settings - { - get - { - foreach (var settingName in settingNames) - { - yield return metadata[settingName]; - } - } - } - - protected override void CacheItemFirstTime() - { - base.CacheItemFirstTime(); - CacheDefinition(); - } - - protected virtual void CacheDefinition() - { - inputs.Clear(); - outputs.Clear(); - ports.Clear(); - inputs.AddRange(unit.inputs.Select(port => canvas.Widget(port))); - outputs.AddRange(unit.outputs.Select(port => canvas.Widget(port))); - ports.AddRange(inputs); - ports.AddRange(outputs); - - Reposition(); - } - - protected override void CacheDescription() - { - description = unit.Description(); - - titleContent.text = description.shortTitle; - titleContent.tooltip = description.summary; - surtitleContent.text = description.surtitle; - subtitleContent.text = description.subtitle; - - Reposition(); - } - - protected override void CacheMetadata() - { - settingNames.Clear(); - - settingNames.AddRange(metadata.valueType - .GetMembers() - .Where(mi => mi.HasAttribute()) - .OrderBy(mi => mi.GetAttributes().OfType().FirstOrDefault()?.order ?? int.MaxValue) - .ThenBy(mi => mi.MetadataToken) - .Select(mi => mi.Name)); - - lock (settingLabelsContents) - { - settingLabelsContents.Clear(); - - foreach (var setting in settings) - { - var settingLabel = setting.GetAttribute().label; - - GUIContent settingContent; - - if (string.IsNullOrEmpty(settingLabel)) - { - settingContent = null; - } - else - { - settingContent = new GUIContent(settingLabel); - } - - settingLabelsContents.Add(setting, settingContent); - } - } - - Reposition(); - } - - public virtual Inspector GetPortInspector(IUnitPort port, Metadata metadata) - { - return metadata.Inspector(); - } - - #endregion - - - #region Lifecycle - - public override bool foregroundRequiresInput => showSettings || unit.valueInputs.Any(vip => vip.hasDefaultValue); - - public override void HandleInput() - { - if (isDragging && e.ctrlOrCmd) - { - List otherRects = graph.elements.Where(e => e != element && !(e is IUnitConnection)) - .Select(SnapTarget) - .ToList(); - - var snapResult = RectUtility.CheckSnap(outerPosition, otherRects, threshold: 15f); - - if (snapResult.snapped) - { - var pos = BoltCore.Configuration.snapToGrid ? GraphGUI.SnapToGrid(snapResult.snapPosition) : snapResult.snapPosition; - _position = OuterToEdgePosition(new Rect(pos.x, pos.y, _position.width, _position.height)); - snapLines = snapResult.snapLines; - Reposition(); - } - else - { - snapLines.Clear(); - } - } - - if (canvas.isCreatingConnection) - { - if (e.IsMouseDown(MouseButton.Left)) - { - var source = canvas.connectionSource; - var destination = source.CompatiblePort(unit); - - if (destination != null) - { - UndoUtility.RecordEditedObject("Connect Nodes"); - source.ValidlyConnectTo(destination); - canvas.connectionSource = null; - canvas.Widget(source.unit).Reposition(); - canvas.Widget(destination.unit).Reposition(); - GUI.changed = true; - } - - e.Use(); - } - else if (e.IsMouseDown(MouseButton.Right)) - { - canvas.CancelConnection(); - e.Use(); - } - } - - base.HandleInput(); - } - - private Rect SnapTarget(IGraphElement e) - { - if (e is Unit unit) - { - return canvas.Widget(unit).outerPosition; - } - return canvas.Widget(e).position; - } - - #endregion - - - #region Contents - - protected readonly GUIContent titleContent = new GUIContent(); - - protected readonly GUIContent surtitleContent = new GUIContent(); - - protected readonly GUIContent subtitleContent = new GUIContent(); - - protected readonly Dictionary settingLabelsContents = new Dictionary(); - - #endregion - - - #region Positioning - - protected override bool snapToGrid => BoltCore.Configuration.snapToGrid; - - protected virtual bool isSpecialPortsColor => _isSpecialColor; - protected virtual Color? PortsbackgroundColor => null; - - public override IEnumerable positionDependers => ports.Cast(); - - protected Rect _position; - - public override Rect position - { - get { return _position; } - set { unit.position = value.position; } - } - - public Rect titlePosition { get; protected set; } - - public Rect surtitlePosition { get; protected set; } - - public Rect subtitlePosition { get; protected set; } - - public Rect iconPosition { get; protected set; } - - public List iconsPositions { get; protected set; } = new List(); - - public Dictionary settingsPositions { get; } = new Dictionary(); - - public Rect headerAddonPosition { get; protected set; } - - public Rect portsBackgroundPosition { get; protected set; } - - private bool _isSpecialColor; - - public override void CachePosition() - { - var inputsWidth = 0f; - var outputsWidth = 0f; - - foreach (var input in inputs) - { - inputsWidth = Mathf.Max(inputsWidth, input.GetInnerWidth()); - } - - foreach (var output in outputs) - { - outputsWidth = Mathf.Max(outputsWidth, output.GetInnerWidth()); - } - - var portsWidth = 0f; - - portsWidth += inputsWidth; - portsWidth += Styles.spaceBetweenInputsAndOutputs; - portsWidth += outputsWidth; - - settingsPositions.Clear(); - - var settingsWidth = 0f; - - if (showSettings) - { - foreach (var setting in settings) - { - var settingWidth = 0f; - - var settingLabelContent = settingLabelsContents[setting]; - - if (settingLabelContent != null) - { - settingWidth += Styles.settingLabel.CalcSize(settingLabelContent).x; - } - - settingWidth += setting.Inspector().GetAdaptiveWidth(); - - settingWidth = Mathf.Min(settingWidth, Styles.maxSettingsWidth); - - settingsPositions.Add(setting, new Rect(0, 0, settingWidth, 0)); - - settingsWidth = Mathf.Max(settingsWidth, settingWidth); - } - } - - var headerAddonWidth = 0f; - - if (showHeaderAddon) - { - headerAddonWidth = GetHeaderAddonWidth(); - } - - var titleWidth = Styles.title.CalcSize(titleContent).x; - - var headerTextWidth = titleWidth; - - var surtitleWidth = 0f; - - if (showSurtitle) - { - surtitleWidth = Styles.surtitle.CalcSize(surtitleContent).x; - headerTextWidth = Mathf.Max(headerTextWidth, surtitleWidth); - } - - var subtitleWidth = 0f; - - if (showSubtitle) - { - subtitleWidth = Styles.subtitle.CalcSize(subtitleContent).x; - headerTextWidth = Mathf.Max(headerTextWidth, subtitleWidth); - } - - var iconsWidth = 0f; - - if (showIcons) - { - var iconsColumns = Mathf.Ceil((float)description.icons.Length / Styles.iconsPerColumn); - iconsWidth = iconsColumns * Styles.iconsSize + ((iconsColumns - 1) * Styles.iconsSpacing); - } - - var headerWidth = Mathf.Max(headerTextWidth + iconsWidth, Mathf.Max(settingsWidth, headerAddonWidth)) + Styles.iconSize + Styles.spaceAfterIcon; - - var innerWidth = Mathf.Max(portsWidth, headerWidth); - - var edgeWidth = InnerToEdgePosition(new Rect(0, 0, innerWidth, 0)).width; - - var edgeOrigin = unit.position; - var edgeX = edgeOrigin.x; - var edgeY = edgeOrigin.y; - var innerOrigin = EdgeToInnerPosition(new Rect(edgeOrigin, Vector2.zero)).position; - var innerX = innerOrigin.x; - var innerY = innerOrigin.y; - - iconPosition = new Rect - ( - innerX, - innerY, - Styles.iconSize, - Styles.iconSize - ); - - var headerTextX = iconPosition.xMax + Styles.spaceAfterIcon; - - var y = innerY; - - var headerHeight = 0f; - - var surtitleHeight = 0f; - - if (showSurtitle) - { - surtitleHeight = Styles.surtitle.CalcHeight(surtitleContent, headerTextWidth); - - surtitlePosition = new Rect - ( - headerTextX, - y, - headerTextWidth, - surtitleHeight - ); - - headerHeight += surtitleHeight; - y += surtitleHeight; - - headerHeight += Styles.spaceAfterSurtitle; - y += Styles.spaceAfterSurtitle; - } - - var titleHeight = 0f; - - if (showTitle) - { - titleHeight = Styles.title.CalcHeight(titleContent, headerTextWidth); - - titlePosition = new Rect - ( - headerTextX, - y, - headerTextWidth, - titleHeight - ); - - headerHeight += titleHeight; - y += titleHeight; - } - - var subtitleHeight = 0f; - - if (showSubtitle) - { - headerHeight += Styles.spaceBeforeSubtitle; - y += Styles.spaceBeforeSubtitle; - - subtitleHeight = Styles.subtitle.CalcHeight(subtitleContent, headerTextWidth); - - subtitlePosition = new Rect - ( - headerTextX, - y, - headerTextWidth, - subtitleHeight - ); - - headerHeight += subtitleHeight; - y += subtitleHeight; - } - - iconsPositions.Clear(); - - if (showIcons) - { - var iconRow = 0; - var iconCol = 0; - - for (int i = 0; i < description.icons.Length; i++) - { - var iconPosition = new Rect - ( - innerX + innerWidth - ((iconCol + 1) * Styles.iconsSize) - ((iconCol) * Styles.iconsSpacing), - innerY + (iconRow * (Styles.iconsSize + Styles.iconsSpacing)), - Styles.iconsSize, - Styles.iconsSize - ); - - iconsPositions.Add(iconPosition); - - iconRow++; - - if (iconRow % Styles.iconsPerColumn == 0) - { - iconCol++; - iconRow = 0; - } - } - } - - var settingsHeight = 0f; - - if (showSettings) - { - headerHeight += Styles.spaceBeforeSettings; - - foreach (var setting in settings) - { - var settingWidth = settingsPositions[setting].width; - - using (LudiqGUIUtility.currentInspectorWidth.Override(settingWidth)) - { - var settingHeight = LudiqGUI.GetInspectorHeight(null, setting, settingWidth, settingLabelsContents[setting] ?? GUIContent.none); - - var settingPosition = new Rect - ( - headerTextX, - y, - settingWidth, - settingHeight - ); - - settingsPositions[setting] = settingPosition; - - settingsHeight += settingHeight; - y += settingHeight; - - settingsHeight += Styles.spaceBetweenSettings; - y += Styles.spaceBetweenSettings; - } - } - - settingsHeight -= Styles.spaceBetweenSettings; - y -= Styles.spaceBetweenSettings; - - headerHeight += settingsHeight; - - headerHeight += Styles.spaceAfterSettings; - y += Styles.spaceAfterSettings; - } - - if (showHeaderAddon) - { - var headerAddonHeight = GetHeaderAddonHeight(headerAddonWidth); - - headerAddonPosition = new Rect - ( - headerTextX, - y, - headerAddonWidth, - headerAddonHeight - ); - - headerHeight += headerAddonHeight; - y += headerAddonHeight; - } - - if (headerHeight < Styles.iconSize) - { - var difference = Styles.iconSize - headerHeight; - var centeringOffset = difference / 2; - - if (showTitle) - { - var _titlePosition = titlePosition; - _titlePosition.y += centeringOffset; - titlePosition = _titlePosition; - } - - if (showSubtitle) - { - var _subtitlePosition = subtitlePosition; - _subtitlePosition.y += centeringOffset; - subtitlePosition = _subtitlePosition; - } - - if (showSettings) - { - foreach (var setting in settings) - { - var _settingPosition = settingsPositions[setting]; - _settingPosition.y += centeringOffset; - settingsPositions[setting] = _settingPosition; - } - } - - if (showHeaderAddon) - { - var _headerAddonPosition = headerAddonPosition; - _headerAddonPosition.y += centeringOffset; - headerAddonPosition = _headerAddonPosition; - } - - headerHeight = Styles.iconSize; - } - - y = innerY + headerHeight; - - var innerHeight = 0f; - - innerHeight += headerHeight; - - if (showPorts) - { - innerHeight += Styles.spaceBeforePorts; - y += Styles.spaceBeforePorts; - - var portsBackgroundY = y; - var portsBackgroundHeight = 0f; - - portsBackgroundHeight += Styles.portsBackground.padding.top; - innerHeight += Styles.portsBackground.padding.top; - y += Styles.portsBackground.padding.top; - - var portStartY = y; - - var inputsHeight = 0f; - var outputsHeight = 0f; - - foreach (var input in inputs) - { - input.y = y; - - var inputHeight = input.GetHeight(); - - inputsHeight += inputHeight; - y += inputHeight; - - inputsHeight += Styles.spaceBetweenPorts; - y += Styles.spaceBetweenPorts; - } - - if (inputs.Count > 0) - { - inputsHeight -= Styles.spaceBetweenPorts; - y -= Styles.spaceBetweenPorts; - } - - y = portStartY; - - foreach (var output in outputs) - { - output.y = y; - - var outputHeight = output.GetHeight(); - - outputsHeight += outputHeight; - y += outputHeight; - - outputsHeight += Styles.spaceBetweenPorts; - y += Styles.spaceBetweenPorts; - } - - if (outputs.Count > 0) - { - outputsHeight -= Styles.spaceBetweenPorts; - y -= Styles.spaceBetweenPorts; - } - - var portsHeight = Math.Max(inputsHeight, outputsHeight); - - portsBackgroundHeight += portsHeight; - innerHeight += portsHeight; - y = portStartY + portsHeight; - - portsBackgroundHeight += Styles.portsBackground.padding.bottom; - innerHeight += Styles.portsBackground.padding.bottom; - y += Styles.portsBackground.padding.bottom; - - portsBackgroundPosition = new Rect - ( - edgeX, - portsBackgroundY, - edgeWidth, - portsBackgroundHeight - ); - } - - var edgeHeight = InnerToEdgePosition(new Rect(0, 0, 0, innerHeight)).height; - - _position = new Rect - ( - edgeX, - edgeY, - edgeWidth, - edgeHeight - ); - } - - protected virtual float GetHeaderAddonWidth() - { - return 0; - } - - protected virtual float GetHeaderAddonHeight(float width) - { - return 0; - } - - #endregion - - - #region Drawing - - protected virtual NodeColorMix baseColor => NodeColor.Gray; - - protected override NodeColorMix color - { - get - { - _isSpecialColor = false; - - if (unitDebugData.runtimeException != null) - { - return NodeColor.Red; - } - - var color = baseColor; - - if (analysis.warnings.Count > 0) - { - var mostSevereWarning = Warning.MostSevereLevel(analysis.warnings); - - switch (mostSevereWarning) - { - case WarningLevel.Error: - color = NodeColor.Red; - _isSpecialColor = true; - break; - - case WarningLevel.Severe: - color = NodeColor.Orange; - _isSpecialColor = true; - break; - - case WarningLevel.Caution: - color = NodeColor.Yellow; - - break; - } - } - - if (EditorApplication.isPaused) - { - if (EditorTimeBinding.frame == unitDebugData.lastInvokeFrame) - { - return NodeColor.Blue; - } - } - else - { - var mix = color; - mix.blue = Mathf.Lerp(1, 0, (EditorTimeBinding.time - unitDebugData.lastInvokeTime) / Styles.invokeFadeDuration); - - return mix; - } - - return color; - } - } - - protected override NodeShape shape => NodeShape.Square; - - protected virtual bool showTitle => !string.IsNullOrEmpty(description.shortTitle); - - protected virtual bool showSurtitle => !string.IsNullOrEmpty(description.surtitle); - - protected virtual bool showSubtitle => !string.IsNullOrEmpty(description.subtitle); - - protected virtual bool showIcons => description.icons.Length > 0; - - protected virtual bool showSettings => settingNames.Count > 0; - - protected virtual bool showHeaderAddon => false; - - protected virtual bool showPorts => ports.Count > 0; - - protected override bool dim - { - get - { - var dim = BoltCore.Configuration.dimInactiveNodes && !analysis.isEntered; - - if (isMouseOver || isSelected) - { - dim = false; - } - - if (BoltCore.Configuration.dimIncompatibleNodes && canvas.isCreatingConnection) - { - dim = !unit.ports.Any(p => canvas.connectionSource == p || canvas.connectionSource.CanValidlyConnectTo(p)); - } - - return dim; - } - } - - private List snapLines = new List(); - - protected void DrawSnapLines() - { - if (snapLines == null || snapLines.Count == 0) - return; - - Handles.color = new Color32(64, 113, 156, 255); - foreach (var line in snapLines) - { - Handles.DrawLine(line.start, line.end); - } - } - - private void ConvertToEmbed() - { - NodeSelection.Convert(GraphSource.Embed); - } - - private void ConvertToMacro() - { - NodeSelection.Convert(GraphSource.Macro); - } - - public override void DrawForeground() - { - if (isDragging && e.ctrlOrCmd) - DrawSnapLines(); - - BeginDim(); - - base.DrawForeground(); - - DrawIcon(); - - if (showSurtitle) - { - DrawSurtitle(); - } - - if (showTitle) - { - DrawTitle(); - } - - if (showSubtitle) - { - DrawSubtitle(); - } - - if (showIcons) - { - DrawIcons(); - } - - if (showSettings) - { - DrawSettings(); - } - - if (showHeaderAddon) - { - DrawHeaderAddon(); - } - - if (showPorts) - { - DrawPortsBackground(); - } - - EndDim(); - } - - protected void DrawIcon() - { - var icon = description.icon ?? BoltFlow.Icons.unit; - - if (icon != null && icon[(int)iconPosition.width]) - { - GUI.DrawTexture(iconPosition, icon[(int)iconPosition.width]); - } - } - - protected void DrawTitle() - { - GUI.Label(titlePosition, titleContent, invertForeground ? Styles.titleInverted : Styles.title); - } - - protected void DrawSurtitle() - { - GUI.Label(surtitlePosition, surtitleContent, invertForeground ? Styles.surtitleInverted : Styles.surtitle); - } - - protected void DrawSubtitle() - { - GUI.Label(subtitlePosition, subtitleContent, invertForeground ? Styles.subtitleInverted : Styles.subtitle); - } - - protected void DrawIcons() - { - for (int i = 0; i < description.icons.Length; i++) - { - var icon = description.icons[i]; - var position = iconsPositions[i]; - - GUI.DrawTexture(position, icon?[(int)position.width]); - } - } - - private void DrawSettings() - { - if (graph.zoom < FlowCanvas.inspectorZoomThreshold) - { - return; - } - - EditorGUI.BeginDisabledGroup(!e.IsRepaint && isMouseThrough && !isMouseOver); - - EditorGUI.BeginChangeCheck(); - - foreach (var setting in settings) - { - DrawSetting(setting); - } - - if (EditorGUI.EndChangeCheck()) - { - unit.Define(); - Reposition(); - } - - EditorGUI.EndDisabledGroup(); - } - - protected void DrawSetting(Metadata setting) - { - var settingPosition = settingsPositions[setting]; - - using (LudiqGUIUtility.currentInspectorWidth.Override(settingPosition.width)) - using (Inspector.expandTooltip.Override(false)) - { - var label = settingLabelsContents[setting]; - - if (label == null) - { - LudiqGUI.Inspector(setting, settingPosition, GUIContent.none); - } - else - { - using (Inspector.defaultLabelStyle.Override(Styles.settingLabel)) - using (LudiqGUIUtility.labelWidth.Override(Styles.settingLabel.CalcSize(label).x)) - { - LudiqGUI.Inspector(setting, settingPosition, label); - } - } - } - } - - protected virtual void DrawHeaderAddon() { } - - protected void DrawPortsBackground() - { - if (canvas.showRelations) - { - foreach (var relation in unit.relations) - { - var start = ports.Single(pw => pw.port == relation.source).handlePosition.center; - var end = ports.Single(pw => pw.port == relation.destination).handlePosition.center; - - var startTangent = start; - var endTangent = end; - - if (relation.source is IUnitInputPort && - relation.destination is IUnitInputPort) - { - startTangent -= new Vector2(20, 0); - endTangent -= new Vector2(32, 0); - } - else - { - startTangent += new Vector2(innerPosition.width / 2, 0); - endTangent += new Vector2(-innerPosition.width / 2, 0); - } - - Handles.DrawBezier - ( - start, - end, - startTangent, - endTangent, - ColorPalette.unityBackgroundMid, - null, - 3 - ); - } - } - else - { - if (e.IsRepaint) - { -#if NEW_UNIT_STYLE - var previous = GUI.backgroundColor; - - if (isSpecialPortsColor) - { - GUI.backgroundColor = PortsbackgroundColor ?? ToColor(color); - } - - Styles.portsBackground.Draw(portsBackgroundPosition, false, false, false, false); - - if (isSpecialPortsColor) - GUI.backgroundColor = previous; -#else - Styles.portsBackground.Draw(portsBackgroundPosition, false, false, false, false); -#endif - } - } - } - - #endregion - - private readonly Dictionary colorMap = new Dictionary() - { - { NodeColor.Gray, new Color(0.5f, 0.5f, 0.5f) }, - { NodeColor.Blue, new Color(0.25f, 0.6f, 1f) }, - { NodeColor.Teal, new Color(0f, 0.75f, 0.75f) }, - { NodeColor.Green, new Color(0.4f, 0.8f, 0.4f) }, - { NodeColor.Yellow, new Color(1f, 0.9f, 0.2f) }, - { NodeColor.Orange, new Color(1f, 0.6f, 0.2f) }, - { NodeColor.Red, new Color(1f, 0.3f, 0.3f) } - }; - - public Color ToColor(NodeColorMix mix) - { - mix = mix.normalized; - Color result = Color.black; - foreach (var kvp in mix) - if (colorMap.TryGetValue(kvp.Key, out var c)) - result += c * kvp.Value; - - result.r = Mathf.Clamp01(result.r); - result.g = Mathf.Clamp01(result.g); - result.b = Mathf.Clamp01(result.b); - result.a = 1f; - return result; - } - - #region Selecting - - public override bool canSelect => true; - - #endregion - - - #region Dragging - - public override bool canDrag => true; - - public override void ExpandDragGroup(HashSet dragGroup) - { - if (BoltCore.Configuration.carryChildren) - { - foreach (var output in unit.outputs) - { - foreach (var connection in output.connections) - { - if (dragGroup.Contains(connection.destination.unit)) - { - continue; - } - - dragGroup.Add(connection.destination.unit); - - canvas.Widget(connection.destination.unit).ExpandDragGroup(dragGroup); - } - } - } - } - - #endregion - - - #region Deleting - - public override bool canDelete => true; - - #endregion - - - #region Clipboard - - public override void ExpandCopyGroup(HashSet copyGroup) - { - copyGroup.UnionWith(unit.connections.Cast()); - } - - #endregion - - - #region Context - - protected override IEnumerable contextOptions - { - get - { - yield return new DropdownOption((Action)ReplaceUnit, "Replace..."); - - foreach (var baseOption in base.contextOptions) - { - yield return baseOption; - } - - if (selection.Count > 0) - { - yield return new DropdownOption((Action)ConvertToEmbed, "Selection/To Embed Subgraph"); - yield return new DropdownOption((Action)ConvertToMacro, "Selection/To Macro Subgraph"); - } - } - } - - private void ReplaceUnit() - { - UnitWidgetHelper.ReplaceUnit(unit, reference, context, selection, e); - } - - #endregion - - - public static class Styles - { - static Styles() - { - // Disabling word wrap because Unity's CalcSize and CalcHeight - // are broken w.r.t. pixel-perfection and matrix - - title = new GUIStyle(BoltCore.Styles.nodeLabel); - title.padding = new RectOffset(0, 5, 0, 2); - title.margin = new RectOffset(0, 0, 0, 0); - title.fontSize = 12; - title.alignment = TextAnchor.MiddleLeft; - title.wordWrap = false; - - surtitle = new GUIStyle(BoltCore.Styles.nodeLabel); - surtitle.padding = new RectOffset(0, 5, 0, 0); - surtitle.margin = new RectOffset(0, 0, 0, 0); - surtitle.fontSize = 10; - surtitle.alignment = TextAnchor.MiddleLeft; - surtitle.wordWrap = false; - - subtitle = new GUIStyle(surtitle); - subtitle.padding.bottom = 2; - - titleInverted = new GUIStyle(title); - titleInverted.normal.textColor = ColorPalette.unityBackgroundDark; - - surtitleInverted = new GUIStyle(surtitle); - surtitleInverted.normal.textColor = ColorPalette.unityBackgroundDark; - - subtitleInverted = new GUIStyle(subtitle); - subtitleInverted.normal.textColor = ColorPalette.unityBackgroundDark; - -#if NEW_UNIT_STYLE - if (EditorGUIUtility.isProSkin) - { - portsBackground = new GUIStyle - { - padding = new RectOffset(0, 0, 6, 5), - border = new RectOffset(0, 0, 2, 2) - }; - - portsBackground.normal.background = CommunityStyles.MakeBorderedTexture(CommunityStyles.backgroundColor, CommunityStyles.backgroundColor.Darken(0.05f)); - } - else - { - portsBackground = new GUIStyle - { - normal = { background = CommunityStyles.MakeBorderedTexture(CommunityStyles.backgroundColor, CommunityStyles.backgroundColor.Brighten(0.05f)) }, - padding = new RectOffset(0, 0, 6, 5) - }; - } -#else - portsBackground = VisualScripting.UnitWidget.Styles.portsBackground; -#endif - - settingLabel = new GUIStyle(BoltCore.Styles.nodeLabel); - settingLabel.padding.left = 0; - settingLabel.padding.right = 5; - settingLabel.wordWrap = false; - settingLabel.clipping = TextClipping.Clip; - } - - public static readonly GUIStyle title; - - public static readonly GUIStyle surtitle; - - public static readonly GUIStyle subtitle; - - public static readonly GUIStyle titleInverted; - - public static readonly GUIStyle surtitleInverted; - - public static readonly GUIStyle subtitleInverted; - - public static readonly GUIStyle settingLabel; - - public static readonly float spaceAroundLineIcon = 5; - - public static readonly float spaceBeforePorts = 5; - - public static readonly float spaceBetweenInputsAndOutputs = 8; - - public static readonly float spaceBeforeSettings = 2; - - public static readonly float spaceBetweenSettings = 3; - - public static readonly float spaceBetweenPorts = 3; - - public static readonly float spaceAfterSettings = 0; - - public static readonly float maxSettingsWidth = 150; - - public static readonly GUIStyle portsBackground; - - public static readonly float iconSize = IconSize.Medium; - - public static readonly float iconsSize = IconSize.Small; - - public static readonly float iconsSpacing = 3; - - public static readonly int iconsPerColumn = 2; - - public static readonly float spaceAfterIcon = 6; - - public static readonly float spaceAfterSurtitle = 2; - - public static readonly float spaceBeforeSubtitle = 0; - - public static readonly float invokeFadeDuration = 0.5f; - } - } - - internal class UnitWidgetHelper - { - internal static void ReplaceUnit(IUnit unit, GraphReference reference, IGraphContext context, GraphSelection selection, EventWrapper eventWrapper) - { - var oldUnit = unit; - var unitPosition = oldUnit.position; - var preservation = UnitPreservation.Preserve(oldUnit); - - var options = new UnitOptionTree(new GUIContent("Node")); - options.filter = UnitOptionFilter.Any; -#if VISUAL_SCRIPTING_1_8_0_OR_GREATER - options.filter.NoConnection = false; -#endif - options.reference = reference; - - var activatorPosition = new Rect(eventWrapper.mousePosition, new Vector2(200, 1)); - - LudiqGUI.FuzzyDropdown - ( - activatorPosition, - options, - null, - delegate (object _option) - { - var option = (IUnitOption)_option; - - context.BeginEdit(); - UndoUtility.RecordEditedObject("Replace Node"); - var graph = oldUnit.graph; - oldUnit.graph.units.Remove(oldUnit); - var newUnit = option.InstantiateUnit(); - newUnit.guid = Guid.NewGuid(); - newUnit.position = unitPosition; - graph.units.Add(newUnit); - preservation.RestoreTo(newUnit); - option.PreconfigureUnit(newUnit); - selection.Select(newUnit); - GUI.changed = true; - context.EndEdit(); - } - ); - } - } -} -#endif - -#endif \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitWidgetHelper.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitWidgetHelper.cs new file mode 100644 index 00000000..7367362b --- /dev/null +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitWidgetHelper.cs @@ -0,0 +1,49 @@ +using System; +using UnityEngine; + +namespace Unity.VisualScripting.Community +{ + internal class UnitWidgetHelper + { + internal static void ReplaceUnit(IUnit unit, GraphReference reference, IGraphContext context, GraphSelection selection, EventWrapper eventWrapper) + { + var oldUnit = unit; + var unitPosition = oldUnit.position; + var preservation = UnitPreservation.Preserve(oldUnit); + + var options = new UnitOptionTree(new GUIContent("Node")); + options.filter = new UnitOptionFilter(true); +#if VISUAL_SCRIPTING_1_8_0_OR_GREATER + options.filter.NoConnection = false; +#endif + options.reference = reference; + + var activatorPosition = new Rect(eventWrapper.mousePosition, new Vector2(200, 1)); + + LudiqGUI.FuzzyDropdown + ( + activatorPosition, + options, + null, + delegate (object _option) + { + var option = (IUnitOption)_option; + + context.BeginEdit(); + UndoUtility.RecordEditedObject("Replace Node"); + var graph = oldUnit.graph; + oldUnit.graph.units.Remove(oldUnit); + var newUnit = option.InstantiateUnit(); + newUnit.guid = Guid.NewGuid(); + newUnit.position = unitPosition; + graph.units.Add(newUnit); + preservation.RestoreTo(newUnit); + option.PreconfigureUnit(newUnit); + selection.Select(newUnit); + GUI.changed = true; + context.EndEdit(); + } + ); + } + } +} \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitWidgetHelper.cs.meta b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitWidgetHelper.cs.meta new file mode 100644 index 00000000..ad1689fd --- /dev/null +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitWidgetHelper.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: abe95c0855f680d4596a291f6ea44e72 \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ValueConnectionWidget.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ValueConnectionWidget.cs index a892cf08..0e580c30 100644 --- a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ValueConnectionWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ValueConnectionWidget.cs @@ -3,6 +3,7 @@ using System.Reflection; using UnityEditor; using UnityEngine; +using System.Collections.Generic; namespace Unity.VisualScripting.Community { @@ -12,6 +13,7 @@ public ValueConnectionWidget(FlowCanvas canvas, ValueConnection connection) : ba private new ValueConnection.DebugData ConnectionDebugData => GetDebugData(); + private static readonly Dictionary> _inspectableMembersCache = new Dictionary>(); #region Drawing @@ -64,11 +66,11 @@ public override void DrawForeground() { var innerRect = new Rect(labelPosition.x + 1, labelPosition.y + 1, labelPosition.width - 2, labelPosition.height - 2); - var colorText = exception.Message; - var textSize = Styles.prediction.CalcSize(new GUIContent(colorText)); + var errorText = exception.Message; + var textSize = Styles.prediction.CalcSize(new GUIContent(errorText)); var textRect = new Rect(labelPosition.x + labelPosition.width + 6, labelPosition.center.y - textSize.y / 2, textSize.x, textSize.y); - GUI.Label(textRect, colorText, Styles.prediction); + GUI.Label(textRect, errorText, Styles.prediction); } } else if (value is Color colorValue) @@ -110,21 +112,20 @@ public override void DrawForeground() if (labelPosition.Contains(Event.current.mousePosition)) { - var inspectableMembers = type - .GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - .Where(m => - { - if (m is FieldInfo f) - { - return f.IsPublic || f.HasAttribute() || f.HasAttribute() || f.HasAttribute(); - } - else if (m is PropertyInfo p) + if (!_inspectableMembersCache.TryGetValue(type, out var inspectableMembers)) + { + inspectableMembers = type + .GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + .Where(m => { - return (p.HasAttribute() || p.HasAttribute() || p.IsPubliclyGettable()) && p.CanRead; - } - return false; - }) - .ToList(); + if (m is FieldInfo f) return f.IsPublic || f.HasAttribute() || f.HasAttribute() || f.HasAttribute(); + if (m is PropertyInfo p) return (p.HasAttribute() || p.HasAttribute() || p.IsPubliclyGettable()) && p.CanRead; + return false; + }) + .ToList(); + + _inspectableMembersCache[type] = inspectableMembers; + } if (inspectableMembers.Count > 0) { @@ -137,16 +138,21 @@ public override void DrawForeground() var member = inspectableMembers[i]; object memberValue = null; + string str; try { if (member is FieldInfo fi) - memberValue = fi.GetValue(value); + memberValue = fi.GetValueOptimized(value); else if (member is PropertyInfo pi && pi.CanRead) - memberValue = pi.GetValue(value); + memberValue = pi.GetValueOptimized(value); + + str = $"{member.Name}: {memberValue?.ToString() ?? "null"}"; + } + catch + { + str = $"{member.Name}: Unknown"; } - catch { /* ignore inaccessible members */ } - string str = $"{member.Name}: {memberValue?.ToString() ?? "null"}"; lines[i] = str; var size = Styles.prediction.CalcSize(new GUIContent(str)); @@ -209,7 +215,45 @@ protected override void DrawConnection() } if (!hideConnection) + { +#if ENABLE_VERTICAL_FLOW + var color = this.color; + + var sourceWidget = canvas.Widget(connection.source); + var destinationWidget = canvas.Widget(connection.destination); + + var highlight = !canvas.isCreatingConnection && (sourceWidget.isMouseOver || destinationWidget.isMouseOver); + + var willDisconnect = sourceWidget.willDisconnect || destinationWidget.willDisconnect; + + if (willDisconnect) + { + color = UnitConnectionStyles.disconnectColor; + } + else if (highlight) + { + color = UnitConnectionStyles.highlightColor; + } + else if (colorIfActive) + { + if (EditorApplication.isPaused) + { + if (EditorTimeBinding.frame == ConnectionDebugData.lastInvokeFrame) + { + color = UnitConnectionStyles.activeColor; + } + } + else + { + color = Color.Lerp(UnitConnectionStyles.activeColor, color, (EditorTimeBinding.time - ConnectionDebugData.lastInvokeTime) / UnitWidget.Styles.invokeFadeDuration); + } + } + + GraphGUI.DrawConnection(color, sourceHandleEdgeCenter, destinationHandleEdgeCenter, Edge.Right, Edge.Left, null, Vector2.zero, CommunityStyles.relativeBend, CommunityStyles.minBend, CommunityStyles.connectionThickness); +#else base.DrawConnection(); +#endif + } } public override void CachePosition() @@ -218,11 +262,7 @@ public override void CachePosition() var rect = new Rect(sourceHandlePosition); - if (element.source.unit is ValueReroute srcReroute && srcReroute.hideConnection) - { - rect.width -= 5; - } - else if (element.destination.unit is ValueReroute desReroute && desReroute.hideConnection) + if (element.destination.unit is ValueReroute desReroute && desReroute.hideConnection) { rect.width -= 5; } @@ -238,55 +278,29 @@ public override void CachePosition() private bool IsMouseOverConnection(Vector2 mousePos, Vector2 start, Vector2 end, float threshold = 8f) { - float distance = Vector2.Distance(start, end); + if (!clippingPosition.Contains(mousePos)) + { + return false; + } + float distance = Vector2.Distance(start, end); int segments = Mathf.Clamp(Mathf.CeilToInt(distance / 10f), 12, 80); - float minDist = float.MaxValue; for (int i = 0; i <= segments; i++) { float t = i / (float)segments; - +#if ENABLE_VERTICAL_FLOW + Vector2 p = GraphGUI.GetPointOnConnection(t, start, end, Edge.Right, Edge.Left, CommunityStyles.relativeBend, CommunityStyles.minBend); +#else Vector2 p = GraphGUI.GetPointOnConnection(t, start, end, Edge.Right, Edge.Left, UnitConnectionStyles.relativeBend, UnitConnectionStyles.minBend); - +#endif float dist = Vector2.Distance(mousePos, p); - if (dist < minDist) - minDist = dist; + if (dist < minDist) minDist = dist; + if (minDist < threshold) return true; } - return minDist < threshold; - } - - protected override void DrawDroplets() - { - foreach (var droplet in droplets) - { - Vector2 position; - - if (droplet < handleAlignmentMargin) - { - var t = droplet / handleAlignmentMargin; - position = Vector2.Lerp(sourceHandlePosition.center, sourceHandleEdgeCenter, t); - } - else if (droplet > 1 - handleAlignmentMargin) - { - var t = (droplet - (1 - handleAlignmentMargin)) / handleAlignmentMargin; - position = Vector2.Lerp(destinationHandleEdgeCenter, destinationHandlePosition.center, t); - } - else - { - var t = (droplet - handleAlignmentMargin) / (1 - 2 * handleAlignmentMargin); - position = GraphGUI.GetPointOnConnection(t, sourceHandleEdgeCenter, destinationHandleEdgeCenter, Edge.Right, Edge.Left, UnitConnectionStyles.relativeBend, UnitConnectionStyles.minBend); - } - - var size = GetDropletSize(); - - using (LudiqGUI.color.Override(GUI.color * color)) - { - DrawDroplet(new Rect(position.x - size.x / 2, position.y - size.y / 2, size.x, size.y)); - } - } + return false; } public static Color DetermineColor(Type source, Type destination) diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ValueInputWidget.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ValueInputWidget.cs index a5deaceb..9aea6bde 100644 --- a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ValueInputWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ValueInputWidget.cs @@ -26,13 +26,22 @@ protected override Texture handleTextureConnected { if (valueReroute.hideConnection) { - return PathUtil.Load("PortalConnectionIn", CommunityEditorPath.Fundamentals)?[16]; + return CommunityStyles.valuePortalConnection; } } - return BoltFlow.Icons.valuePortConnected?[12]; + return CommunityStyles.valuePortConnected; } } +#if !ENABLE_VERTICAL_FLOW + private const float HorizontalMinBlend = 20f; + protected override float connectionMinBend => HorizontalMinBlend; + protected override float connectionrelativeBend => UnitConnectionStyles.relativeBend; +#endif + + private readonly Vector2 handleSize = new Vector2(10, 10); + protected override Vector2 HandleSize => handleSize; + protected override void DrawConnectionSource() { var start = handlePosition.GetEdgeCenter(edge); @@ -42,11 +51,9 @@ protected override void DrawConnectionSource() canvas.connectionEnd = mousePosition; } - float minBend = 20f; - - Vector2 size = new Vector2(9, 12); + Vector2 size = handleSize; - if (e.alt) size = new Vector2(16, 16); + if (e.alt) size = PortalSize; GraphGUI.DrawConnection ( @@ -55,14 +62,19 @@ protected override void DrawConnectionSource() canvas.connectionEnd, edge, null, - e.alt ? PathUtil.Load("PortalConnectionIn", CommunityEditorPath.Fundamentals)?[16] : BoltFlow.Icons.valuePortConnected?[12], + e.alt ? CommunityStyles.valuePortalConnection : CommunityStyles.valuePortConnected, size, +#if ENABLE_VERTICAL_FLOW + CommunityStyles.relativeBend, + CommunityStyles.minBend +#else UnitConnectionStyles.relativeBend, - minBend + HorizontalMinBlend +#endif ); } - protected override Texture handleTextureUnconnected => BoltFlow.Icons.valuePortUnconnected?[12]; + protected override Texture handleTextureUnconnected => CommunityStyles.valuePortUnconnected; public override void CachePosition() { @@ -72,8 +84,8 @@ public override void CachePosition() var outside = edge.Normal().x; var inside = -outside; var flip = inside < 0; - var width = VisualScripting.UnitPortWidget.Styles.handleSize.x; - var height = VisualScripting.UnitPortWidget.Styles.handleSize.y; + var width = 10; + var height = 10; var connection = port.connection; bool hide = false; diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ValueOutputWidget.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ValueOutputWidget.cs index e6e7632c..1fbe2030 100644 --- a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ValueOutputWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/ValueOutputWidget.cs @@ -26,44 +26,24 @@ protected override Texture handleTextureConnected { if (connections.FirstOrDefault(c => c.destination?.unit is ValueReroute)?.destination?.unit is ValueReroute valueReroute && valueReroute.hideConnection) { - return PathUtil.Load("PortalConnectionIn", CommunityEditorPath.Fundamentals)?[16]; + return CommunityStyles.valuePortalConnection; } } - return BoltFlow.Icons.valuePortConnected?[12]; - } - } - - protected override Texture handleTextureUnconnected => BoltFlow.Icons.valuePortUnconnected?[12]; - protected override void DrawConnectionSource() - { - var start = handlePosition.GetEdgeCenter(edge); - - if (window.IsFocused()) - { - canvas.connectionEnd = mousePosition; + return CommunityStyles.valuePortConnected; } + } - float minBend = 20f; - - Vector2 size = new Vector2(9, 12); - - if (e.alt) size = new Vector2(16, 16); + protected override Texture handleTextureUnconnected => CommunityStyles.valuePortUnconnected; - GraphGUI.DrawConnection - ( - color, - start, - canvas.connectionEnd, - edge, - null, - e.alt ? PathUtil.Load("PortalConnectionIn", CommunityEditorPath.Fundamentals)?[16] : BoltFlow.Icons.valuePortConnected?[12], - size, - UnitConnectionStyles.relativeBend, - minBend - ); - } +#if !ENABLE_VERTICAL_FLOW + private const float HorizontalMinBlend = 20f; + protected override float connectionMinBend => HorizontalMinBlend; + protected override float connectionrelativeBend => UnitConnectionStyles.relativeBend; +#endif + private readonly Vector2 handleSize = new Vector2(10, 10); + protected override Vector2 HandleSize => handleSize; public override void CachePosition() { @@ -74,8 +54,8 @@ public override void CachePosition() var inside = -outside; var flip = inside < 0; - var width = VisualScripting.UnitPortWidget.Styles.handleSize.x; - var height = VisualScripting.UnitPortWidget.Styles.handleSize.y; + var width = 10; + var height = 10; bool hide = false; diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/VerticalUnitWidget.cs b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/VerticalUnitWidget.cs new file mode 100644 index 00000000..66de6d7e --- /dev/null +++ b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/VerticalUnitWidget.cs @@ -0,0 +1,1279 @@ +#if NEW_UNIT_UI && ENABLE_VERTICAL_FLOW +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; +using Unity.VisualScripting.Community.Libraries.Humility; +namespace Unity.VisualScripting.Community +{ + public class UnitWidget : NodeWidget, IUnitWidget where TUnit : class, IUnit + { + public UnitWidget(FlowCanvas canvas, TUnit unit) : base(canvas, unit) + { + unit.onPortsChanged += CacheDefinition; + unit.onPortsChanged += SubWidgetsChanged; + } + + public override void Dispose() + { + base.Dispose(); + + unit.onPortsChanged -= CacheDefinition; + unit.onPortsChanged -= SubWidgetsChanged; + } + + public override IEnumerable subWidgets => unit.ports.Select(port => canvas.Widget(port)); + + #region Model + + protected TUnit unit => element; + + IUnit IUnitWidget.unit => unit; + + protected IUnitDebugData unitDebugData => GetDebugData(); + + private UnitDescription description; + + private UnitAnalysis analysis => unit.Analysis(context); + + protected readonly List ports = new List(); + + protected readonly List inputs = new List(); + + protected readonly List outputs = new List(); + + private readonly List settingNames = new List(); + + public override Rect hotArea => outerPosition; + + protected readonly List settings = new List(); + + protected override void CacheItemFirstTime() + { + base.CacheItemFirstTime(); + CacheDefinition(); + } + + protected virtual void CacheDefinition() + { + inputs.Clear(); + outputs.Clear(); + ports.Clear(); + inputs.AddRange(unit.inputs.Select(port => canvas.Widget(port))); + outputs.AddRange(unit.outputs.Select(port => canvas.Widget(port))); + ports.AddRange(inputs); + ports.AddRange(outputs); + + Reposition(); + } + + protected override void CacheDescription() + { + description = unit.Description(); + + titleContent.text = description.shortTitle; + titleContent.tooltip = description.summary; + surtitleContent.text = description.surtitle; + subtitleContent.text = description.subtitle; + + Reposition(); + } + + protected override void CacheMetadata() + { + settingNames.Clear(); + + settingNames.AddRange(metadata.valueType + .GetMembers() + .Where(mi => mi.HasAttribute()) + .OrderBy(mi => mi.GetAttributes().OfType().FirstOrDefault()?.order ?? int.MaxValue) + .ThenBy(mi => mi.MetadataToken) + .Select(mi => mi.Name)); + + foreach (var name in settingNames) + { + settings.Add(metadata[name]); + } + + lock (settingLabelsContents) + { + settingLabelsContents.Clear(); + + foreach (var setting in settings) + { + var settingLabel = setting.GetAttribute().label; + + GUIContent settingContent; + + if (string.IsNullOrEmpty(settingLabel)) + { + settingContent = null; + } + else + { + settingContent = new GUIContent(settingLabel); + } + + settingLabelsContents.Add(setting, settingContent); + } + } + + Reposition(); + } + + public virtual Inspector GetPortInspector(IUnitPort port, Metadata metadata) + { + return metadata.Inspector(); + } + + #endregion + + + #region Lifecycle + + public override bool foregroundRequiresInput => showSettings || unit.valueInputs.Any(vip => vip.hasDefaultValue); + + protected virtual IEnumerable SnapTargets + { + get + { + foreach (var e in graph.elements) + { + if (e != element && !(e is IUnitConnection)) + { + yield return e; + } + } + } + } + + private List _cachedSnapTargets; + + public override void HandleInput() + { + if (AllowRectSnapping && isDragging && e.ctrlOrCmd) + { + if (_cachedSnapTargets == null) + { + _cachedSnapTargets = new List(); + foreach (var target in SnapTargets) + { + _cachedSnapTargets.Add(SnapTarget(target)); + } + } + + var snapResult = RectUtility.CheckSnap(outerPosition, _cachedSnapTargets, threshold: 15f); + snapLines.Clear(); + + if (snapResult.snapped) + { + var pos = BoltCore.Configuration.snapToGrid ? GraphGUI.SnapToGrid(snapResult.snapPosition) : snapResult.snapPosition; + _position = OuterToEdgePosition(new Rect(pos.x, pos.y, _position.width, _position.height)); + + if (snapResult.hasVerticalLine) snapLines.Add(snapResult.verticalLine); + if (snapResult.hasHorizontalLine) snapLines.Add(snapResult.horizontalLine); + + Reposition(); + } + } + else + { + if (_cachedSnapTargets != null) + { + _cachedSnapTargets = null; + snapLines.Clear(); + } + } + + if (canvas.isCreatingConnection) + { + if (e.IsMouseDown(MouseButton.Left)) + { + var source = canvas.connectionSource; + var destination = source.CompatiblePort(unit); + + if (destination != null) + { + UndoUtility.RecordEditedObject("Connect Nodes"); + source.ValidlyConnectTo(destination); + canvas.connectionSource = null; + canvas.Widget(source.unit).Reposition(); + canvas.Widget(destination.unit).Reposition(); + GUI.changed = true; + } + + e.Use(); + } + else if (e.IsMouseDown(MouseButton.Right)) + { + canvas.CancelConnection(); + e.Use(); + } + } + + base.HandleInput(); + } + + private Rect SnapTarget(IGraphItem e) + { + if (e is Unit unit) + { + return canvas.Widget(unit).outerPosition; + } + return canvas.Widget(e).position; + } + + #endregion + + + #region Contents + + protected readonly GUIContent titleContent = new GUIContent(); + + protected readonly GUIContent surtitleContent = new GUIContent(); + + protected readonly GUIContent subtitleContent = new GUIContent(); + + protected readonly Dictionary settingLabelsContents = new Dictionary(); + + #endregion + + + #region Positioning + + protected override bool snapToGrid => BoltCore.Configuration.snapToGrid; + + protected virtual Color? PortsbackgroundColor => null; + + public override IEnumerable positionDependers => ports.Cast(); + + protected Rect _position; + + public override Rect position + { + get { return _position; } + set { unit.position = value.position; } + } + + public Rect titlePosition { get; protected set; } + + public Rect surtitlePosition { get; protected set; } + + public Rect subtitlePosition { get; protected set; } + + public Rect iconPosition { get; protected set; } + + public List iconsPositions { get; protected set; } = new List(); + + public Dictionary settingsPositions { get; } = new Dictionary(); + + public Rect headerAddonPosition { get; protected set; } + + public Rect portsBackgroundPosition { get; protected set; } + + private readonly List<(float, SeparatorPosition)> rowDividerPositions = new List<(float, SeparatorPosition)>(); + + private readonly List controlInputDividersX = new List(); + private readonly List controlOutputDividersX = new List(); + + private readonly List _valueInputs = new List(); + private readonly List _valueOutputs = new List(); + private readonly List _controlInputs = new List(); + private readonly List _controlOutputs = new List(); + + private enum SeparatorPosition + { + Left, + Right, + Full + } + + public override void CachePosition() + { + const float compactY = 0.5f; + const float compactX = 0.8f; + const float spaceBetweenControlPorts = 10; + + _valueInputs.Clear(); + _valueOutputs.Clear(); + _controlInputs.Clear(); + _controlOutputs.Clear(); + + float valueInputsWidth = 0f; + float maxCiWidth = 0f; + + for (int i = 0; i < inputs.Count; i++) + { + var p = inputs[i]; + if (p is ValueInputWidget || p is InvalidInputWidget) + { + _valueInputs.Add(p); + valueInputsWidth = Mathf.Max(valueInputsWidth, p.GetInnerWidth()); + } + else if (p is ControlInputWidget ci) + { + _controlInputs.Add(ci); + maxCiWidth = Mathf.Max(maxCiWidth, ci.GetInnerWidth()); + } + } + + float valueOutputsWidth = 0f; + float maxCoWidth = 0f; + + for (int i = 0; i < outputs.Count; i++) + { + var p = outputs[i]; + if (p is ValueOutputWidget || p is InvalidOutputWidget) + { + _valueOutputs.Add(p); + valueOutputsWidth = Mathf.Max(valueOutputsWidth, p.GetInnerWidth()); + } + else if (p is ControlOutputWidget co) + { + _controlOutputs.Add(co); + maxCoWidth = Mathf.Max(maxCoWidth, co.GetInnerWidth()); + } + } + + var portsWidth = valueInputsWidth + Styles.spaceBetweenInputsAndOutputs + valueOutputsWidth; + + if (_controlInputs.Count > 0) + { + portsWidth = Mathf.Max(portsWidth, Mathf.Min(90f, maxCiWidth + spaceBetweenControlPorts) * _controlInputs.Count); + } + + if (_controlOutputs.Count > 0) + { + portsWidth = Mathf.Max(portsWidth, Mathf.Min(90f, maxCoWidth + spaceBetweenControlPorts) * _controlOutputs.Count); + } + + settingsPositions.Clear(); + float settingsWidth = 0f; + + if (showSettings) + { + for (int i = 0; i < settings.Count; i++) + { + var setting = settings[i]; + var content = settingLabelsContents[setting]; + float settingWidth = 0f; + + if (content != null) + settingWidth += Styles.settingLabel.CalcSize(content).x; + + settingWidth += setting.Inspector().GetAdaptiveWidth(); + settingWidth = Mathf.Min(settingWidth, Styles.maxSettingsWidth); + + settingsPositions.Add(setting, new Rect(0, 0, settingWidth, 0)); + settingsWidth = Mathf.Max(settingsWidth, settingWidth); + } + } + + var headerAddonWidth = showHeaderAddon ? GetHeaderAddonWidth() : 0f; + var headerTextWidth = Styles.title.CalcSize(titleContent).x; + + if (showSurtitle) headerTextWidth = Mathf.Max(headerTextWidth, Styles.surtitle.CalcSize(surtitleContent).x); + if (showSubtitle) headerTextWidth = Mathf.Max(headerTextWidth, Styles.subtitle.CalcSize(subtitleContent).x); + + var iconsWidth = 0f; + if (showIcons && description.icons.Length > 0) + { + var iconsColumns = Mathf.Ceil((float)description.icons.Length / Styles.iconsPerColumn); + iconsWidth = iconsColumns * Styles.iconsSize + ((iconsColumns - 1) * Styles.iconsSpacing * compactX); + } + + var headerWidth = Mathf.Max(headerTextWidth + iconsWidth, Mathf.Max(settingsWidth, headerAddonWidth)) + Styles.iconSize + (Styles.spaceAfterIcon * compactX); + var innerWidth = Mathf.Max(portsWidth, headerWidth); + var edgeWidth = InnerToEdgePosition(new Rect(0, 0, innerWidth, 0)).width; + + var edgeOrigin = unit.position; + var innerOrigin = EdgeToInnerPosition(new Rect(edgeOrigin, Vector2.zero)).position; + var innerX = innerOrigin.x; + var innerY = innerOrigin.y; + + var y = innerY; + var headerHeight = 0f; + + float ciHeight = 0; + for (int i = 0; i < _controlInputs.Count; i++) + { + if (_controlInputs[i].showLabel) + { + ciHeight = Mathf.Max(ciHeight, _controlInputs[i].GetHeight()); + } + } + +#if !NEW_UNIT_STYLE + const int NormalStyleExtraHeight = 4; + if (ciHeight > 0) ciHeight += NormalStyleExtraHeight; +#endif + headerHeight += ciHeight; + y += ciHeight; + + iconPosition = new Rect(innerX, y, Styles.iconSize, Styles.iconSize); + var headerTextX = iconPosition.xMax + Styles.spaceAfterIcon * compactX; + + if (showSurtitle) + { + var h = Styles.surtitle.CalcHeight(surtitleContent, headerTextWidth); + surtitlePosition = new Rect(headerTextX, y, headerTextWidth, h); + float step = h + Styles.spaceAfterSurtitle * compactY; + headerHeight += step; + y += step; + } + + if (showTitle) + { + if (!showSurtitle && !showSettings && (!showSettings || settings?.Count == 0) && (!showHeaderAddon || GetHeaderAddonHeight(headerAddonWidth) == 0)) + { + // Ensure the Title and Unit Icon are lined up + const int TitleYPadding = 3; + y += TitleYPadding; + } + var h = Styles.title.CalcHeight(titleContent, headerTextWidth); + titlePosition = new Rect(headerTextX, y, headerTextWidth, h); + headerHeight += h; + y += h; + } + + if (showSubtitle) + { + float step = Styles.spaceBeforeSubtitle * compactY; + headerHeight += step; + y += step; + var h = Styles.subtitle.CalcHeight(subtitleContent, headerTextWidth); + subtitlePosition = new Rect(headerTextX, y, headerTextWidth, h); + headerHeight += h; + y += h; + } + + iconsPositions.Clear(); + if (showIcons) + { + int iconRow = 0, iconCol = 0; + for (int i = 0; i < description.icons.Length; i++) + { + iconsPositions.Add(new Rect( + innerX + innerWidth - ((iconCol + 1) * Styles.iconsSize) - (iconCol * Styles.iconsSpacing), + innerY + (iconRow * (Styles.iconsSize + Styles.iconsSpacing)), + Styles.iconsSize, Styles.iconsSize)); + + if (++iconRow % Styles.iconsPerColumn == 0) { iconCol++; iconRow = 0; } + } + } + + if (showSettings && settings?.Count > 0) + { + headerHeight += Styles.spaceBeforeSettings * compactY; + y += Styles.spaceBeforeSettings * compactY; + int lastIndex = settings.Count - 1; + for (int i = 0; i < settings.Count; i++) + { + var setting = settings[i]; + var rect = settingsPositions[setting]; + float settingWidth = rect.width; + using (LudiqGUIUtility.currentInspectorWidth.Override(settingWidth)) + { + float sHeight = LudiqGUI.GetInspectorHeight(null, setting, settingWidth, settingLabelsContents[setting] ?? GUIContent.none); + settingsPositions[setting] = new Rect(headerTextX, y, settingWidth, sHeight); + float spacing = (i == lastIndex) ? -Styles.spaceBetweenSettings : Styles.spaceBetweenSettings; + y += sHeight + spacing; + headerHeight += sHeight + spacing; + } + } + } + + if (showHeaderAddon) + { + headerHeight += Styles.spaceBeforeSettings; + y += Styles.spaceBeforeSettings; + + var headerAddonHeight = GetHeaderAddonHeight(headerAddonWidth); + + headerAddonPosition = new Rect(iconPosition.xMax, y, headerAddonWidth, headerAddonHeight); + + headerHeight += headerAddonHeight; + y += headerAddonHeight; + } + + var edgeX = edgeOrigin.x; + var edgeY = edgeOrigin.y; + + headerHeight = Mathf.Max(headerHeight, Styles.iconSize * 0.7f); + + y = innerY + headerHeight + Styles.spaceBeforePorts; + var innerHeight = headerHeight; + + var controlOutputsHeight = 0f; + + if (showPorts) + { + bool hasValuePorts = _valueInputs.Count > 0 || _valueOutputs.Count > 0; + + rowDividerPositions.Clear(); + controlInputDividersX.Clear(); + controlOutputDividersX.Clear(); + + if (hasValuePorts) + { + innerHeight += Styles.spaceBeforePorts * compactY; + y += Styles.spaceBeforePorts * compactY; + } + + float portsBackgroundY = y; + float portsBackgroundHeight = hasValuePorts ? Styles.portsBackground.padding.top * compactY : 0f; + y += portsBackgroundHeight; + + var portStartY = y; + const float rowHeight = 26f; + float currentInputsY = y; + float currentOutputsY = y; + + int maxRows = _valueInputs.Count > _valueOutputs.Count ? _valueInputs.Count : _valueOutputs.Count; + + if (hasValuePorts) + { + rowDividerPositions.Add((currentInputsY, SeparatorPosition.Full)); + } + + for (int i = 0; i < maxRows; i++) + { + if (i < _valueInputs.Count) + { + var widget = _valueInputs[i]; + widget.y = currentInputsY + (rowHeight * 0.5f) - (widget.GetHeight() * 0.5f); + } + + if (i < _valueOutputs.Count) + { + var widget = _valueOutputs[i]; + widget.y = currentOutputsY + (rowHeight * 0.5f) - (widget.GetHeight() * 0.5f); + } + + currentInputsY += rowHeight; + currentOutputsY += rowHeight; + + if (i < maxRows - 1) + { + SeparatorPosition length = SeparatorPosition.Full; + + bool nextHasInput = (i + 1) < _valueInputs.Count; + bool nextHasOutput = (i + 1) < _valueOutputs.Count; + + bool currentHasInput = i < _valueInputs.Count; + bool currentHasOutput = i < _valueOutputs.Count; + + bool isLeftActive = nextHasInput || currentHasInput; + bool isRightActive = nextHasOutput || currentHasOutput; + + if (isLeftActive && !isRightActive) + length = SeparatorPosition.Left; + else if (!isLeftActive && isRightActive) + length = SeparatorPosition.Right; + + rowDividerPositions.Add((currentInputsY, length)); + } + } + + float portsHeight = Mathf.Max(currentInputsY - portStartY, currentOutputsY - portStartY); + y = portStartY + portsHeight; + + if (hasValuePorts) + { + portsBackgroundHeight += portsHeight - 6; + innerHeight += portsHeight - 6; + } + + const int ExtraSpaceBeforePorts = 4; + + if (_controlInputs.Count > 0) + { + int portCount = _controlInputs.Count; + float controlY = edgeY - (Styles.spaceBeforePorts + ExtraSpaceBeforePorts) - Styles.spaceAfterControlInputs; + + float totalSlotSpace = edgeWidth - Styles.spaceBeforePorts; + float slotWidth = totalSlotSpace / portCount; + + for (int i = 0; i < portCount; i++) + { + var widget = _controlInputs[i]; + float slotCenter = edgeX + (slotWidth * (i + 0.5f)) - Styles.spaceBeforePorts; + widget.x = slotCenter; + widget.y = controlY; + + if (i < portCount - 1) + { + controlInputDividersX.Add(edgeX + (slotWidth * (i + 1))); + } + } + } + + if (_controlOutputs.Count > 0) + { + int portCount = _controlOutputs.Count; + float maxCoHeight = 0f; + + for (int i = 0; i < _controlOutputs.Count; i++) + { + float h = _controlOutputs[i].GetHeight(); + if (h > maxCoHeight) maxCoHeight = h; + } + + controlOutputsHeight = maxCoHeight; + + const int ControlOutputsPadding = 3; + float controlY = innerY + innerHeight + Styles.spaceBeforePorts + + ExtraSpaceBeforePorts + controlOutputsHeight + ControlOutputsPadding + Styles.spaceBeforeControlOutputs; + + float totalSlotSpace = edgeWidth - Styles.spaceBeforePorts; + float slotWidth = totalSlotSpace / portCount; + + for (int i = 0; i < portCount; i++) + { + var widget = _controlOutputs[i]; + float slotCenter = edgeX + (slotWidth * (i + 0.5f)) - Styles.spaceBeforePorts; + widget.x = slotCenter; + widget.y = controlY; + + if (i < portCount - 1) + { + controlOutputDividersX.Add(edgeX + (slotWidth * (i + 1))); + } + } + } + + portsBackgroundPosition = new Rect(edgeX, portsBackgroundY, edgeWidth, portsBackgroundHeight); + } + + var edgeHeight = InnerToEdgePosition(new Rect(0, 0, 0, innerHeight)).height; + _position = new Rect(edgeX, edgeY, edgeWidth, edgeHeight + controlOutputsHeight); + } + + protected virtual float GetHeaderAddonWidth() + { + return 0; + } + + protected virtual float GetHeaderAddonHeight(float width) + { + return 0; + } + + #endregion + + + #region Drawing + + protected virtual bool AllowRectSnapping => true; + + private List snapLines = new List(); + + protected void DrawSnapLines() + { + if (snapLines == null || snapLines.Count == 0) + return; + + var oldColor = Handles.color; + + Handles.color = new Color32(64, 113, 156, 255); + + foreach (var line in snapLines) + { + Handles.DrawLine(line.start, line.end); + } + + Handles.color = oldColor; + } + + protected virtual NodeColorMix baseColor => NodeColor.Gray; + + protected override NodeColorMix color + { + get + { + if (unitDebugData.runtimeException != null) + { + return NodeColor.Red; + } + + var color = baseColor; + + if (analysis.warnings.Count > 0) + { + var mostSevereWarning = Warning.MostSevereLevel(analysis.warnings); + + switch (mostSevereWarning) + { + case WarningLevel.Error: + color = NodeColor.Red; + break; + + case WarningLevel.Severe: + color = NodeColor.Orange; + break; + + case WarningLevel.Caution: + color = NodeColor.Yellow; + + break; + } + } + + if (EditorApplication.isPaused) + { + if (EditorTimeBinding.frame == unitDebugData.lastInvokeFrame) + { + return NodeColor.Blue; + } + } + else + { + var mix = color; + mix.blue = Mathf.Lerp(1, 0, (EditorTimeBinding.time - unitDebugData.lastInvokeTime) / Styles.invokeFadeDuration); + + return mix; + } + + return color; + } + } + + protected override NodeShape shape => NodeShape.Square; + + protected virtual bool showTitle => !string.IsNullOrEmpty(description.shortTitle); + + protected virtual bool showSurtitle => !string.IsNullOrEmpty(description.surtitle); + + protected virtual bool showSubtitle => !string.IsNullOrEmpty(description.subtitle); + + protected virtual bool showIcons => description.icons.Length > 0; + + protected virtual bool showSettings => settingNames.Count > 0; + + protected virtual bool showHeaderAddon => false; + + protected virtual bool showPorts => ports.Count > 0; + + protected override bool dim + { + get + { + var dim = BoltCore.Configuration.dimInactiveNodes && !analysis.isEntered; + + if (isMouseOver || isSelected) + { + dim = false; + } + + if (BoltCore.Configuration.dimIncompatibleNodes && canvas.isCreatingConnection) + { + bool canConnect = false; + foreach (var p in unit.ports) + { + if (canvas.connectionSource == p || canvas.connectionSource.CanValidlyConnectTo(p)) + { + canConnect = true; + break; + } + } + dim = !canConnect; + } + + return dim; + } + } + public override void DrawOverlay() + { + base.DrawOverlay(); + if (AllowRectSnapping && isDragging && e.ctrlOrCmd) + DrawSnapLines(); + } + public override void DrawForeground() + { + BeginDim(); + + base.DrawForeground(); + + DrawIcon(); + + if (showSurtitle) + { + DrawSurtitle(); + } + + if (showTitle) + { + DrawTitle(); + } + + if (showSubtitle) + { + DrawSubtitle(); + } + + if (showIcons) + { + DrawIcons(); + } + + if (showSettings) + { + DrawSettings(); + } + + if (showHeaderAddon) + { + DrawHeaderAddon(); + } + + if (showPorts) + { + DrawPortsBackground(); + } + + EndDim(); + } + + protected void DrawIcon() + { + var icon = description.icon ?? BoltFlow.Icons.unit; + + if (icon != null && icon[(int)iconPosition.width]) + { + GUI.DrawTexture(iconPosition, icon[(int)iconPosition.width]); + } + } + + protected void DrawTitle() + { + GUI.Label(titlePosition, titleContent, invertForeground ? Styles.titleInverted : Styles.title); + } + + protected void DrawSurtitle() + { + GUI.Label(surtitlePosition, surtitleContent, invertForeground ? Styles.surtitleInverted : Styles.surtitle); + } + + protected void DrawSubtitle() + { + GUI.Label(subtitlePosition, subtitleContent, invertForeground ? Styles.subtitleInverted : Styles.subtitle); + } + + protected void DrawIcons() + { + for (int i = 0; i < description.icons.Length; i++) + { + var icon = description.icons[i]; + var position = iconsPositions[i]; + + GUI.DrawTexture(position, icon?[(int)position.width]); + } + } + + private void DrawSettings() + { + if (graph.zoom < FlowCanvas.inspectorZoomThreshold) + { + return; + } + + EditorGUI.BeginDisabledGroup(!e.IsRepaint && isMouseThrough && !isMouseOver); + + EditorGUI.BeginChangeCheck(); + + foreach (var setting in settings) + { + DrawSetting(setting); + } + + if (EditorGUI.EndChangeCheck()) + { + unit.Define(); + Reposition(); + } + + EditorGUI.EndDisabledGroup(); + } + + protected void DrawSetting(Metadata setting) + { + var settingPosition = settingsPositions[setting]; + + using (LudiqGUIUtility.currentInspectorWidth.Override(settingPosition.width)) + using (Inspector.expandTooltip.Override(false)) + { + var label = settingLabelsContents[setting]; + + if (label == null) + { + LudiqGUI.Inspector(setting, settingPosition, GUIContent.none); + } + else + { + using (Inspector.defaultLabelStyle.Override(Styles.settingLabel)) + using (LudiqGUIUtility.labelWidth.Override(Styles.settingLabel.CalcSize(label).x)) + { + LudiqGUI.Inspector(setting, settingPosition, label); + } + } + } + } + + protected virtual void DrawHeaderAddon() { } + + protected static readonly Color portsSeparatorColor = new Color(0.15f, 0.15f, 0.15f, 1f); + + private IUnitPortWidget Single(IUnitPort targetPort) + { + IUnitPortWidget widget = null; + for (int i = 0; i < ports.Count; i++) + { + if (ports[i].port == targetPort) + { + widget = ports[i]; + break; + } + } + return widget; + } + + protected void DrawPortsBackground() + { + if (canvas.showRelations) + { + foreach (var relation in unit.relations) + { + var sourcePort = relation.source; + var destinationPort = relation.destination; + IUnitPortWidget sourceWidget = Single(sourcePort); + var destinationWidget = Single(destinationPort); + + Vector2 start = sourceWidget.handlePosition.center; + Vector2 end = destinationWidget.handlePosition.center; + + bool valueToControl = + sourcePort is ValueInput && + destinationPort is ControlInput; + + // Requirement + if (valueToControl) + { + start = sourceWidget.handlePosition.center; + + end = new Vector2( + destinationWidget.handlePosition.center.x, + destinationWidget.handlePosition.yMin + ); + } + + float distance = Vector2.Distance(start, end); + float offset = Mathf.Min(distance * 0.35f, 40f); + + Vector2 startDir; + Vector2 endDir; + + if (valueToControl) + { + startDir = Vector2.up; + endDir = Vector2.down; + } + else + { + startDir = PortDirection(sourcePort); + endDir = PortDirection(destinationPort); + } + + Vector2 startTangent = start + startDir * offset; + Vector2 endTangent = end + endDir * offset; + + Handles.DrawBezier( + start, + end, + startTangent, + endTangent, + ColorPalette.unityBackgroundDark, + null, + 3f + ); + } + + static Vector2 PortDirection(IUnitPort port) + { + return port switch + { + ControlOutput => Vector2.down, + ControlInput => Vector2.up, + + ValueOutput => Vector2.left, + ValueInput => Vector2.right, + + _ => Vector2.right + }; + } + } + else + { + float edgeX = edgePosition.x; + float fullWidth = edgePosition.width; + float halfWidth = fullWidth * 0.5f; + float midX = edgeX + halfWidth; + +#if NEW_UNIT_STYLE + float outerY = outerPosition.y + 2f; + float innerY = innerPosition.yMax - 2f; +#else + float outerY = outerPosition.y + 4f; + float innerY = innerPosition.yMax - 5f; +#endif + + int rowCount = rowDividerPositions.Count; + for (int i = 0; i < rowCount; i++) + { + float lineY = rowDividerPositions[i].Item1; + SeparatorPosition length = rowDividerPositions[i].Item2; + + float x = edgeX; + float w = fullWidth; + + if (length == SeparatorPosition.Left) + { + w = halfWidth; + } + else if (length == SeparatorPosition.Right) + { + x = midX; + w = halfWidth; + } + + EditorGUI.DrawRect(new Rect(x, lineY, w, 1f), portsSeparatorColor); + } + + int inputCount = controlInputDividersX.Count; + for (int i = 0; i < inputCount; i++) + { + EditorGUI.DrawRect(new Rect(controlInputDividersX[i], outerY, 1f, 16f), portsSeparatorColor); + } + + int outputCount = controlOutputDividersX.Count; + for (int i = 0; i < outputCount; i++) + { + EditorGUI.DrawRect(new Rect(controlOutputDividersX[i], innerY, 1f, 16f), portsSeparatorColor); + } + } + } + + #endregion + + + #region Selecting + + public override bool canSelect => true; + + #endregion + + + #region Dragging + + public override bool canDrag => true; + + public override void ExpandDragGroup(HashSet dragGroup) + { + if (BoltCore.Configuration.carryChildren) + { + foreach (var output in unit.outputs) + { + foreach (var connection in output.connections) + { + if (dragGroup.Contains(connection.destination.unit)) + { + continue; + } + + dragGroup.Add(connection.destination.unit); + + canvas.Widget(connection.destination.unit).ExpandDragGroup(dragGroup); + } + } + } + } + + #endregion + + + #region Deleting + + public override bool canDelete => true; + + #endregion + + + #region Clipboard + + public override void ExpandCopyGroup(HashSet copyGroup) + { + copyGroup.UnionWith(unit.connections.Cast()); + } + + #endregion + + + #region Context + + protected override IEnumerable contextOptions + { + get + { + yield return new DropdownOption((Action)ReplaceUnit, "Replace..."); + + foreach (var baseOption in base.contextOptions) + { + yield return baseOption; + } + + if (selection.Count > 0) + { + yield return new DropdownOption((Action)ConvertToEmbed, "Selection/To Embed Subgraph"); + yield return new DropdownOption((Action)ConvertToMacro, "Selection/To Macro Subgraph"); + } + } + } + + private void ConvertToEmbed() + { + NodeSelection.Convert(GraphSource.Embed); + } + + private void ConvertToMacro() + { + NodeSelection.Convert(GraphSource.Macro); + } + + private void ReplaceUnit() + { + UnitWidgetHelper.ReplaceUnit(unit, reference, context, selection, e); + } + + #endregion + + + public static class Styles + { + static Styles() + { + // Disabling word wrap because Unity's CalcSize and CalcHeight + // are broken w.r.t. pixel-perfection and matrix + + title = new GUIStyle(BoltCore.Styles.nodeLabel); + title.padding = new RectOffset(0, 5, 0, 2); + title.margin = new RectOffset(0, 0, 0, 0); + title.fontSize = 12; + title.alignment = TextAnchor.MiddleLeft; + title.wordWrap = false; + + surtitle = new GUIStyle(BoltCore.Styles.nodeLabel); + surtitle.padding = new RectOffset(0, 5, 0, 0); + surtitle.margin = new RectOffset(0, 0, 0, 0); + surtitle.fontSize = 10; + surtitle.alignment = TextAnchor.MiddleLeft; + surtitle.wordWrap = false; + + subtitle = new GUIStyle(surtitle); + subtitle.padding.bottom = 2; + + titleInverted = new GUIStyle(title); + titleInverted.normal.textColor = ColorPalette.unityBackgroundDark; + + surtitleInverted = new GUIStyle(surtitle); + surtitleInverted.normal.textColor = ColorPalette.unityBackgroundDark; + + subtitleInverted = new GUIStyle(subtitle); + subtitleInverted.normal.textColor = ColorPalette.unityBackgroundDark; + +#if NEW_UNIT_STYLE + if (EditorGUIUtility.isProSkin) + { + portsBackground = new GUIStyle + { + padding = new RectOffset(0, 0, 6, 5), + border = new RectOffset(0, 0, 2, 2) + }; + + portsBackground.normal.background = CommunityStyles.MakeBorderedTexture(CommunityStyles.backgroundColor, CommunityStyles.backgroundColor.Darken(0.05f)); + } + else + { + portsBackground = new GUIStyle + { + normal = { background = CommunityStyles.MakeBorderedTexture(CommunityStyles.backgroundColor, CommunityStyles.backgroundColor.Brighten(0.05f)) }, + padding = new RectOffset(0, 0, 6, 5) + }; + } +#else + portsBackground = VisualScripting.UnitWidget.Styles.portsBackground; +#endif + settingLabel = new GUIStyle(BoltCore.Styles.nodeLabel); + settingLabel.padding.left = 0; + settingLabel.padding.right = 5; + settingLabel.wordWrap = false; + settingLabel.clipping = TextClipping.Clip; + } + + public static readonly GUIStyle title; + + public static readonly GUIStyle surtitle; + + public static readonly GUIStyle subtitle; + + public static readonly GUIStyle titleInverted; + + public static readonly GUIStyle surtitleInverted; + + public static readonly GUIStyle subtitleInverted; + + public static readonly GUIStyle settingLabel; + + public static readonly float spaceAroundLineIcon = 5; + + public static readonly float spaceBeforePorts = 4; +#if NEW_UNIT_STYLE + public static readonly float spaceBeforeControlOutputs = 6; + + public static readonly float spaceAfterControlInputs = 20; +#else + public static readonly float spaceBeforeControlOutputs = 5; + public static readonly float spaceAfterControlInputs = 17; +#endif + public static readonly float spaceBetweenInputsAndOutputs = 8; + + public static readonly float spaceBeforeSettings = 2; + + public static readonly float spaceBetweenSettings = 3; + + public static readonly float spaceBetweenPorts = 3; + + public static readonly float spaceAfterSettings = 0; + + public static readonly float maxSettingsWidth = 150; + + public static readonly GUIStyle portsBackground; + + public static readonly float iconSize = 24f; + + public static readonly float iconsSize = IconSize.Small; + + public static readonly float iconsSpacing = 3; + + public static readonly int iconsPerColumn = 2; + + public static readonly float spaceAfterIcon = 3; + + public static readonly float spaceAfterSurtitle = 1; + + public static readonly float spaceBeforeSubtitle = 0; + + public static readonly float invokeFadeDuration = 0.5f; + } + } +} +#endif \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitWidget.cs.meta b/Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/VerticalUnitWidget.cs.meta similarity index 100% rename from Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/UnitWidget.cs.meta rename to Editor/Nodes/Fundamentals/Widgets/PatchedWidgets/VerticalUnitWidget.cs.meta diff --git a/Editor/Nodes/Fundamentals/Widgets/SomeValueWidget.cs b/Editor/Nodes/Fundamentals/Widgets/SomeValueWidget.cs index dda4f866..eeacaae4 100644 --- a/Editor/Nodes/Fundamentals/Widgets/SomeValueWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/SomeValueWidget.cs @@ -16,11 +16,5 @@ protected override NodeColorMix baseColor return new NodeColorMix() { red = 0.6578709f, green = 1f }; } } - -#if NEW_UNIT_STYLE - protected override bool isSpecialPortsColor => true; - - protected override Color? PortsbackgroundColor => new Color(1f, 0.32f, 0.1f); -#endif } } \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Widgets/StuffHappensWidget.cs b/Editor/Nodes/Fundamentals/Widgets/StuffHappensWidget.cs index 370bf9c7..4a98899f 100644 --- a/Editor/Nodes/Fundamentals/Widgets/StuffHappensWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/StuffHappensWidget.cs @@ -17,11 +17,5 @@ protected override NodeColorMix baseColor return new NodeColorMix() { red = 0.6578709f, green = 1f }; } } - -#if NEW_UNIT_STYLE - protected override bool isSpecialPortsColor => true; - - protected override Color? PortsbackgroundColor => new Color(1f, 0.32f, 0.1f); -#endif } } \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Widgets/TodoWidget.cs b/Editor/Nodes/Fundamentals/Widgets/TodoWidget.cs index d0f36549..4111aca6 100644 --- a/Editor/Nodes/Fundamentals/Widgets/TodoWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/TodoWidget.cs @@ -16,10 +16,5 @@ protected override NodeColorMix baseColor return new NodeColorMix() { red = 0.6578709f, green = 1f }; } } -#if NEW_UNIT_STYLE - protected override bool isSpecialPortsColor => true; - - protected override Color? PortsbackgroundColor => new Color(1f, 0.32f, 0.1f); -#endif } } \ No newline at end of file diff --git a/Editor/Nodes/Fundamentals/Widgets/ValueRerouteWidget.cs b/Editor/Nodes/Fundamentals/Widgets/ValueRerouteWidget.cs index 690708fa..64713566 100644 --- a/Editor/Nodes/Fundamentals/Widgets/ValueRerouteWidget.cs +++ b/Editor/Nodes/Fundamentals/Widgets/ValueRerouteWidget.cs @@ -25,9 +25,9 @@ public ValueRerouteWidget(FlowCanvas canvas, ValueReroute unit) : base(canvas, u var data = copyDataList.FirstOrDefault(d => d.copyID == unit.copyID); if (data != null && unit.isCopying) { - if (unit.hideConnection && data.sourceConnection != null && data.graph == unit.graph) + var source = data.sourceConnection?.source; + if (unit.hideConnection && data.sourceConnection != null && unit.input.CanValidlyConnectTo(source)) { - var source = data.sourceConnection.source; unit.input.ValidlyConnectTo(source); } } @@ -65,9 +65,42 @@ public override void ExpandCopyGroup(HashSet copyGroup) base.ExpandCopyGroup(copyGroup); } - +#if NEW_UNIT_UI + protected override IEnumerable SnapTargets + { + get + { + foreach (var target in base.SnapTargets) + { + yield return target; + + if (target is IUnit unit) + { + foreach (var port in unit.validPorts.OfType()) + { + yield return port; + } + } + } + } + } +#endif private bool isPortal => unit.hideConnection && unit.input.hasValidConnection; + private static GUIStyle _labelStyle; + + private static GUIStyle labelStyle + { + get + { + _labelStyle ??= new GUIStyle(EditorStyles.label) + { + clipping = TextClipping.Overflow + }; + + return _labelStyle; + } + } public override void DrawForeground() { var inputHasConnection = inputs[0].port.hasAnyConnection; @@ -81,25 +114,23 @@ public override void DrawForeground() if (isSelected || mouseIsOver || !inputHasConnection || !outputHasConnection || unit.hideConnection) { var width = 26f; - var height = _position.height - 4; + var height = _position.height - 8; UnitPortDescription inputDescription = null; if (isPortal) { inputDescription = unit.input.connection.source.Description(); width = UnitPortWidget.Styles.label.CalcSize(inputDescription.ToGUIContent(IconSize.Small)).x + 50f; } - _position.width = width; GraphGUI.Node(new Rect(position.x, position.y + 3, width, height), NodeShape.Square, color, isSelected); - +#if NEW_UNIT_STYLE + const float yPadding = 5; +#else + const float yPadding = 7; +#endif if (inputDescription != null) - GUI.Label(new Rect(position.x + 24, position.y + 5, width, height), inputDescription.label); - } - else - { - _position.width = -19; + GUI.Label(new Rect(position.x + 24, position.y + yPadding, width, height), inputDescription.label, labelStyle); } #endif - Reposition(); } @@ -137,17 +168,26 @@ public override void CachePosition() if (isPortal) { _position.width = VisualScripting.UnitPortWidget.Styles.label.CalcSize(inputPort.connection.source.Description().ToGUIContent(IconSize.Small)).x + 50f; - _position.height = EditorGUIUtility.singleLineHeight; } else { - _position.width = !inputHasConnection || !outputHasConnection || isSelected || mouseIsOver || unit.hideConnection ? 26 : -25; + _position.width = !inputHasConnection || !outputHasConnection || isSelected || mouseIsOver || unit.hideConnection ? 26 : -24; #endif - _position.height = 20; } - inputs[0].y = _position.y + 5; - outputs[0].y = _position.y + 5; +#if NEW_UNIT_STYLE + _position.height = EditorGUIUtility.singleLineHeight; +#else + _position.height = EditorGUIUtility.singleLineHeight + 6f; +#endif + +#if NEW_UNIT_STYLE + inputs[0].y = _position.y + 2; + outputs[0].y = _position.y + 2; +#else + inputs[0].y = _position.y + 6f; + outputs[0].y = _position.y + 6f; +#endif if (valueIcon == null && (inputPort.Descriptor()).description.icon != null) valueIcon = ((UnitPortDescriptor)inputPort.Descriptor()).description.icon; diff --git a/Editor/ProjectSettings/ProjectSettingsProviderView.cs b/Editor/ProjectSettings/ProjectSettingsProviderView.cs index f118e814..b27e7e24 100644 --- a/Editor/ProjectSettings/ProjectSettingsProviderView.cs +++ b/Editor/ProjectSettings/ProjectSettingsProviderView.cs @@ -14,7 +14,6 @@ internal class ProjectSettingsProviderView : SettingsProvider public const string NewToolbarKey = "Community_Settings_NewToolbar"; public const string GraphMinimapKey = "Community_Settings_GraphMinimap"; - public const string DarkerUIKey = "Community_Settings_DarkerUI"; public const string NewVariablesUIKey = "Community_Settings_NewVariablesUI"; public const string ShowVariablesQuickbarKey = "Community_Settings_ShowVariablesQuickbar"; public const string NewListUIKey = "Community_Settings_NewListUI"; @@ -27,7 +26,6 @@ internal class ProjectSettingsProviderView : SettingsProvider private bool _unitStyle; private bool _newToolbar; private bool _graphMinimap; - private bool _darkerUI; private bool _newVariablesUI; private bool _showVariablesQuickbar; private bool _newListUI; @@ -38,7 +36,6 @@ internal class ProjectSettingsProviderView : SettingsProvider private bool _originalUnitStyle; private bool _originalNewToolbar; private bool _originalGraphMinimap; - private bool _originalDarkerUI; private bool _originalNewVariablesUI; private bool _originalShowVariablesQuickbar; private bool _originalNewListUI; @@ -106,7 +103,6 @@ public override void OnGUI(string searchContext) GUILayout.Space(10); GUILayout.Label("UI", EditorStyles.boldLabel); - DrawToggle("Darker UI", ref _darkerUI); DrawToggle("New Variables UI", ref _newVariablesUI); EditorGUI.BeginDisabledGroup(!_newVariablesUI); @@ -130,7 +126,6 @@ private void LoadValues() _originalNewToolbar = _newToolbar = EditorPrefs.GetBool(NewToolbarKey, false); _originalGraphMinimap = _graphMinimap = EditorPrefs.GetBool(GraphMinimapKey, false); - _originalDarkerUI = _darkerUI = EditorPrefs.GetBool(DarkerUIKey, false); _originalNewVariablesUI = _newVariablesUI = EditorPrefs.GetBool(NewVariablesUIKey, false); _originalShowVariablesQuickbar = _showVariablesQuickbar = EditorPrefs.GetBool(ShowVariablesQuickbarKey, false); _originalNewListUI = _newListUI = EditorPrefs.GetBool(NewListUIKey, false); @@ -145,7 +140,6 @@ private bool HasPendingChanges() _unitStyle != _originalUnitStyle || _newToolbar != _originalNewToolbar || _graphMinimap != _originalGraphMinimap || - _darkerUI != _originalDarkerUI || _newVariablesUI != _originalNewVariablesUI || _showVariablesQuickbar != _originalShowVariablesQuickbar || _newListUI != _originalNewListUI || @@ -211,7 +205,6 @@ private void ApplyAllChanges() } EditorPrefs.SetBool(NewToolbarKey, _newToolbar); EditorPrefs.SetBool(GraphMinimapKey, _graphMinimap); - EditorPrefs.SetBool(DarkerUIKey, _darkerUI); EditorPrefs.SetBool(NewVariablesUIKey, _newVariablesUI); EditorPrefs.SetBool(ShowVariablesQuickbarKey, _showVariablesQuickbar); EditorPrefs.SetBool(NewListUIKey, _newListUI); @@ -222,7 +215,6 @@ private void ApplyAllChanges() ScriptingDefineUtility.UpdateUnitStyle(); ScriptingDefineUtility.UpdateToolbarStyle(); ScriptingDefineUtility.UpdateGraphMiniMap(); - ScriptingDefineUtility.UpdateDarkUI(); ScriptingDefineUtility.UpdateVariablesUI(); ScriptingDefineUtility.UpdateListUI(); ScriptingDefineUtility.UpdateDictionaryUI(); @@ -233,7 +225,6 @@ private void ApplyAllChanges() _originalNewToolbar = _newToolbar; _originalGraphMinimap = _graphMinimap; - _originalDarkerUI = _darkerUI; _originalNewVariablesUI = _newVariablesUI; _originalShowVariablesQuickbar = _showVariablesQuickbar; _originalNewListUI = _newListUI; @@ -247,7 +238,6 @@ private void ResetToDefaults() _unitStyle = false; _newToolbar = false; _graphMinimap = false; - _darkerUI = false; _newVariablesUI = false; _showVariablesQuickbar = false; _newListUI = false; diff --git a/Editor/Shared/Utility/CommunityStyles.cs b/Editor/Shared/Utility/CommunityStyles.cs index 0b6e49b3..57c534b7 100644 --- a/Editor/Shared/Utility/CommunityStyles.cs +++ b/Editor/Shared/Utility/CommunityStyles.cs @@ -1,8 +1,10 @@ #pragma warning disable using System; using System.Collections; +using System.Linq; using Unity.VisualScripting; using Unity.VisualScripting.Community.Libraries.Humility; +using Unity.VisualScripting.ReorderableList; using UnityEditor; using UnityEngine; @@ -37,6 +39,12 @@ public static class CommunityStyles public static readonly Texture2D DragHandleTexture; public static readonly Texture2D RemoveItemTexture; + public static readonly Texture2D controlPortUnconnected; + public static readonly Texture2D controlPortConnected; + public static readonly Texture2D valuePortUnconnected; + public static readonly Texture2D valuePortConnected; + public static readonly Texture2D valuePortalConnection; + private static GUIStyle toolbarButton; internal static Texture2D toolbarButtonNormalTex; private static Texture2D toolbarButtonHoverTex; @@ -46,6 +54,10 @@ public static class CommunityStyles private static Texture2D sidebarAnchorButtonHoverTex; private static bool lastProSkin; + public static readonly float relativeBend = 0.5f; + public static readonly float minBend = 20f; + public static readonly float connectionThickness = 3f; + public static GUIStyle ToolbarButton { get @@ -166,7 +178,7 @@ public static GUIStyle SidebarAnchorButton static CommunityStyles() { - backgroundColor = Unity.VisualScripting.ColorPalette.unityBackgroundMid.color.Darken(0.05f); + backgroundColor = Unity.VisualScripting.ColorPalette.unityBackgroundMid.color; foldoutBackgroundColor = Unity.VisualScripting.ColorPalette.unityBackgroundDark.color.Darken(0.02f); foldoutHeaderColor = Unity.VisualScripting.ColorPalette.unityBackgroundDark.color.Darken(0.05f); @@ -190,6 +202,12 @@ static CommunityStyles() var sidebarAnchorButtonBg = CommunityStyles.backgroundColor; var sidebarAnchorButtonBorder = EditorGUIUtility.isProSkin ? CommunityStyles.backgroundColor.Darken(0.05f) : CommunityStyles.backgroundColor.Brighten(0.05f); sidebarAnchorButtonBackground = MakeBorderedTexture(headerBg, border, BorderSide.LeftRight | BorderSide.Top); + + controlPortConnected = PathUtil.Load("ConnectedHandle", CommunityEditorPath.Fundamentals)?[12]; + controlPortUnconnected = PathUtil.Load("UnconnectedHandle", CommunityEditorPath.Fundamentals)?[12]; + valuePortConnected = PathUtil.Load("ValuePortConnected", CommunityEditorPath.Fundamentals)?[12]; + valuePortUnconnected = PathUtil.Load("ValuePortUnconnected", CommunityEditorPath.Fundamentals)?[12]; + valuePortalConnection = PathUtil.Load("PortalConnectionIn", CommunityEditorPath.Fundamentals)?[16]; } public static Texture2D MakeBorderedTexture(Color background, Color border, BorderSide borderSides = BorderSide.TopBottom, int width = 32, int height = 32, int borderThickness = 1) @@ -232,15 +250,23 @@ public static Texture2D MakeBorderedTexture(Color background, Color border, Bord return tex; } - private static string[] preferredNames = new string[] { "key", "title", "id", "label", "name" }; + public static bool TitleFoldout(Rect position, bool isExpanded, GUIContent title) + { + if (Event.current.type == EventType.Repaint) + { + ReorderableListStyles.Title.Draw(position, "", false, false, false, false); + } + + position.x += 16; + + return EditorGUI.Foldout(position, isExpanded, title, true); + } + + private static readonly string[] preferredNames = { "key", "title", "id", "label", "name" }; /// /// Get the display name for metadata when in a collection. /// - /// The metadata - /// The metadata index in the collection - /// If the value is primitive use the value as the display name if none other can be resolved. - /// The GUIContent with the Name and Icon public static GUIContent GetCollectionDisplayName(Metadata element, int index, bool valueAsFallback = false) { object value = element?.value; @@ -251,6 +277,8 @@ public static GUIContent GetCollectionDisplayName(Metadata element, int index, b if (value is string s && !string.IsNullOrEmpty(s)) return new GUIContent(s, typeof(string).Icon()?[IconSize.Small]); + Type valueType = value.GetType(); + if (value is Type type) { return new GUIContent(type.DisplayName(), type.Icon()?[IconSize.Small]); @@ -258,15 +286,14 @@ public static GUIContent GetCollectionDisplayName(Metadata element, int index, b if (value is UnityEngine.Object uobj) { - if (uobj is UnityEngine.Object uv) - { - if (uv is IEventMachine machine) - return new GUIContent(GetMachineName(machine), machine.GetType().Icon()?[IconSize.Small]); - else if (uv is IMacro macro) - return new GUIContent(GetMacroName(macro), macro.GetType().Icon()?[IconSize.Small]); - else if (!string.IsNullOrEmpty(uv.name)) - return new GUIContent(uv.name, uv.GetType().Icon()?[IconSize.Small]); - } + if (uobj is IEventMachine machine) + return new GUIContent(GetMachineName(machine), machine.GetType().Icon()?[IconSize.Small]); + + if (uobj is IMacro macro) + return new GUIContent(GetMacroName(macro), macro.GetType().Icon()?[IconSize.Small]); + + if (!string.IsNullOrEmpty(uobj.name)) + return new GUIContent(uobj.name, uobj.GetType().Icon()?[IconSize.Small]); } if (value is ICollection collection) @@ -274,6 +301,8 @@ public static GUIContent GetCollectionDisplayName(Metadata element, int index, b return new GUIContent($"{collection.GetType().DisplayName()} [{collection.Count}]", collection.GetType().Icon()?[IconSize.Small]); } + Texture icon = valueType.Icon()?[IconSize.Small]; + object TryGetMemberValue(string memberName) { try @@ -292,7 +321,6 @@ object TryGetMemberValue(string memberName) var mv = TryGetMemberValue(pref); if (mv != null) { - var icon = value.GetType().Icon()?[IconSize.Small]; if (mv is UnityEngine.Object uv) { if (uv is IEventMachine machine) @@ -308,24 +336,25 @@ object TryGetMemberValue(string memberName) } } - if (valueAsFallback && value.GetType().IsBasic()) + if (valueAsFallback && valueType.IsBasic()) { - return new GUIContent(value.ToString(), value.GetType().Icon()?[IconSize.Small]); + return new GUIContent(value.ToString(), icon); } - return new GUIContent($"Value {index + 1}", value.GetType().Icon()?[IconSize.Small]); + return new GUIContent($"Value {index + 1}", icon); } public static string GetMachineName(IEventMachine machine) { - if (!string.IsNullOrEmpty(machine?.GetReference()?.graph?.title)) + var graphTitle = machine?.GetReference()?.graph?.title; + if (!string.IsNullOrEmpty(graphTitle)) { - return machine.GetReference().graph.title; + return graphTitle; } - if (machine.nest.source == GraphSource.Macro && machine.nest.macro is UnityEngine.Object @object) + if (machine.nest.source == GraphSource.Macro && machine.nest.macro is UnityEngine.Object obj) { - if (!string.IsNullOrEmpty(@object.name)) return $"{@object.name}"; + if (!string.IsNullOrEmpty(obj.name)) return obj.name; } return "Unnamed Machine"; @@ -333,14 +362,15 @@ public static string GetMachineName(IEventMachine machine) public static string GetMacroName(IMacro macro) { - if (!string.IsNullOrEmpty(macro?.GetReference()?.graph?.title)) + var graphTitle = macro?.GetReference()?.graph?.title; + if (!string.IsNullOrEmpty(graphTitle)) { - return macro.GetReference().graph.title; + return graphTitle; } - if (macro is UnityEngine.Object @object) + if (macro is UnityEngine.Object obj) { - return @object.name; + return obj.name; } return "Unnamed Macro"; diff --git a/Editor/Shared/Utility/GraphTraversal.cs b/Editor/Shared/Utility/GraphTraversal.cs index 7b9b3a33..db6beecb 100644 --- a/Editor/Shared/Utility/GraphTraversal.cs +++ b/Editor/Shared/Utility/GraphTraversal.cs @@ -197,6 +197,23 @@ public static string GetNesterStateTransitionName(INesterStateTransition nester) else return $"Embed {nester.GetType().Name}"; } + public static string GetNesterName(IGraphNesterElement nester) + { + if (nester is INesterUnit nesterUnit) return GetNesterUnitName(nesterUnit); + else if (nester is INesterState nesterState) return GetNesterStateName(nesterState); + else if (nester is INesterStateTransition nesterStateTransition) return GetNesterStateTransitionName(nesterStateTransition); + + if (!string.IsNullOrEmpty(nester.nest.graph.title)) + { + return nester.nest.graph.title; + } + else if (nester.nest.source == GraphSource.Macro && nester.nest.macro is Object @object) + { + return @object.name; + } + else return $"Embed {nester.GetType().Name}"; + } + public static void TraverseGraph(IGraph graph, System.Action visit) { if (graph == null || visit == null) return; diff --git a/Editor/Shared/Utility/GraphUtility.cs b/Editor/Shared/Utility/GraphUtility.cs index 27464b72..39b6926e 100644 --- a/Editor/Shared/Utility/GraphUtility.cs +++ b/Editor/Shared/Utility/GraphUtility.cs @@ -729,5 +729,133 @@ public static void UpdateAllSceneVariables(Scene scene, string oldName, string n } Undo.CollapseUndoOperations(group); } + + /// + /// + /// : The kind of variable to look for when renaming. Excludes Flow variables see: + /// + /// + /// : The current name of the variable, this is what it searches for. + /// + /// + /// : The new name to replace the old name with. + /// + /// + /// : The metadata of the field. + /// + /// + public static void RenameVariables(VariableKind kind, string oldName, string newName, Metadata metadata) + { + switch (kind) + { + case VariableKind.Graph: + if (EditorWindow.focusedWindow == GraphWindow.active) + UpdateAllGraphVariables((FlowGraph)GraphWindow.activeContext.graph, oldName, newName); + else if (VariablesWindow.isVariablesWindowContext && VariablesWindow.currentContext != null) + UpdateAllGraphVariables((FlowGraph)VariablesWindow.currentContext.graph, oldName, newName); + break; + case VariableKind.Object: + { + var ancestor = metadata.Ancestor(m => m.value is VisualScripting.Variables); + if (ancestor != null && ancestor.value != null) + { + var gameObject = (ancestor.value as VisualScripting.Variables).gameObject; + UpdateAllObjectVariables(gameObject, oldName, newName); + } + else if (EditorWindow.focusedWindow == GraphWindow.active && GraphWindow.activeReference != null) + { + if (GraphWindow.activeReference.gameObject != null) + UpdateAllObjectVariables(GraphWindow.activeReference.gameObject, oldName, newName); + } + } + break; + case VariableKind.Scene: + { + var ancestor = metadata.Ancestor(m => m.value is VisualScripting.Variables); + if (ancestor != null && ancestor.value != null) + { + var scene = (ancestor.value as VisualScripting.Variables).gameObject.scene; + UpdateAllSceneVariables(scene, oldName, newName); + } + else if (EditorWindow.focusedWindow == GraphWindow.active && GraphWindow.activeReference != null) + { + if (GraphWindow.activeReference.scene != null) + UpdateAllSceneVariables(GraphWindow.activeReference.scene.Value, oldName, newName); + else + { + Scene? current = null; + for (int i = 0; i < SceneManager.sceneCount; i++) + { + var scene = SceneManager.GetSceneAt(i); + if (!scene.isLoaded) continue; + + var variables = VisualScripting.Variables.Scene(scene); + + if (variables == metadata.parent.value) + { + current = scene; + break; + } + } + + if (current == null) + { + Debug.LogWarning( + $"[Rename Variables] Could not find the scene that this variable is in please ensure that the scene is valid and loaded." + ); + break; + } + + UpdateAllSceneVariables(current.Value, oldName, newName); + } + } + } + break; + case VariableKind.Application: + { + if (Application.isPlaying) + { + Debug.LogWarning($"[Rename Variables] Cannot rename all Application variables while in play mode!"); + break; + } + bool choice = EditorUtility.DisplayDialog( + "Update ALL Application Variables?", + "This will go through ALL scenes and macros to find every Variable Unit " + + $"using {oldName} and update it to {newName}.\n\n" + + "This operation is FINAL and cannot be undone!", + "Update All", + "Rename Only" + ); + + if (choice) + { + RenameApplicationVariables(oldName, newName); + } + } + break; + case VariableKind.Saved: + { + if (Application.isPlaying) + { + Debug.LogWarning($"[Rename Variables] Cannot rename all Saved variables while in play mode!"); + break; + } + bool choice = EditorUtility.DisplayDialog( + "Update ALL Saved Variables?", + "This will go through ALL scenes and macros to find every Variable Unit " + + $"using {oldName} and update it to {newName}.\n\n" + + "This operation is FINAL and cannot be undone!", + "Update All", + "Rename Only" + ); + + if (choice) + { + RenameSavedVariables(oldName, newName); + } + } + break; + } + } } } \ No newline at end of file diff --git a/Editor/Shared/Utility/RectUtility.cs b/Editor/Shared/Utility/RectUtility.cs index 1ebf2ecd..238637c2 100644 --- a/Editor/Shared/Utility/RectUtility.cs +++ b/Editor/Shared/Utility/RectUtility.cs @@ -1,153 +1,153 @@ -using UnityEngine; +using System; using System.Collections.Generic; +using UnityEngine; namespace Unity.VisualScripting.Community { public static class RectUtility { + public struct SnapLine + { + public Vector2 start; + public Vector2 end; + } + public struct SnapResult { - public bool snapped; + public bool snappedX; + public bool snappedY; public Vector2 snapPosition; - public List snapLines; - - public struct Line - { - public Vector2 start; - public Vector2 end; - } + + public bool hasVerticalLine; + public SnapLine verticalLine; + + public bool hasHorizontalLine; + public SnapLine horizontalLine; + + public bool snapped => snappedX || snappedY; } public static SnapResult CheckSnap(Rect current, List others, float threshold = 5f) { SnapResult result = new SnapResult { - snapped = false, - snapPosition = current.position, - snapLines = new List() + snapPosition = current.position }; - Vector2 newPos = current.position; + float bestXDist = threshold; + float bestYDist = threshold; - SnapResult.Line? closestHorizontalLine = null; - float closestHorizontalDistance = float.MaxValue; + float deltaX = 0f; + float deltaY = 0f; - SnapResult.Line? closestVerticalLine = null; - float closestVerticalDistance = float.MaxValue; + int bestXTargetIdx = -1; + int bestYTargetIdx = -1; + float bestXValue = 0f; + float bestYValue = 0f; - foreach (var target in others) + for (int i = 0; i < others.Count; i++) { + Rect target = others[i]; if (target == current) continue; - float[] currentX = { current.xMin, current.center.x, current.xMax }; - float[] targetX = { target.xMin, target.center.x, target.xMax }; - - for (int ci = 0; ci < currentX.Length; ci++) + for (int ci = 0; ci < 3; ci++) { - for (int ti = 0; ti < targetX.Length; ti++) + float cx = GetXPoint(current, ci); + for (int ti = 0; ti < 3; ti++) { - float cx = currentX[ci]; - float tx = targetX[ti]; + float tx = GetXPoint(target, ti); float dist = Mathf.Abs(cx - tx); - if (dist <= threshold && dist < closestHorizontalDistance) + if (dist < bestXDist) { - closestHorizontalDistance = dist; - float deltaX = tx - cx; - - Rect moved = current; - moved.position += new Vector2(deltaX, 0); - - newPos.x = moved.x; - - float yStart = Mathf.Max(moved.yMin, target.yMin); - float yEnd = Mathf.Min(moved.yMax, target.yMax); - - if (yStart > yEnd) - { - if (moved.center.y < target.center.y) - { - yStart = moved.yMax; - yEnd = target.yMin; - } - else - { - yStart = target.yMax; - yEnd = moved.yMin; - } - } - - closestHorizontalLine = new SnapResult.Line - { - start = new Vector2(tx, yStart), - end = new Vector2(tx, yEnd) - }; + bestXDist = dist; + deltaX = tx - cx; + bestXTargetIdx = i; + bestXValue = tx; } } } - float[] currentY = { current.yMin, current.center.y, current.yMax }; - float[] targetY = { target.yMin, target.center.y, target.yMax }; - - for (int ci = 0; ci < currentY.Length; ci++) + for (int ci = 0; ci < 3; ci++) { - for (int ti = 0; ti < targetY.Length; ti++) + float cy = GetYPoint(current, ci); + for (int ti = 0; ti < 3; ti++) { - float cy = currentY[ci]; - float ty = targetY[ti]; + float ty = GetYPoint(target, ti); float dist = Mathf.Abs(cy - ty); - if (dist <= threshold && dist < closestVerticalDistance) + if (dist < bestYDist) { - closestVerticalDistance = dist; - float deltaY = ty - cy; - - Rect moved = current; - moved.position += new Vector2(0, deltaY); - - newPos.y = moved.y; - - float xStart = Mathf.Max(moved.xMin, target.xMin); - float xEnd = Mathf.Min(moved.xMax, target.xMax); - - if (xStart > xEnd) - { - if (moved.center.x < target.center.x) - { - xStart = moved.xMax; - xEnd = target.xMin; - } - else - { - xStart = target.xMax; - xEnd = moved.xMin; - } - } - - closestVerticalLine = new SnapResult.Line - { - start = new Vector2(xStart, ty), - end = new Vector2(xEnd, ty) - }; + bestYDist = dist; + deltaY = ty - cy; + bestYTargetIdx = i; + bestYValue = ty; } } } } - if (closestHorizontalLine.HasValue) + if (bestXTargetIdx != -1) + { + result.snappedX = true; + result.snapPosition.x += deltaX; + } + + if (bestYTargetIdx != -1) + { + result.snappedY = true; + result.snapPosition.y += deltaY; + } + + result.snapPosition = result.snapPosition.PixelPerfect(); + + Rect snappedRect = new Rect(result.snapPosition, current.size); + + if (bestXTargetIdx != -1) { - result.snapLines.Add(closestHorizontalLine.Value); - result.snapped = true; + Rect target = others[bestXTargetIdx]; + result.hasVerticalLine = true; + + float yMin = Mathf.Min(snappedRect.yMin, target.yMin); + float yMax = Mathf.Max(snappedRect.yMax, target.yMax); + + result.verticalLine = new SnapLine + { + start = new Vector2(bestXValue, yMin), + end = new Vector2(bestXValue, yMax) + }; } - if (closestVerticalLine.HasValue) + if (bestYTargetIdx != -1) { - result.snapLines.Add(closestVerticalLine.Value); - result.snapped = true; + Rect target = others[bestYTargetIdx]; + result.hasHorizontalLine = true; + + float xMin = Mathf.Min(snappedRect.xMin, target.xMin); + float xMax = Mathf.Max(snappedRect.xMax, target.xMax); + + result.horizontalLine = new SnapLine + { + start = new Vector2(xMin, bestYValue), + end = new Vector2(xMax, bestYValue) + }; } - result.snapPosition = newPos.PixelPerfect(); return result; } + + private static float GetXPoint(in Rect r, int index) => index switch + { + 0 => r.xMin, + 1 => r.center.x, + _ => r.xMax + }; + + private static float GetYPoint(in Rect r, int index) => index switch + { + 0 => r.yMin, + 1 => r.center.y, + _ => r.yMax + }; } } \ No newline at end of file diff --git a/Editor/Windows/SurroundWithWindow.cs b/Editor/Windows/SurroundWithWindow.cs index 80d17761..6fa3c556 100644 --- a/Editor/Windows/SurroundWithWindow.cs +++ b/Editor/Windows/SurroundWithWindow.cs @@ -2,16 +2,18 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Reflection; using Unity.VisualScripting.Community.Libraries.Humility; using UnityEditor; using UnityEngine; +using UnityEngine.Assemblies; namespace Unity.VisualScripting.Community { public class SurroundWithWindow : EditorWindow { private static List surroundCommands; - public static Action onCommandSelected {get; private set; } + public static Action onCommandSelected { get; private set; } private bool positionSet; private Vector2 mousePosition; @@ -24,7 +26,14 @@ public static SurroundWithWindow ShowWindow(Action onCommandSel { var window = CreateInstance(); SurroundWithWindow.onCommandSelected = onCommandSelected; - surroundCommands = AppDomain.CurrentDomain.GetAssemblies() + +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else + Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif + + surroundCommands = assemblies .SelectMany(assembly => assembly.GetTypes()) .Where(type => typeof(ISurroundWithCommandBase).IsAssignableFrom(type) && !type.IsAbstract && !type.IsInterface) .ToList(); diff --git a/Editor/Windows/TypeBuilderWindow.cs b/Editor/Windows/TypeBuilderWindow.cs index 06cb12b2..7e96bcb6 100644 --- a/Editor/Windows/TypeBuilderWindow.cs +++ b/Editor/Windows/TypeBuilderWindow.cs @@ -21,14 +21,22 @@ public class TypeBuilderWindow : EditorWindow private Action result; private Action onBeforeChanged; private Action onAfterChanged; - List fakeGenericParameterTypes = new List(); + private List fakeGenericParameterTypes = new List(); + public static TypeBuilderWindow Window { get; private set; } private static Metadata targetMetadata; - private bool canMakeArrayTypeForBaseType; - static GUIStyle popupStyle; - static GUIContent sharedContent = new GUIContent(); + private bool triggerDropdownOnOpen; + + private static GUIStyle popupStyle; + private static readonly GUIContent sharedContent = new GUIContent(); + + private const float DefaultHeight = 320f; + private const float MinWidth = 500f; + private const float MaxWidth = 1000f; + + private static readonly Dictionary<(GenericParameterAttributes, Type[]), Type[]> constraintCache = new Dictionary<(GenericParameterAttributes, Type[]), Type[]>(); public static bool Button(Type type, string nullType = "Select Type", TextAnchor textAnchor = TextAnchor.MiddleLeft, params GUILayoutOption[] options) { @@ -53,16 +61,7 @@ public static void ShowWindow( Action onBeforeChanged = null, Action onAfterChanged = null) { - ShowWindowInternal( - position, - meta, - null, - meta != null ? meta.value as Type : null, - canMakeArray, - types, - null, - onBeforeChanged, - onAfterChanged); + ShowWindowInternal(position, meta, null, meta?.value as Type, canMakeArray, types, null, onBeforeChanged, onAfterChanged); } public static void ShowWindow( @@ -73,16 +72,7 @@ public static void ShowWindow( Action onBeforeChanged = null, Action onAfterChanged = null) { - ShowWindowInternal( - position, - meta, - null, - meta != null ? meta.value as Type : null, - canMakeArray, - Array.Empty(), - fakeGenericParameterTypes, - onBeforeChanged, - onAfterChanged); + ShowWindowInternal(position, meta, null, meta?.value as Type, canMakeArray, Array.Empty(), fakeGenericParameterTypes, onBeforeChanged, onAfterChanged); } public static void ShowWindow(Rect position, Action result, Type currentType, bool canMakeArray = true, Type[] types = null, Action onBeforeChanged = null, Action onAfterChanged = null) @@ -91,12 +81,12 @@ public static void ShowWindow(Rect position, Action result, Type currentTy } public static void ShowWindow(Rect position, Action result, Type currentType, bool canMakeArray = true, - List fakeGenericParameterTypes = null, Action onBeforeChanged = null, Action onAfterChanged = null) + List fakeGenericParameterTypes = null, Action onBeforeChanged = null, Action onAfterChanged = null) { ShowWindowInternal(position, null, result, currentType, canMakeArray, Array.Empty(), fakeGenericParameterTypes, onBeforeChanged, onAfterChanged); } - static void ShowWindowInternal(Rect position, Metadata meta, Action result, Type currentType, bool canMakeArray, Type[] types, List fakeGenerics, Action onBeforeChanged, Action onAfterChanged) + private static void ShowWindowInternal(Rect position, Metadata meta, Action result, Type currentType, bool canMakeArray, Type[] types, List fakeGenerics, Action onBeforeChanged, Action onAfterChanged) { var window = GetWindow(); @@ -113,7 +103,7 @@ static void ShowWindowInternal(Rect position, Metadata meta, Action result ConfigureWindow(window, position, currentType, types, canMakeArray, onBeforeChanged, onAfterChanged); } - static TypeBuilderWindow GetWindow() + private static TypeBuilderWindow GetWindow() { if (Window == null) { @@ -122,14 +112,16 @@ static TypeBuilderWindow GetWindow() return Window; } - static Type[] MergeAssemblyTypes(IEnumerable extra) + private static Type[] MergeAssemblyTypes(IEnumerable extra) { var baseTypes = Codebase.settingsAssembliesTypes; - var result = new List(baseTypes.Count + 4); + var result = new List(baseTypes.Count + 4) + { + typeof(void), + typeof(Libraries.CSharp.Void) + }; result.AddRange(baseTypes); - result.Add(typeof(void)); - result.Add(typeof(Libraries.CSharp.Void)); if (extra != null) result.AddRange(extra); @@ -137,7 +129,7 @@ static Type[] MergeAssemblyTypes(IEnumerable extra) return result.ToArray(); } - static Type[] FilterBaseTypes(Type[] source) + private static Type[] FilterBaseTypes(Type[] source) { var list = new List(source.Length); for (int i = 0; i < source.Length; i++) @@ -148,10 +140,6 @@ static Type[] FilterBaseTypes(Type[] source) } return list.ToArray(); } - const float DefaultHeight = 320f; - const float MinWidth = 500f; - const float MaxWidth = 1000f; - private bool triggerDropdownOnOpen = false; private static void ConfigureWindow(TypeBuilderWindow window, Rect position, Type type, Type[] types, bool canMakeArray, Action onBeforeChanged, Action onAfterChanged) { @@ -188,7 +176,6 @@ private static void ConfigureWindow(TypeBuilderWindow window, Rect position, Typ private void OnEnable() { triggerDropdownOnOpen = true; - minSize = new Vector2(MinWidth, MaxWidth); titleContent = new GUIContent("Type Builder"); @@ -196,50 +183,40 @@ private void OnEnable() baseTypeLookup = FilterBaseTypes(settingAssemblyTypesLookup); } - private IFuzzyOptionTree GetBaseTypeOptions() - { - return new TypeBuilderTypeOptionTree(customTypeLookup ?? baseTypeLookup); - } + private IFuzzyOptionTree GetBaseTypeOptions() => new TypeBuilderTypeOptionTree(customTypeLookup ?? baseTypeLookup); private IFuzzyOptionTree GetNestedTypeOptions(GenericParameter parameter) { var constrainedTypes = GetConstrainedTypes(parameter); - if (parameter != null && parameter.type.type.IsArray && !constrainedTypes.Contains(parameter.type.type)) constrainedTypes.Append(parameter.type.type); + if (parameter?.type.type != null && parameter.type.type.IsArray && !constrainedTypes.Contains(parameter.type.type)) + { + constrainedTypes = constrainedTypes.Append(parameter.type.type).ToArray(); + } return new TypeBuilderTypeOptionTree(constrainedTypes); } - private Type[] GetConstrainedTypes(GenericParameter genericParameter) + private Type[] GetConstrainedTypes(GenericParameter parameter) { - if (genericParameter.constraints == null && (genericParameter.type.type.IsGenericParameter || genericParameter.type.type is FakeGenericParameterType)) + if (parameter.constraints == null && (parameter.type.type.IsGenericParameter || parameter.type.type is FakeGenericParameterType)) { - var constraints = genericParameter.type.type.GetGenericParameterConstraints(); + var constraints = parameter.type.type.GetGenericParameterConstraints(); if (constraints.Length > 0) { - var constrainedTypes = settingAssemblyTypesLookup - .AsParallel() + parameter.constraints = settingAssemblyTypesLookup .Where(candidateType => constraints.All(constraint => constraint.IsAssignableFrom(candidateType))) .ToArray(); - - genericParameter.constraints = constrainedTypes; - return constrainedTypes; } else { - var attributes = genericParameter.type.type.GenericParameterAttributes; - var constrainedTypes = GetConstraintAttributeTypes(attributes, - !genericParameter.HasParent && customTypeLookup != null - ? customTypeLookup - : settingAssemblyTypesLookup); - - genericParameter.constraints = constrainedTypes; - return constrainedTypes; + var attributes = parameter.type.type.GenericParameterAttributes; + var typesSource = !parameter.HasParent && customTypeLookup != null ? customTypeLookup : settingAssemblyTypesLookup; + parameter.constraints = GetConstraintAttributeTypes(attributes, typesSource); } } - return genericParameter.constraints; + return parameter.constraints; } - private static readonly Dictionary<(GenericParameterAttributes, Type[]), Type[]> constraintCache = new Dictionary<(GenericParameterAttributes, Type[]), Type[]>(); public Type[] GetConstraintAttributeTypes(GenericParameterAttributes attributes, Type[] typesLookup) { var key = (attributes, typesLookup); @@ -251,11 +228,8 @@ public Type[] GetConstraintAttributeTypes(GenericParameterAttributes attributes, var constrainedTypes = typesLookup .Where(candidateType => ((attributes & GenericParameterAttributes.ReferenceTypeConstraint) == 0 || candidateType.IsClass) && - ((attributes & GenericParameterAttributes.NotNullableValueTypeConstraint) == 0 || - (!candidateType.IsNullable() || candidateType.IsStruct())) && - ((attributes & GenericParameterAttributes.DefaultConstructorConstraint) == 0 || - candidateType.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic) - .Any(constructor => constructor.GetParameters().Length == 0)) && + ((attributes & GenericParameterAttributes.NotNullableValueTypeConstraint) == 0 || (!candidateType.IsNullable() || candidateType.IsStruct())) && + ((attributes & GenericParameterAttributes.DefaultConstructorConstraint) == 0 || candidateType.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic).Any(c => c.GetParameters().Length == 0)) && !NameUtility.TypeHasSpecialName(candidateType)) .ToArray(); @@ -265,37 +239,36 @@ public Type[] GetConstraintAttributeTypes(GenericParameterAttributes attributes, private void OnGUI() { - if (Event.current.type == EventType.KeyUp && Event.current.keyCode == KeyCode.Escape) + if (Event.current.type == EventType.KeyUp && Event.current.keyCode == KeyCode.Escape && !IsMouseOverWindow()) { - if (!IsMouseOverWindow()) - { - Close(); - } + Close(); + return; } + HUMEditor.Vertical().Box(HUMEditorColor.DefaultEditorBackground.Darken(0.1f), Color.black, new RectOffset(4, 4, 4, 4), new RectOffset(2, 2, 2, 2), () => { scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition, GUILayout.ExpandWidth(false)); + HUMEditor.Vertical().Box(HUMEditorColor.DefaultEditorBackground, Color.black, new RectOffset(4, 4, 4, 4), new RectOffset(2, 2, 0, 2), () => { EditorGUILayout.LabelField(new GUIContent("Type Builder", typeof(Type).Icon()?[IconSize.Small], "A tool to create and customize types beyond the standard Type Field capabilities"), LudiqStyles.centeredLabel); - var labelWidth = GUI.skin.label.CalcSize(new GUIContent("Select Type")).x; }); - GUIContent inheritButtonContent = new GUIContent( + var inheritButtonContent = new GUIContent( baseType?.As().CSharpName(false, false, false) ?? "Select Type", baseType.GetTypeIcon() ); lastRect = GUILayoutUtility.GetLastRect(); - var buttonWidth = GUI.skin.button.CalcSize(inheritButtonContent).x; - var buttonRect = DrawTypeField(inheritButtonContent, genericParameter, true); + if (triggerDropdownOnOpen && Event.current.type == EventType.Repaint) { triggerDropdownOnOpen = false; TriggerDropdown(buttonRect); } - if (genericParameter != null && genericParameter.type.type.IsGenericType || GetArrayBase(genericParameter.type.type).IsGenericType) + + if (genericParameter != null && (genericParameter.type.type.IsGenericType || GetArrayBase(genericParameter.type.type).IsGenericType)) { var index = 0; foreach (var param in genericParameter.nestedParameters) @@ -306,200 +279,120 @@ private void OnGUI() } EditorGUILayout.EndScrollView(); - var isValid = IsValidType(baseType, true); + + var isValid = IsValidType(baseType); EditorGUI.BeginDisabledGroup(!isValid); - if (!isValid) + + if (!isValid && baseType != null) { - if (baseType != null) - EditorGUILayout.HelpBox($"Can not create arrays of Open Generics, e.g {baseType.As().CSharpName(false, false, false).RemoveHighlights().RemoveMarkdown()} is invalid it has to have a types set for {string.Join(", ", GetInvalidParameters(baseType))}", MessageType.Error); + EditorGUILayout.HelpBox($"Cannot create partially constructed types, e.g. {baseType.As().CSharpName(false, false, false)} is invalid. Types must be set for: {string.Join(", ", GetInvalidParameters(baseType))}", MessageType.Error); } + var e = Event.current; - if (GUILayout.Button("Create Type") || (isValid && e != null && focusedWindow == this && e.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Return)) + if (GUILayout.Button("Create Type") || (isValid && e != null && focusedWindow == this && e.type == EventType.KeyDown && e.keyCode == KeyCode.Return)) { if (targetMetadata != null) ConstructType(targetMetadata); else ConstructType(); + genericParameter.Clear(); Close(); } EditorGUI.EndDisabledGroup(); }); } + private void TriggerDropdown(Rect buttonRect) { int selectedIndex = Array.IndexOf(customTypeLookup ?? baseTypeLookup, typeof(object)); - Type _selected = null; LudiqGUI.FuzzyDropdown(buttonRect, GetBaseTypeOptions(), selectedIndex, (type) => { - _selected = (type as TypeBuilderType).Type; - var genericParams = new GenericParameter(genericParameter, _selected, _selected.Name); - baseType = _selected; + var selectedType = (type as TypeBuilderType).Type; + var genericParams = new GenericParameter(genericParameter, selectedType, selectedType.Name); + baseType = selectedType; genericParameter?.Clear(); - genericParams.AddGenericParameters(_selected); + genericParams.AddGenericParameters(selectedType); genericParameter = genericParams; }); } - private bool IsMouseOverWindow() - { - return position.Contains(GUIUtility.GUIToScreenPoint(Event.current.mousePosition)); - } - private Type GetArrayBase(Type type) + private bool IsMouseOverWindow() => position.Contains(GUIUtility.GUIToScreenPoint(Event.current.mousePosition)); + + private static Type GetArrayBase(Type type) { - if (type.IsArray) + while (type != null && type.IsArray) { type = type.GetElementType(); - while (type.IsArray) - { - type = type.GetElementType(); - } - return type; } return type; } - private IEnumerable GetInvalidParameters(Type type) { - if (type.IsArray) + if (type == null || !type.ContainsGenericParameters) + yield break; + + var current = GetArrayBase(type); + + if (current.IsGenericParameter) { - type = GetArrayBase(type); + yield return current.Name; + yield break; } - foreach (var arg in type.GetGenericArguments()) + + if (current.IsGenericType) { - if (arg.IsGenericParameter) - { - yield return arg.Name; - } - else if (arg.IsGenericType) - { - foreach (var invalidArg in GetInvalidParameters(arg)) - { - yield return invalidArg; - } - } - else if (arg.IsArray) + foreach (var arg in current.GetGenericArguments()) { - var baseType = GetArrayBase(arg); - if (baseType.IsGenericParameter) - { - yield return baseType.Name; - } - else if (baseType.IsGenericType) + foreach (var invalid in GetInvalidParameters(arg)) { - foreach (var invalidArg in GetInvalidParameters(baseType)) - { - yield return invalidArg; - } + yield return invalid; } } } } - private bool IsValidType(Type type, bool checkingNested) + private bool IsValidType(Type type) { - if (type == null) - { - return false; - } - - if (type.IsArray) - { - var elementType = GetArrayBase(type); - - if (elementType.IsGenericType) - { - var genericArguments = elementType.GetGenericArguments(); - foreach (var arg in genericArguments) - { - if (arg.IsGenericParameter) - { - return false; - } - if (!IsValidType(arg, true)) - { - return false; - } - } - } - return IsValidType(elementType, true); - } - else if (checkingNested) - { - if (type.IsArray) - { - var elementType = GetArrayBase(type); - if (elementType.IsGenericType) - { - var genericArguments = elementType.GetGenericArguments(); - foreach (var arg in genericArguments) - { - if (arg.IsGenericParameter) - { - return false; - } - if (!IsValidType(arg, true)) - { - return false; - } - } - } - return IsValidType(elementType, true); - } - else if (type.IsGenericType) - { - var genericArguments = type.GetGenericArguments(); - foreach (var arg in genericArguments) - { - if (arg.IsGenericParameter) - { - return false; - } - if (!IsValidType(arg, true)) - { - return false; - } - } - } - } - return true; + var elementType = GetArrayBase(type); + return elementType != null && !elementType.ContainsGenericParameters; } private Rect DrawTypeField(GUIContent buttonContent, GenericParameter generic, bool isBaseType) { GUILayout.BeginHorizontal(); - Rect buttonRect = new Rect(); + var buttonRect = new Rect(); + if (GUILayout.Button(buttonContent, GUILayout.MaxHeight(19f))) { buttonRect = lastRect; - int selectedIndex = Array.IndexOf(isBaseType && customTypeLookup != null ? customTypeLookup : baseTypeLookup, generic != null ? generic.type.type : typeof(object)); - Type _selected = null; + var lookupSource = isBaseType && customTypeLookup != null ? customTypeLookup : baseTypeLookup; + int selectedIndex = Array.IndexOf(lookupSource, generic?.type.type ?? typeof(object)); + LudiqGUI.FuzzyDropdown(lastRect, isBaseType ? GetBaseTypeOptions() : GetNestedTypeOptions(generic), selectedIndex, (type) => { - _selected = (type as TypeBuilderType).Type; + var selectedType = (type as TypeBuilderType).Type; if (isBaseType) { - var genericParams = new GenericParameter(generic, _selected, _selected.Name); - baseType = _selected; + var genericParams = new GenericParameter(generic, selectedType, selectedType.Name); + baseType = selectedType; genericParameter?.Clear(); - genericParams.AddGenericParameters(_selected); + genericParams.AddGenericParameters(selectedType); genericParameter = genericParams; } else { generic.Clear(); - generic.AddGenericParameters(_selected); - generic.selectedType.type = _selected; - generic.type.type = _selected; + generic.AddGenericParameters(selectedType); + generic.selectedType.type = selectedType; + generic.type.type = selectedType; generic.parent.type.type = generic.parent.ConstructType(); baseType = genericParameter.ConstructType(); } }); } - bool canMakeArray = generic != null - && generic.type.type != null - && !generic.type.type.IsGenericParameter - && CanTypeSupportArray(isBaseType ? genericParameter : generic); + + bool canMakeArray = generic?.type.type != null && !generic.type.type.IsGenericParameter && CanTypeSupportArray(isBaseType ? genericParameter : generic); if (canMakeArray && ((isBaseType && canMakeArrayTypeForBaseType) || (!isBaseType && !generic.type.type.IsGenericParameter))) { @@ -522,22 +415,16 @@ private Rect DrawTypeField(GUIContent buttonContent, GenericParameter generic, b } else if (GUILayout.Button("-")) { - if (isBaseType && genericParameter != null) + if (isBaseType && genericParameter != null && (baseType.IsArray || baseType is FakeGenericParameterType { IsArray: true })) { - if (baseType.IsArray || (baseType is FakeGenericParameterType fakeGenericParameterType && fakeGenericParameterType.IsArray)) - { - baseType = baseType.GetElementType(); - genericParameter.type.type = baseType; - } + baseType = baseType.GetElementType(); + genericParameter.type.type = baseType; } - else + else if (!isBaseType && (generic.type.type.IsArray || generic.type.type is FakeGenericParameterType { IsArray: true })) { - if (generic.type.type.IsArray || (generic.type.type is FakeGenericParameterType fakeGenericParameterType && fakeGenericParameterType.IsArray)) - { - generic.type.type = generic.type.type.GetElementType(); - generic.parent.type.type = generic.parent.ConstructType(); - baseType = genericParameter.ConstructType(); - } + generic.type.type = generic.type.type.GetElementType(); + generic.parent.type.type = generic.parent.ConstructType(); + baseType = genericParameter.ConstructType(); } } GUILayout.EndHorizontal(); @@ -549,19 +436,11 @@ private Rect DrawTypeField(GUIContent buttonContent, GenericParameter generic, b private bool CanTypeSupportArray(GenericParameter param) { - if (param == null || param.type.type == null) return false; - - if (param.type.type == typeof(void)) return false; + if (param?.type.type == null || param.type.type == typeof(void)) return false; if (param.constraints != null && param.constraints.Length > 0) { - foreach (var constraint in param.constraints) - { - if (constraint.IsAssignableFrom(typeof(Array)) || constraint.IsAssignableFrom(param.type.type.MakeArrayType())) - return true; - } - - return false; + return param.constraints.Any(constraint => constraint.IsAssignableFrom(typeof(Array)) || constraint.IsAssignableFrom(param.type.type.MakeArrayType())); } return true; @@ -578,99 +457,77 @@ private void DrawGenericParameter(GenericParameter parameter, Type genericParam) { GUILayout.BeginHorizontal(); GUILayout.Label(genericParam.As().CSharpName(false, false, false), GUILayout.Width(150)); - GUIContent typeButtonContent = new GUIContent(parameter.type.type?.As().CSharpName(false, false, false) ?? "Select Type", parameter.type.type?.GetTypeIcon()); + var typeButtonContent = new GUIContent(parameter.type.type?.As().CSharpName(false, false, false) ?? "Select Type", parameter.type.type?.GetTypeIcon()); DrawTypeField(typeButtonContent, parameter, false); GUILayout.EndHorizontal(); - var index = 0; - foreach (var nested in parameter.nestedParameters) + var type = GetArrayBase(parameter.type.type); + + if (!type.IsGenericType) + return; + + var genericArguments = type.GetGenericTypeDefinition().GetGenericArguments(); + + for (int i = 0; i < parameter.nestedParameters.Count; i++) { - DrawGenericParameter(nested, parameter.type.type.GetGenericTypeDefinition().GetGenericArguments()[index]); - index++; + var nested = parameter.nestedParameters[i]; + + DrawGenericParameter(nested, genericArguments[i]); } }); }); } - public static void ConstructType() + public static void ConstructType() => ConstructTypeInternal(null); + + public static void ConstructType(Metadata metadata) => ConstructTypeInternal(metadata); + + private static void ConstructTypeInternal(Metadata metadata) { - UndoUtility.RecordEditedObject("TypeBuilder Constructed Type"); - Window.onBeforeChanged?.Invoke(); - genericParameter ??= GenericParameter.Create(typeof(object), typeof(object).DisplayName()); - Type constructedType; - if (genericParameter.type.type.IsGenericType && genericParameter.type.type.IsConstructedGenericType) + if (metadata != null) { - var newConstructedType = new GenericParameter(genericParameter, true); - constructedType = newConstructedType.ConstructType(); - Window.result?.Invoke(constructedType); - } - else if (genericParameter.type.type.IsArray) - { - var tempType = genericParameter.type.type.GetElementType(); - while (tempType.IsArray) - { - tempType = tempType.GetElementType(); - } - - if (tempType.IsGenericType && tempType.IsConstructedGenericType) - { - var newConstructedType = new GenericParameter(genericParameter, true); - constructedType = newConstructedType.ConstructType(); - Window.result?.Invoke(constructedType); - } - else - { - constructedType = genericParameter.ConstructType(); - Window.result?.Invoke(constructedType); - } + metadata.RecordUndo(); } else { - constructedType = genericParameter.ConstructType(); - Window.result?.Invoke(constructedType); + UndoUtility.RecordEditedObject("TypeBuilder Constructed Type"); } - Window.onAfterChanged?.Invoke(constructedType); - } - public static void ConstructType(Metadata metadata) - { - metadata.RecordUndo(); Window.onBeforeChanged?.Invoke(); genericParameter ??= GenericParameter.Create(typeof(object), typeof(object).DisplayName()); + Type constructedType; - if (genericParameter.type.type.IsGenericType && genericParameter.type.type.IsConstructedGenericType) - { - var newConstructedType = new GenericParameter(genericParameter, true); - constructedType = newConstructedType.ConstructType(); - metadata.value = constructedType; - } - else if (genericParameter.type.type.IsArray) - { - var tempType = genericParameter.type.type.GetElementType(); - while (tempType.IsArray) - { - tempType = tempType.GetElementType(); - } + var currentType = genericParameter.type.type; - if (tempType.IsGenericType && tempType.IsConstructedGenericType) + if ((currentType.IsGenericType && currentType.IsConstructedGenericType) || currentType.IsArray) + { + var tempType = GetArrayBase(currentType); + if ((tempType != null && tempType.IsGenericType && tempType.IsConstructedGenericType) || currentType.IsGenericType) { var newConstructedType = new GenericParameter(genericParameter, true); constructedType = newConstructedType.ConstructType(); - metadata.value = constructedType; } else { constructedType = genericParameter.ConstructType(); - metadata.value = constructedType; } } else { constructedType = genericParameter.ConstructType(); + } + + if (metadata != null) + { metadata.value = constructedType; } + else + { + Window.result?.Invoke(constructedType); + } + Window.onAfterChanged?.Invoke(constructedType); } } diff --git a/Editor/Windows/UtilityWindow.cs b/Editor/Windows/UtilityWindow.cs index c553c59c..30cb8503 100644 --- a/Editor/Windows/UtilityWindow.cs +++ b/Editor/Windows/UtilityWindow.cs @@ -11,7 +11,7 @@ public class UtilityWindow : EditorWindow private BorderedRectangle container; public static Event e; - public GraphContext graphContext; + public IGraphContext graphContext; public static UtilityWindow Open() { diff --git a/Editor/Windows/View/EditorWindowView.cs b/Editor/Windows/View/EditorWindowView.cs index 5c5aaa08..2e305608 100644 --- a/Editor/Windows/View/EditorWindowView.cs +++ b/Editor/Windows/View/EditorWindowView.cs @@ -45,6 +45,7 @@ public static EditorWindowView CreateWindow(EditorWindowAsset windowType, bool s [SerializeField] public CustomVariables variables = new CustomVariables(); + [NonSerialized] public VisualElement container; public Event e { get; private set; } diff --git a/Runtime/Code/AttributeDeclaration.cs b/Runtime/Code/AttributeDeclaration.cs index 84006faf..db0b62de 100644 --- a/Runtime/Code/AttributeDeclaration.cs +++ b/Runtime/Code/AttributeDeclaration.cs @@ -19,6 +19,7 @@ public class AttributeDeclaration : ISerializationCallbackReceiver [SerializeField] public List parameters = new List(); [Serialize] + [NonSerialized] public Dictionary fields = new Dictionary(); [Serialize] private SerializationData fieldsSerialization; diff --git a/Runtime/Code/ClassAsset.cs b/Runtime/Code/ClassAsset.cs index cea0f43d..ce84f10e 100644 --- a/Runtime/Code/ClassAsset.cs +++ b/Runtime/Code/ClassAsset.cs @@ -25,6 +25,7 @@ public class ClassAsset : MemberTypeAsset onValueChanged; [InspectorWide] + [NonSerialized] public List typeParameters = new List(); [SerializeField] diff --git a/Runtime/Code/ClassFieldDeclaration.cs b/Runtime/Code/ClassFieldDeclaration.cs index 4a82e0a2..3c26604f 100644 --- a/Runtime/Code/ClassFieldDeclaration.cs +++ b/Runtime/Code/ClassFieldDeclaration.cs @@ -18,6 +18,7 @@ public sealed class ClassFieldDeclaration : FieldDeclaration, ISerializationCall #endif [InspectorToggleLeft] [Serialize] + [NonSerialized] public object defaultValue = 0; [Inspectable] diff --git a/Runtime/Code/CodeAsset.cs b/Runtime/Code/CodeAsset.cs index a653ca38..d4ee98de 100644 --- a/Runtime/Code/CodeAsset.cs +++ b/Runtime/Code/CodeAsset.cs @@ -21,6 +21,7 @@ public abstract class CodeAsset : ScriptableObject public List lastCompiledNames = new List(); [FullSerializer.fsProperty(Converter = typeof(FakeGenericParameterTypeConverter))] + [NonSerialized] public Type AssetType; #if UNITY_EDITOR diff --git a/Runtime/Code/FieldDeclaration.cs b/Runtime/Code/FieldDeclaration.cs index f9c1359a..7978903c 100644 --- a/Runtime/Code/FieldDeclaration.cs +++ b/Runtime/Code/FieldDeclaration.cs @@ -12,9 +12,12 @@ namespace Unity.VisualScripting.Community public abstract class FieldDeclaration : ScriptableObject { [Inspectable] + [NonSerialized] public Type type = typeof(int); [Inspectable] + [NonSerialized] + [Serialize] public object value; public string FieldName; diff --git a/Runtime/Code/FunctionNode.cs b/Runtime/Code/FunctionNode.cs index 291843a1..5f0778c1 100644 --- a/Runtime/Code/FunctionNode.cs +++ b/Runtime/Code/FunctionNode.cs @@ -6,7 +6,6 @@ namespace Unity.VisualScripting.Community { - [Serializable] [UnitTitle("Function")] [SpecialUnit] [RenamedFrom("Bolt.Addons.Community.Code.FunctionUnit")] diff --git a/Runtime/Code/Generation/CodeWriter/CodeWriter.cs b/Runtime/Code/Generation/CodeWriter/CodeWriter.cs index 35e9ac8e..9c5b56f3 100644 --- a/Runtime/Code/Generation/CodeWriter/CodeWriter.cs +++ b/Runtime/Code/Generation/CodeWriter/CodeWriter.cs @@ -7,6 +7,7 @@ using Unity.VisualScripting.Community.Libraries.CSharp; using Unity.VisualScripting.Community.Libraries.Humility; using UnityEngine; +using UnityEngine.Assemblies; namespace Unity.VisualScripting.Community { @@ -163,6 +164,21 @@ public CodeWriter WriteIndented(string text = "") return this; } + public CodeWriter WriteIndented(string text, int amount = 1) + { + var oldIndent = IndentLevel; + try + { + Indent(amount); + + return WriteIndented(text); + } + finally + { + IndentLevel = oldIndent; + } + } + public CodeWriter WriteLine(string text = "") { if (IsRecordingSuppressed) @@ -494,9 +510,11 @@ public static void BuildAmbiguityCache() if (cached) return; Dictionary> map = new Dictionary>(); - +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); - +#endif for (int a = 0; a < assemblies.Length; a++) { Type[] types; @@ -554,7 +572,9 @@ public enum WriteOptions NewLineBefore = 1 << 1, NewLineAfter = 1 << 2, NewLineBeforeAndAfter = NewLineBefore | NewLineAfter, - IndentedNewLineAfter = Indented | NewLineAfter + IndentedNewLineBefore = Indented | NewLineBefore, + IndentedNewLineAfter = Indented | NewLineAfter, + IndentedNewLineAfterAndBefore = Indented | NewLineBeforeAndAfter } [Flags] diff --git a/Runtime/Code/MethodDeclaration.cs b/Runtime/Code/MethodDeclaration.cs index a0aa649f..2d4f7501 100644 --- a/Runtime/Code/MethodDeclaration.cs +++ b/Runtime/Code/MethodDeclaration.cs @@ -23,6 +23,7 @@ public abstract class MethodDeclaration : Macro, IGenericContainer Nested = true, NonPublic = false, NonSerializable = true, Object = true, Obsolete = false, OpenConstructedGeneric = false, Primitives = true, Public = true, Reference = true, Sealed = true, Static = false, Structs = true, Value = true)] [FullSerializer.fsProperty(Converter = typeof(FakeGenericParameterTypeConverter))] + [NonSerialized] public Type returnType = typeof(Libraries.CSharp.Void); [SerializeField] @@ -31,6 +32,7 @@ public abstract class MethodDeclaration : Macro, IGenericContainer public int genericParameterCount => genericParameters.Count; + [NonSerialized] public List genericParameters = new List(); /// diff --git a/Runtime/Code/Utility/CodeGeneratorValueUtility.cs b/Runtime/Code/Utility/CodeGeneratorValueUtility.cs index 38ca0bad..b7eaa06f 100644 --- a/Runtime/Code/Utility/CodeGeneratorValueUtility.cs +++ b/Runtime/Code/Utility/CodeGeneratorValueUtility.cs @@ -67,7 +67,11 @@ public SerializableKeyValuePair(string key, string value) private class SerializableValueHandler { public string targetGuid; +#if UNITY_6000_5_OR_NEWER + public EntityId targetEntityID; +#else public int targetInstanceID; +#endif public string scenePath; public List assetValues = new List(); public List sceneObjectValues = new List(); @@ -88,12 +92,23 @@ private static string GetScenePath(Object obj) { if (obj is GameObject go) { +#if UNITY_6000_5_OR_NEWER + return EntityId.ToULong(go.GetEntityId()).ToString(); +#elif UNITY_6000_4_OR_NEWER + return go.GetEntityId().ToString(); +#else return go.GetInstanceID().ToString(); +#endif } else if (obj is Component comp) { - // Add component type to make path unique for different components +#if UNITY_6000_5_OR_NEWER + return EntityId.ToULong(comp.gameObject.GetEntityId()).ToString() + "," + EntityId.ToULong(comp.GetEntityId()).ToString() + "," + comp.GetType().FullName; +#elif UNITY_6000_4_OR_NEWER + return comp.gameObject.GetEntityId().ToString() + "," + comp.GetEntityId().ToString() + "," + comp.GetType().FullName; +#else return comp.gameObject.GetInstanceID().ToString() + "," + comp.GetInstanceID().ToString() + "," + comp.GetType().FullName; +#endif } return null; } @@ -108,7 +123,15 @@ private static void SaveValues() continue; var handler = new SerializableValueHandler(); + +#if UNITY_6000_5_OR_NEWER + handler.targetEntityID = kvp.Key.GetEntityId(); +#elif UNITY_6000_4_OR_NEWER + handler.targetInstanceID = kvp.Key.GetEntityId(); +#else handler.targetInstanceID = kvp.Key.GetInstanceID(); +#endif + handler.scenePath = GetScenePath(kvp.Key); foreach (var valueKvp in kvp.Value) @@ -169,18 +192,41 @@ private static void LoadValues() if (handler.scenePath.Contains(',')) { var split = handler.scenePath.Split(','); - var instanceID = int.Parse(split[0]); - var go = EditorUtility.InstanceIDToObject(instanceID) as GameObject; +#if UNITY_6000_5_OR_NEWER + var goEntityId = EntityId.FromULong(ulong.Parse(split[0])); + var go = EditorUtility.EntityIdToObject(goEntityId) as GameObject; +#elif UNITY_6000_3_OR_NEWER + var ID = int.Parse(split[0]); + var go = EditorUtility.EntityIdToObject(ID) as GameObject; +#else + var ID = int.Parse(split[0]); + var go = EditorUtility.InstanceIDToObject(ID) as GameObject; +#endif if (go != null) { target = go.GetComponents() - .FirstOrDefault(c => c != null && c.GetInstanceID() == int.Parse(split[1])); + .FirstOrDefault(c => c != null && +#if UNITY_6000_5_OR_NEWER + c.GetEntityId() == EntityId.FromULong(ulong.Parse(split[1]))); +#elif UNITY_6000_4_OR_NEWER + c.GetEntityId() == int.Parse(split[1])); +#else + c.GetInstanceID() == int.Parse(split[1])); +#endif } } else { - var instanceID = int.Parse(handler.scenePath); - target = EditorUtility.InstanceIDToObject(instanceID) as GameObject; +#if UNITY_6000_5_OR_NEWER + var goEntityId = EntityId.FromULong(ulong.Parse(handler.scenePath)); + target = EditorUtility.EntityIdToObject(goEntityId) as GameObject; +#elif UNITY_6000_3_OR_NEWER + var ID = int.Parse(handler.scenePath); + target = EditorUtility.EntityIdToObject(ID) as GameObject; +#else + var ID = int.Parse(handler.scenePath); + target = EditorUtility.InstanceIDToObject(ID) as GameObject; +#endif } } @@ -206,18 +252,41 @@ private static void LoadValues() if (pair.value.Contains(',')) { var split = pair.value.Split(','); - var instanceID = int.Parse(split[0]); - var go = EditorUtility.InstanceIDToObject(instanceID) as GameObject; +#if UNITY_6000_5_OR_NEWER + var goEntityId = EntityId.FromULong(ulong.Parse(split[0])); + var go = EditorUtility.EntityIdToObject(goEntityId) as GameObject; +#elif UNITY_6000_3_OR_NEWER + var ID = int.Parse(split[0]); + var go = EditorUtility.EntityIdToObject(ID) as GameObject; +#else + var ID = int.Parse(split[0]); + var go = EditorUtility.InstanceIDToObject(ID) as GameObject; +#endif if (go != null) { sceneValue = go.GetComponents() - .FirstOrDefault(c => c.GetInstanceID() == int.Parse(split[1])); + .FirstOrDefault(c => c != null && +#if UNITY_6000_5_OR_NEWER + c.GetEntityId() == EntityId.FromULong(ulong.Parse(split[1]))); +#elif UNITY_6000_4_OR_NEWER + c.GetEntityId() == int.Parse(split[1])); +#else + c.GetInstanceID() == int.Parse(split[1])); +#endif } } else { - var instanceID = int.Parse(pair.value); - sceneValue = EditorUtility.InstanceIDToObject(instanceID); +#if UNITY_6000_5_OR_NEWER + var goEntityId = EntityId.FromULong(ulong.Parse(pair.value)); + sceneValue = EditorUtility.EntityIdToObject(goEntityId) as GameObject; +#elif UNITY_6000_3_OR_NEWER + var ID = int.Parse(pair.value); + sceneValue = EditorUtility.EntityIdToObject(ID) as GameObject; +#else + var ID = int.Parse(pair.value); + sceneValue = EditorUtility.InstanceIDToObject(ID) as GameObject; +#endif } if (sceneValue != null && !valueDict.ContainsValue(sceneValue)) @@ -267,9 +336,7 @@ private static Object EnsureCurrentAsset(Object shouldBe = null) return null; #endif } - /// - /// Used to communicate with the CodeGenerator to get the current scriptmachine from the target object. - /// + public static System.Func requestMachine; public static Object currentAsset; public static void SetIsUsed(string variableName) @@ -329,6 +396,7 @@ public static bool TryGetVariable(Object value, out string variableName) variableName = ""; return false; } + public static Dictionary GetAllValues(Object target, bool clearObsolete = true) { EnsureCurrentAsset(target); @@ -339,6 +407,7 @@ public static Dictionary GetAllValues(Object target, bool clearO return ObjectValueHandlers[target]; else return new Dictionary(); } + public static void RemoveObsoleteValues(Object target) { EnsureLoaded(); diff --git a/Runtime/Community Options/CommunityOptionFetcher.cs b/Runtime/Community Options/CommunityOptionFetcher.cs index d84a4281..6a8ba635 100644 --- a/Runtime/Community Options/CommunityOptionFetcher.cs +++ b/Runtime/Community Options/CommunityOptionFetcher.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using UnityEngine; +using UnityEngine.Assemblies; namespace Unity.VisualScripting.Community { @@ -17,7 +18,11 @@ static CommunityOptionFetcher() lock (lockObject) { var type = typeof(CommunityOptions); +#if UNITY_6000_4_OR_NEWER + var types = CurrentAssemblies.GetLoadedAssemblies() +#else var types = AppDomain.CurrentDomain.GetAssemblies() +#endif .SelectMany(s => s.GetTypes()) .Where(p => { diff --git a/Runtime/Graph Snippets/GraphSnippet.cs b/Runtime/Graph Snippets/GraphSnippet.cs index a1e64f0c..d7360074 100644 --- a/Runtime/Graph Snippets/GraphSnippet.cs +++ b/Runtime/Graph Snippets/GraphSnippet.cs @@ -38,6 +38,7 @@ public class SnippetArgument [Inspectable] [TypeFilter(TypesMatching.Any, typeof(string), typeof(int), typeof(float), typeof(double), typeof(decimal), typeof(bool), typeof(char), typeof(byte), typeof(sbyte), typeof(short), typeof(ushort), typeof(uint), typeof(long), typeof(ulong), typeof(LayerMask))] [TypeSet(TypeSet.SettingsAssembliesTypes)] + [NonSerialized] public Type argumentType = typeof(string); } } diff --git a/Runtime/Nodes/Events/Nodes/EveryXSeconds.cs b/Runtime/Nodes/Events/Nodes/EveryXSeconds.cs index 7be17cab..a7cd6465 100644 --- a/Runtime/Nodes/Events/Nodes/EveryXSeconds.cs +++ b/Runtime/Nodes/Events/Nodes/EveryXSeconds.cs @@ -45,13 +45,6 @@ protected override void Definition() unscaledTime = ValueInput(nameof(unscaledTime), false); } - public override void StartListening(GraphStack stack) - { - base.StartListening(stack); - - var data = stack.GetElementData(this); - } - protected override bool ShouldTrigger(Flow flow, EmptyEventArgs args) { var data = flow.stack.GetElementData(this); diff --git a/Runtime/Nodes/Events/Nodes/OnUnityEvent.cs b/Runtime/Nodes/Events/Nodes/OnUnityEvent.cs index e15e5de6..9335af58 100644 --- a/Runtime/Nodes/Events/Nodes/OnUnityEvent.cs +++ b/Runtime/Nodes/Events/Nodes/OnUnityEvent.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Reflection; using UnityEngine; +using UnityEngine.Assemblies; using UnityEngine.Events; namespace Unity.VisualScripting.Community @@ -228,7 +229,11 @@ private Type GetAotSupportMethodsType() AotSupportMethodsType = Type.GetType("Unity.VisualScripting.Community.Generated.AotSupportMethods, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"); if (AotSupportMethodsType == null) { +#if UNITY_6000_4_OR_NEWER + foreach (var asm in CurrentAssemblies.GetLoadedAssemblies()) +#else foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) +#endif { AotSupportMethodsType = asm.GetType(AotSupportTypeFullName); if (AotSupportMethodsType != null) diff --git a/Runtime/Nodes/Fundamentals/Control/EdgeTrigger.cs b/Runtime/Nodes/Fundamentals/Control/EdgeTrigger.cs index b425b301..8d4e2427 100644 --- a/Runtime/Nodes/Fundamentals/Control/EdgeTrigger.cs +++ b/Runtime/Nodes/Fundamentals/Control/EdgeTrigger.cs @@ -7,10 +7,15 @@ [RenamedFrom("Bolt.Addons.Community.Logic.Units.EdgeTrigger")] [RenamedFrom("Bolt.Addons.Community.Fundamentals.EdgeTrigger")] [TypeIcon(typeof(ISelectUnit))] - public sealed class EdgeTrigger : Unit + public sealed class EdgeTrigger : Unit, IGraphElementWithData { public EdgeTrigger() : base() { } + private class Data : IGraphElementData + { + public bool? lastEdge; + } + /// /// The entry point for the branch. /// @@ -37,13 +42,18 @@ public EdgeTrigger() : base() { } [PortLabelHidden] public ControlOutput exit { get; private set; } - private bool? _lastEdge; - protected override void Definition() { enter = ControlInput(nameof(enter), Enter); inValue = ValueInput(nameof(inValue), false); - outValue = ValueOutput(nameof(outValue), (recursion) => { if (_lastEdge.HasValue) return _lastEdge.Value; return false; }); + outValue = ValueOutput(nameof(outValue), (flow) => + { + var data = flow.stack.GetElementData(this); + + if (data.lastEdge.HasValue) + return data.lastEdge.Value; + return false; + }); exit = ControlOutput(nameof(exit)); Succession(enter, exit); @@ -54,14 +64,20 @@ protected override void Definition() public ControlOutput Enter(Flow flow) { + var data = flow.stack.GetElementData(this); bool currentValue = flow.GetValue(inValue); - if (!_lastEdge.HasValue || _lastEdge != currentValue) + if (!data.lastEdge.HasValue || data.lastEdge != currentValue) { - _lastEdge = currentValue; + data.lastEdge = currentValue; return exit; } return null; } + + public IGraphElementData CreateData() + { + return new Data(); + } } } \ No newline at end of file diff --git a/Runtime/Nodes/Fundamentals/Control/Gate.cs b/Runtime/Nodes/Fundamentals/Control/Gate.cs index c26ae901..457c3634 100644 --- a/Runtime/Nodes/Fundamentals/Control/Gate.cs +++ b/Runtime/Nodes/Fundamentals/Control/Gate.cs @@ -8,10 +8,16 @@ [RenamedFrom("Bolt.Addons.Community.Fundamentals.Gate")] [TypeIcon(typeof(ISelectUnit))] [UnitOrder(0)] - public sealed class Gate : Unit + public sealed class Gate : Unit, IGraphElementWithData { public Gate() : base() { } + private class Data : IGraphElementData + { + public bool isInitial = true; + public bool isOpen = false; + } + /// /// The entry point for the branch. /// @@ -50,9 +56,6 @@ public Gate() : base() { } [PortLabel("Exit")] public ControlOutput exit { get; private set; } - private bool _isInitial = true; - private bool _isOpen = false; - protected override void Definition() { enter = ControlInput(nameof(enter), Enter); @@ -69,40 +72,53 @@ protected override void Definition() public ControlOutput Enter(Flow flow) { - PrepInitialState(flow); + var data = flow.stack.GetElementData(this); + + PrepInitialState(flow, data); - if (_isOpen) + if (data.isOpen) return exit; return null; } - private ControlOutput Open(Flow obj) + private ControlOutput Open(Flow flow) { - _isInitial = false; - _isOpen = true; + var data = flow.stack.GetElementData(this); + + data.isInitial = false; + data.isOpen = true; return null; } - private ControlOutput Close(Flow obj) + private ControlOutput Close(Flow flow) { - _isInitial = false; - _isOpen = false; + var data = flow.stack.GetElementData(this); + + data.isInitial = false; + data.isOpen = false; return null; } - private ControlOutput Toggle(Flow obj) + private ControlOutput Toggle(Flow flow) { - _isInitial = false; - _isOpen = !_isOpen; + var data = flow.stack.GetElementData(this); + + data.isInitial = false; + data.isOpen = !data.isOpen; return null; } - private void PrepInitialState(Flow flow) + private void PrepInitialState(Flow flow, Data data) + { + if (data.isInitial) + data.isOpen = flow.GetValue(initialState); + data.isInitial = false; + } + + public IGraphElementData CreateData() { - if (_isInitial) - _isOpen = flow.GetValue(initialState); - _isInitial = false; + return new Data(); } } } \ No newline at end of file diff --git a/Runtime/Nodes/Fundamentals/Control/LimitedTrigger.cs b/Runtime/Nodes/Fundamentals/Control/LimitedTrigger.cs index 73d07e9c..7c95525c 100644 --- a/Runtime/Nodes/Fundamentals/Control/LimitedTrigger.cs +++ b/Runtime/Nodes/Fundamentals/Control/LimitedTrigger.cs @@ -4,8 +4,13 @@ namespace Unity.VisualScripting.Community [UnitTitle("LimitedTrigger")] [UnitCategory("Community\\Control")] [TypeIcon(typeof(Once))] - public class LimitedTrigger : Unit + public class LimitedTrigger : Unit, IGraphElementWithData { + private class Data : IGraphElementData + { + public int timesTriggered; + } + [DoNotSerialize] [PortLabelHidden] public ControlInput Input; @@ -23,8 +28,6 @@ public class LimitedTrigger : Unit [DoNotSerialize] public ValueInput Times; - private int timesTriggered = 0; - protected override void Definition() { Input = ControlInput(nameof(Input), IncreaseTimes); @@ -41,11 +44,12 @@ protected override void Definition() private ControlOutput IncreaseTimes(Flow flow) { + var data = flow.stack.GetElementData(this); int timesToTrigger = (int)flow.GetValue(Times); - if (timesTriggered < timesToTrigger) + if (data.timesTriggered < timesToTrigger) { - timesTriggered++; + data.timesTriggered++; return Exit; } else @@ -56,8 +60,15 @@ private ControlOutput IncreaseTimes(Flow flow) private ControlOutput ResetTimes(Flow flow) { - timesTriggered = 0; + var data = flow.stack.GetElementData(this); + + data.timesTriggered = 0; return null; } + + public IGraphElementData CreateData() + { + return new Data(); + } } } diff --git a/Runtime/Nodes/Fundamentals/Control/Using.cs b/Runtime/Nodes/Fundamentals/Control/Using.cs index 4bf7c94e..97f0f76c 100644 --- a/Runtime/Nodes/Fundamentals/Control/Using.cs +++ b/Runtime/Nodes/Fundamentals/Control/Using.cs @@ -20,7 +20,7 @@ public class Using : Unit public ValueInput value; protected override void Definition() { - enter = ControlInput(nameof(enter), Trigger); + enter = ControlInputCoroutine(nameof(enter), Trigger, TriggerCoroutine); exit = ControlOutput(nameof(exit)); body = ControlOutput(nameof(body)); value = ValueInput(nameof(value), default); @@ -29,12 +29,9 @@ protected override void Definition() Succession(enter, exit); Succession(enter, body); } + public ControlOutput Trigger(Flow flow) { - if (flow.isCoroutine) - { - throw new NotSupportedException("The 'using' statement cannot be used with coroutines."); - } var disposable = flow.GetValue(value); using (disposable) { @@ -42,5 +39,15 @@ public ControlOutput Trigger(Flow flow) } return exit; } + + public IEnumerator TriggerCoroutine(Flow flow) + { + var disposable = flow.GetValue(value); + using (disposable) + { + yield return body; + } + yield return exit; + } } } \ No newline at end of file diff --git a/Runtime/Nodes/Fundamentals/Documenting/CommentNode.cs b/Runtime/Nodes/Fundamentals/Documenting/CommentNode.cs index db4159de..b2e1eeac 100644 --- a/Runtime/Nodes/Fundamentals/Documenting/CommentNode.cs +++ b/Runtime/Nodes/Fundamentals/Documenting/CommentNode.cs @@ -11,7 +11,6 @@ namespace Unity.VisualScripting.Community [UnitTitle("Comment")] [UnitShortTitle("")] [UnitCategory("Community\\Documentation")] - [Serializable] public class CommentNode : Unit { // Global diff --git a/Runtime/Nodes/Fundamentals/Logic/Boolean/Latch.cs b/Runtime/Nodes/Fundamentals/Logic/Boolean/Latch.cs index d5a0e962..2f791214 100644 --- a/Runtime/Nodes/Fundamentals/Logic/Boolean/Latch.cs +++ b/Runtime/Nodes/Fundamentals/Logic/Boolean/Latch.cs @@ -6,10 +6,15 @@ [UnitCategory("Community\\Logic")] [RenamedFrom("Bolt.Addons.Community.Logic.Units.Latch")] [RenamedFrom("Bolt.Addons.Community.Fundamentals.Latch")] - public sealed class Latch : Unit + public sealed class Latch : Unit, IGraphElementWithData { public Latch() : base() { } + private class Data : IGraphElementData + { + public bool isSet; + } + /// /// The entry point for the Latch. /// @@ -55,8 +60,6 @@ public Latch() : base() { } [DoNotSerialize] public ValueOutput value { get; private set; } - private bool _isSet = false; - protected override void Definition() { enter = ControlInput(nameof(enter), Enter); @@ -64,7 +67,7 @@ protected override void Definition() reset = ValueInput(nameof(reset), false); resetDominant = ValueInput(nameof(resetDominant), false); exit = ControlOutput(nameof(exit)); - value = ValueOutput(nameof(value), (x) => _isSet); + value = ValueOutput(nameof(value), (flow) => flow.stack.GetElementData(this).isSet); Succession(enter, exit); @@ -81,27 +84,33 @@ protected override void Definition() public ControlOutput Enter(Flow flow) { + var data = flow.stack.GetElementData(this); if (flow.GetValue(set)) { if (flow.GetValue(reset)) { if (flow.GetValue(resetDominant)) - _isSet = false; + data.isSet = false; else - _isSet = true; + data.isSet = true; } else { - _isSet = true; + data.isSet = true; } } else { if (flow.GetValue(reset)) - _isSet = false; + data.isSet = false; } return exit; } + + public IGraphElementData CreateData() + { + return new Data(); + } } } \ No newline at end of file diff --git a/Runtime/Nodes/Fundamentals/Logic/Boolean/ToggleBool.cs b/Runtime/Nodes/Fundamentals/Logic/Boolean/ToggleBool.cs index e77f891d..db88e130 100644 --- a/Runtime/Nodes/Fundamentals/Logic/Boolean/ToggleBool.cs +++ b/Runtime/Nodes/Fundamentals/Logic/Boolean/ToggleBool.cs @@ -6,8 +6,15 @@ namespace Unity.VisualScripting.Community [UnitCategory("Community\\Utility")] [UnitTitle("Toggle Boolean")] [TypeIcon(typeof(ToggleFlow))] - public class ToggleBool : Unit + public class ToggleBool : Unit, IGraphElementWithData { + private class Data : IGraphElementData + { + public bool Cached = false; + + public bool value; + } + [DoNotSerialize] public ValueInput Value; @@ -15,10 +22,6 @@ public class ToggleBool : Unit [PortLabelHidden] public ValueOutput Result; - private bool Cached = false; - - private bool value; - protected override void Definition() { Value = ValueInput(nameof(Value)); @@ -27,26 +30,30 @@ protected override void Definition() private bool GetResult(Flow flow) { - if (!Cached) + var data = flow.stack.GetElementData(this); + if (!data.Cached) { - value = (bool)flow.GetValue(Value); + data.value = (bool)flow.GetValue(Value); - value = !value; + data.value = !data.value; - Cached = true; + data.Cached = true; - return value; + return data.value; } else { - flow.SetValue(Value, value); + flow.SetValue(Value, data.value); - value = !value; + data.value = !data.value; - return value; + return data.value; } + } - + public IGraphElementData CreateData() + { + return new Data(); } } diff --git a/Runtime/Nodes/Fundamentals/Logic/Branching/If.cs b/Runtime/Nodes/Fundamentals/Logic/Branching/If.cs index 34a10981..53f3296d 100644 --- a/Runtime/Nodes/Fundamentals/Logic/Branching/If.cs +++ b/Runtime/Nodes/Fundamentals/Logic/Branching/If.cs @@ -25,7 +25,7 @@ public class BetterIf : Unit [DoNotSerialize] public ControlOutput False; [DoNotSerialize] - [PortLabel("Next")] + [PortLabel("Then")] public ControlOutput Finished; protected override void Definition() diff --git a/Runtime/Nodes/Fundamentals/String/Stringbuilder/StringbuilderUnit.cs b/Runtime/Nodes/Fundamentals/String/Stringbuilder/StringbuilderUnit.cs index e0ad0d36..ca5bf515 100644 --- a/Runtime/Nodes/Fundamentals/String/Stringbuilder/StringbuilderUnit.cs +++ b/Runtime/Nodes/Fundamentals/String/Stringbuilder/StringbuilderUnit.cs @@ -35,7 +35,7 @@ public enum AppendMode [Inspectable, InspectorLabel("Append Modes", "List to store the modes for each input (Max: 10 items)")] [InspectorWide] [InspectorRange(MinInputs, MaxInputs)] - public List appendModes = new List(); + public List appendModes = new List() { new StringAppendMode() { appendMode = AppendMode.Default} }; [DoNotSerialize] public List inputPorts { get; private set; } = new List(); diff --git a/Runtime/Nodes/Fundamentals/Utility/Counter.cs b/Runtime/Nodes/Fundamentals/Utility/Counter.cs index b00872c2..f3b3c8f6 100644 --- a/Runtime/Nodes/Fundamentals/Utility/Counter.cs +++ b/Runtime/Nodes/Fundamentals/Utility/Counter.cs @@ -7,8 +7,13 @@ namespace Unity.VisualScripting.Community [UnitTitle("Counter")] [UnitCategory("Community\\Utility")] [TypeIcon(typeof(Add))] - public class CounterNode : Unit + public class CounterNode : Unit, IGraphElementWithData { + private class Data : IGraphElementData + { + public int counter; + } + [DoNotSerialize] [PortLabelHidden] public ControlInput enter; @@ -39,16 +44,23 @@ protected override void Definition() public ControlOutput OnEnter(Flow flow) { - counter++; + var data = flow.stack.GetElementData(this); + data.counter++; flow.SetValue(timesTriggered, counter); return exit; } public ControlOutput OnReset(Flow flow) { - counter = 0; + var data = flow.stack.GetElementData(this); + data.counter = 0; flow.SetValue(timesTriggered, counter); return null; } + + public IGraphElementData CreateData() + { + return new Data(); + } } } diff --git a/Runtime/Nodes/Fundamentals/Utility/ValueReroute.cs b/Runtime/Nodes/Fundamentals/Utility/ValueReroute.cs index bf46e7aa..0aca366c 100644 --- a/Runtime/Nodes/Fundamentals/Utility/ValueReroute.cs +++ b/Runtime/Nodes/Fundamentals/Utility/ValueReroute.cs @@ -32,8 +32,12 @@ public sealed class ValueReroute : Unit protected override void Definition() { input = ValueInput(portType, "in"); - output = ValueOutput(portType, "out", (flow) => { return flow.GetValue(input); }); - Requirement(input, output); + output = ValueOutput(portType, "out", (flow) => { return flow.GetValue(input); }).PredictableIf(f => + { + var connection = input.connection; + + return connection != null && Flow.CanPredict(connection.source, f.stack.AsReference()); + }); } } } \ No newline at end of file diff --git a/Runtime/Shared/Libraries/CSharp/Constructs/Modifiers/PropertyModifier.cs b/Runtime/Shared/Libraries/CSharp/Constructs/Modifiers/PropertyModifier.cs index 3d2ab652..1a63c924 100644 --- a/Runtime/Shared/Libraries/CSharp/Constructs/Modifiers/PropertyModifier.cs +++ b/Runtime/Shared/Libraries/CSharp/Constructs/Modifiers/PropertyModifier.cs @@ -14,5 +14,6 @@ public enum PropertyModifier Unsafe = 1 << 4, Volatile = 1 << 5, New = 1 << 6, + Virtual = 1 << 7, } } diff --git a/Runtime/Shared/Libraries/CSharp/Generators/Constructs/AttributeGenerator.cs b/Runtime/Shared/Libraries/CSharp/Generators/Constructs/AttributeGenerator.cs index b0f4db00..31a37e55 100644 --- a/Runtime/Shared/Libraries/CSharp/Generators/Constructs/AttributeGenerator.cs +++ b/Runtime/Shared/Libraries/CSharp/Generators/Constructs/AttributeGenerator.cs @@ -39,7 +39,7 @@ public override void Generate(CodeWriter writer, ControlGenerationData data) // Add parameters with labels for (int i = 0; i < parameterValuesWithLabel.Count; i++) { - parameterList.Add(parameterValuesWithLabel[i].Item1.VariableHighlight() + " = " + writer.Object(parameterValuesWithLabel[i].Item2)); + parameterList.Add(parameterValuesWithLabel[i].Item1.VariableHighlight() + " = " + writer.ObjectString(parameterValuesWithLabel[i].Item2)); } // Add type parameters diff --git a/Runtime/Shared/Libraries/CSharp/Generators/Constructs/PropertyGenerator.cs b/Runtime/Shared/Libraries/CSharp/Generators/Constructs/PropertyGenerator.cs index 856938fc..bd9ffbe8 100644 --- a/Runtime/Shared/Libraries/CSharp/Generators/Constructs/PropertyGenerator.cs +++ b/Runtime/Shared/Libraries/CSharp/Generators/Constructs/PropertyGenerator.cs @@ -362,7 +362,7 @@ public void SetSetterOwner(Unit setterOwner) public bool IsAutoImplemented() { - return (getterBodyAction == null && setterBodyAction == null) || (modifier == PropertyModifier.Abstract); + return (getterBodyAction == null && setterBodyAction == null) || ((modifier & PropertyModifier.Abstract) != 0); } public PropertyGenerator SetWarning(string warning) diff --git a/Runtime/Shared/Libraries/CSharp/Generators/Operators/BinaryOperatorGenerator.cs b/Runtime/Shared/Libraries/CSharp/Generators/Operators/BinaryOperatorGenerator.cs index 299b5774..5a86ca92 100644 --- a/Runtime/Shared/Libraries/CSharp/Generators/Operators/BinaryOperatorGenerator.cs +++ b/Runtime/Shared/Libraries/CSharp/Generators/Operators/BinaryOperatorGenerator.cs @@ -8,7 +8,6 @@ namespace Unity.VisualScripting.Community.Libraries.CSharp /// /// A generator that retains data for creating a Binary Operator as a string. /// - [Serializable] [RenamedFrom("Bolt.Addons.Community.Libraries.CSharp.BinaryOperatorGenerator")] public sealed class BinaryOperatorGenerator : ConstructGenerator { diff --git a/Runtime/Shared/Libraries/CSharp/Utilities/CodeConverter.cs b/Runtime/Shared/Libraries/CSharp/Utilities/CodeConverter.cs index 29009a4d..8abf157b 100644 --- a/Runtime/Shared/Libraries/CSharp/Utilities/CodeConverter.cs +++ b/Runtime/Shared/Libraries/CSharp/Utilities/CodeConverter.cs @@ -28,43 +28,44 @@ public static string AsString(this RootAccessModifier scope) { FieldModifier.Readonly, new FieldModifier[] { FieldModifier.Constant, FieldModifier.Volatile } }, { FieldModifier.Volatile, new FieldModifier[] { FieldModifier.Constant, FieldModifier.Readonly } }, { FieldModifier.Unsafe, new FieldModifier[] { FieldModifier.Constant } }, - { FieldModifier.New, new FieldModifier[0] }, - { FieldModifier.None, new FieldModifier[0] } + { FieldModifier.New, Array.Empty() }, + { FieldModifier.None, Array.Empty() } }; public static readonly Dictionary propertyModifierConflicts = new Dictionary() { - { PropertyModifier.Abstract, new[] { PropertyModifier.Static, PropertyModifier.Sealed, PropertyModifier.Override, PropertyModifier.Unsafe, PropertyModifier.Volatile } }, - { PropertyModifier.Override, new[] { PropertyModifier.Static, PropertyModifier.Sealed, PropertyModifier.Abstract, PropertyModifier.Unsafe, PropertyModifier.Volatile } }, - { PropertyModifier.Sealed, new[] { PropertyModifier.Static, PropertyModifier.Abstract, PropertyModifier.Unsafe, PropertyModifier.Volatile } }, - { PropertyModifier.Static, new[] { PropertyModifier.Abstract, PropertyModifier.Override, PropertyModifier.Sealed, PropertyModifier.Volatile } }, - { PropertyModifier.Unsafe, new[] { PropertyModifier.Abstract, PropertyModifier.Override, PropertyModifier.Sealed, PropertyModifier.Volatile } }, - { PropertyModifier.Volatile, new[] { PropertyModifier.Abstract, PropertyModifier.Override, PropertyModifier.Sealed, PropertyModifier.Static, PropertyModifier.Unsafe } }, - { PropertyModifier.New, Array.Empty() }, - { PropertyModifier.None, Array.Empty() }, + { PropertyModifier.Abstract, new[] { PropertyModifier.Static, PropertyModifier.Sealed, PropertyModifier.Override, PropertyModifier.Virtual, PropertyModifier.Volatile } }, + { PropertyModifier.Override, new[] { PropertyModifier.Static, PropertyModifier.Abstract, PropertyModifier.Virtual, PropertyModifier.New, PropertyModifier.Volatile } }, + { PropertyModifier.Sealed, new[] { PropertyModifier.Static, PropertyModifier.Abstract, PropertyModifier.Virtual, PropertyModifier.Volatile } }, + { PropertyModifier.Static, new[] { PropertyModifier.Abstract, PropertyModifier.Virtual, PropertyModifier.Override, PropertyModifier.Sealed, PropertyModifier.Volatile } }, + { PropertyModifier.Virtual, new[] { PropertyModifier.Static, PropertyModifier.Abstract, PropertyModifier.Override, PropertyModifier.Sealed, PropertyModifier.Volatile } }, + { PropertyModifier.Unsafe, new[] { PropertyModifier.Volatile } }, + { PropertyModifier.Volatile, new[] { PropertyModifier.Abstract, PropertyModifier.Override, PropertyModifier.Sealed, PropertyModifier.Static, PropertyModifier.Unsafe, PropertyModifier.New, PropertyModifier.Virtual } }, + { PropertyModifier.New, new[] { PropertyModifier.Override, PropertyModifier.Volatile } }, + { PropertyModifier.None, Array.Empty() }, }; public static readonly Dictionary parameterModifierConflicts = new Dictionary { - { ParameterModifier.In, new ParameterModifier[] { ParameterModifier.Out, ParameterModifier.Ref, ParameterModifier.Params, ParameterModifier.This } }, - { ParameterModifier.Out, new ParameterModifier[] { ParameterModifier.In, ParameterModifier.Ref, ParameterModifier.Params, ParameterModifier.This } }, - { ParameterModifier.Ref, new ParameterModifier[] { ParameterModifier.In, ParameterModifier.Out, ParameterModifier.Params } }, + { ParameterModifier.In, new ParameterModifier[] { ParameterModifier.Out, ParameterModifier.Ref, ParameterModifier.Params } }, + { ParameterModifier.Out, new ParameterModifier[] { ParameterModifier.In, ParameterModifier.Ref, ParameterModifier.Params, ParameterModifier.This } }, + { ParameterModifier.Ref, new ParameterModifier[] { ParameterModifier.In, ParameterModifier.Out, ParameterModifier.Params } }, { ParameterModifier.Params, new ParameterModifier[] { ParameterModifier.In, ParameterModifier.Out, ParameterModifier.Ref, ParameterModifier.This } }, - { ParameterModifier.This, new ParameterModifier[] { ParameterModifier.In, ParameterModifier.Out, ParameterModifier.Params } }, - { ParameterModifier.None, Array.Empty() } + { ParameterModifier.This, new ParameterModifier[] { ParameterModifier.Out, ParameterModifier.Params } }, + { ParameterModifier.None, Array.Empty() } }; public static readonly Dictionary methodModifierConflicts = new Dictionary { { MethodModifier.Abstract, new MethodModifier[] { MethodModifier.Static, MethodModifier.Sealed, MethodModifier.Override, MethodModifier.Extern, MethodModifier.Virtual, MethodModifier.Async } }, - { MethodModifier.Virtual, new MethodModifier[] { MethodModifier.Static, MethodModifier.Sealed, MethodModifier.Override, MethodModifier.Extern, MethodModifier.Abstract, MethodModifier.Async } }, - { MethodModifier.Override, new MethodModifier[] { MethodModifier.Static, MethodModifier.Sealed, MethodModifier.Virtual, MethodModifier.Extern, MethodModifier.Abstract } }, - { MethodModifier.Sealed, new MethodModifier[] { MethodModifier.Static, MethodModifier.Virtual, MethodModifier.Override, MethodModifier.Extern, MethodModifier.Abstract } }, + { MethodModifier.Virtual, new MethodModifier[] { MethodModifier.Static, MethodModifier.Sealed, MethodModifier.Override, MethodModifier.Extern, MethodModifier.Abstract } }, + { MethodModifier.Override, new MethodModifier[] { MethodModifier.Static, MethodModifier.Virtual, MethodModifier.Extern, MethodModifier.Abstract } }, + { MethodModifier.Sealed, new MethodModifier[] { MethodModifier.Static, MethodModifier.Virtual, MethodModifier.Extern, MethodModifier.Abstract } }, { MethodModifier.Static, new MethodModifier[] { MethodModifier.Abstract, MethodModifier.Virtual, MethodModifier.Override, MethodModifier.Sealed } }, { MethodModifier.Extern, new MethodModifier[] { MethodModifier.Abstract, MethodModifier.Virtual, MethodModifier.Override, MethodModifier.Sealed } }, { MethodModifier.Async, new MethodModifier[] { MethodModifier.Abstract } }, - { MethodModifier.Unsafe, new MethodModifier[0] }, - { MethodModifier.None, new MethodModifier[0] }, + { MethodModifier.Unsafe, Array.Empty() }, + { MethodModifier.None, Array.Empty() }, }; public static string AsString(this FieldModifier modifier) diff --git a/Runtime/Shared/Libraries/Humility/Collections/DefinedDictionary.cs b/Runtime/Shared/Libraries/Humility/Collections/DefinedDictionary.cs index 7ce63d4b..465ee33f 100644 --- a/Runtime/Shared/Libraries/Humility/Collections/DefinedDictionary.cs +++ b/Runtime/Shared/Libraries/Humility/Collections/DefinedDictionary.cs @@ -8,7 +8,9 @@ namespace Unity.VisualScripting.Community.Libraries.Humility [Serializable] public class DefinedDictionary : ISerializationCallbackReceiver { + [NonSerialized] public Dictionary previous = new Dictionary(); + [NonSerialized] public Dictionary current = new Dictionary(); [SerializeField] private List previousSerializedKeys = new List(); diff --git a/Runtime/Shared/Libraries/Humility/Color/HUMColor.cs b/Runtime/Shared/Libraries/Humility/Color/HUMColor.cs index bf79f61f..21ed385a 100644 --- a/Runtime/Shared/Libraries/Humility/Color/HUMColor.cs +++ b/Runtime/Shared/Libraries/Humility/Color/HUMColor.cs @@ -70,8 +70,8 @@ public static Color Mix(this Color value, Color other) return new Color((value.r + other.r) / 2, (value.g + other.g) / 2, (value.b + other.b) / 2); } /// - /// Lightens up the color by adding all values by the percent. - /// + /// Lightens up the color by adding all values by the percent. + /// public static Color Blend(this Color value, Color other, float percent) { return new Color((value.r + (other.r * percent)) / 2, (value.g + (other.g * percent)) / 2, (value.b + (other.b * percent)) / 2); diff --git a/Runtime/Shared/Libraries/Humility/Type/HUMType_Children.cs b/Runtime/Shared/Libraries/Humility/Type/HUMType_Children.cs index 8afd4d59..d1084ea3 100644 --- a/Runtime/Shared/Libraries/Humility/Type/HUMType_Children.cs +++ b/Runtime/Shared/Libraries/Humility/Type/HUMType_Children.cs @@ -7,6 +7,7 @@ using UnityEngine; using System.Linq; using Unity.VisualScripting.Community.Libraries.Humility; +using UnityEngine.Assemblies; namespace Unity.VisualScripting.Community.Libraries.Humility { @@ -537,8 +538,11 @@ public static bool UnityObject(this HUMType.Data.Is isData) public static Type[] Attribute(this HUMType.Data.With with, Assembly _assembly = null, Func predicate = null) where TAttribute : Attribute { List result = new List(); +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = _assembly == null ? CurrentAssemblies.GetLoadedAssemblies().ToArray() : new Assembly[] { _assembly }; +#else Assembly[] assemblies = _assembly == null ? AppDomain.CurrentDomain.GetAssemblies() : new Assembly[] { _assembly }; - +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { Type[] types = assemblies[assembly].GetTypes(); @@ -576,7 +580,12 @@ public static Type[] Attribute(this HUMType.Data.With with, Assembly public static Type[] Attribute(this HUMType.Data.With with, Func predicate) where TAttribute : Attribute { List result = new List(); + +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { @@ -616,7 +625,11 @@ public static HUMType.Data.Generic Generic(this HUMType.Data.Is isData) public static Type[] Derived(this HUMType.Data.Get derived, bool includeSelf = false) { List result = new List(); +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { @@ -640,7 +653,11 @@ public static Type[] Derived(this HUMType.Data.Get derived, bool includeSelf = f public static void Derived(this HUMType.Data.Get derived, Action action, bool includeSelf = false) { List result = new List(); +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif if (includeSelf) action?.Invoke(derived.type); for (int assembly = 0; assembly < assemblies.Length; assembly++) @@ -664,7 +681,11 @@ public static void Derived(this HUMType.Data.Get derived, Action action, b public static Type[] All(this HUMType.Data.Get derived, bool includeSelf = false) { List result = new List(); +#if UNITY_6000_4_OR_NEWER + Assembly[] assemblies = CurrentAssemblies.GetLoadedAssemblies().ToArray(); +#else Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif for (int assembly = 0; assembly < assemblies.Length; assembly++) { @@ -790,6 +811,11 @@ public static string Code(this HUMValue.Data.As @as, bool isNew, bool isLiteral var value = (Color)@as.value; return Create("Color", value.r.As().Code(false, false, false, "", false, fullName), value.g.As().Code(false, false, false, "", false, fullName), value.b.As().Code(false, false, false, "", false, fullName), value.a.As().Code(false, false, false, "", false, fullName)); } + if (type == typeof(HDRColor)) + { + var value = (HDRColor)@as.value; + return Create("HDRColor", value.color.As().Code(false, false, false, "", false, fullName)); + } if (type == typeof(Gradient)) { var value = (Gradient)@as.value; @@ -920,6 +946,11 @@ private static string HighlightedCode(this HUMValue.Data.As @as, bool isNew, boo var value = (Color)@as.value; return CreateHighlighted("Color", value.r.As().Code(false, false, true, "", false, fullName), value.g.As().Code(false, false, true, "", false, fullName), value.b.As().Code(false, false, true, "", false, fullName), value.a.As().Code(false, false, true, "", false, fullName)); } + if (type == typeof(HDRColor)) + { + var value = (HDRColor)@as.value; + return CreateHighlighted("HDRColor", value.color.As().Code(false, false, true, "", false, fullName)); + } if (type == typeof(Gradient)) { var value = (Gradient)@as.value; @@ -1058,6 +1089,11 @@ public static string Code(this HUMValue.Data.As @as, bool isNew, bool isLiteral var value = (Color)@as.value; return Create("Color", value.r.As().Code(false, false, false, "", false, fullName), value.g.As().Code(false, false, false, "", false, fullName), value.b.As().Code(false, false, false, "", false, fullName), value.a.As().Code(false, false, false, "", false, fullName)); } + if (type == typeof(HDRColor)) + { + var value = (HDRColor)@as.value; + return Create("HDRColor", value.color.As().Code(false, false, false, "", false, fullName)); + } if (type == typeof(Gradient)) { var value = (Gradient)@as.value; @@ -1188,6 +1224,11 @@ private static string HighlightedCode(this HUMValue.Data.As @as, bool isNew, boo var value = (Color)@as.value; return CreateHighlighted("Color", value.r.As().Code(false, false, true, "", false, fullName), value.g.As().Code(false, false, true, "", false, fullName), value.b.As().Code(false, false, true, "", false, fullName), value.a.As().Code(false, false, true, "", false, fullName)); } + if (type == typeof(HDRColor)) + { + var value = (HDRColor)@as.value; + return CreateHighlighted("HDRColor", value.color.As().Code(false, false, true, "", false, fullName)); + } if (type == typeof(Gradient)) { var value = (Gradient)@as.value; diff --git a/Runtime/Shared/Libraries/Humility/Type/Objects/SystemType.cs b/Runtime/Shared/Libraries/Humility/Type/Objects/SystemType.cs index 41110445..d2a43ec1 100644 --- a/Runtime/Shared/Libraries/Humility/Type/Objects/SystemType.cs +++ b/Runtime/Shared/Libraries/Humility/Type/Objects/SystemType.cs @@ -10,6 +10,7 @@ public sealed class SystemType : ISerializationCallbackReceiver [Inspectable] [InspectorLabel("")] [InspectorWide] + [NonSerialized] [FullSerializer.fsProperty(Converter = typeof(FakeGenericParameterTypeConverter))] public Type type; [SerializeField][HideInInspector] diff --git a/Runtime/Shared/Libraries/Humility/Values/HUMValue_Root.cs b/Runtime/Shared/Libraries/Humility/Values/HUMValue_Root.cs index 756c22f1..b7149c8b 100644 --- a/Runtime/Shared/Libraries/Humility/Values/HUMValue_Root.cs +++ b/Runtime/Shared/Libraries/Humility/Values/HUMValue_Root.cs @@ -23,7 +23,7 @@ public static string Serialized(this object value) if (type == typeof(string)) return value + "[Type:String]"; if (type == typeof(Type)) return ((Type)value).FullName + "[Type:Type]"; if (type == typeof(UnityEngine.GameObject)) return "null"; - + return string.Empty; } @@ -33,7 +33,7 @@ public static string Serialized(this object value) public static object Deserialized(this string str) { if (str.Contains("[Type:Boolean]")) - + { if (str.Contains("true")) return true; if (str.Contains("false")) return false; @@ -59,13 +59,35 @@ public static object Deserialized(this string str) return Type.GetType(str.Replace("[Type:Type]", string.Empty)); } - if (str.Contains("[Type:GameObject")) + const string tag = "[Type:GameObject]"; + if (str.Contains(tag)) { - var parsedInt = int.Parse(str.Replace("[Type:GameObject]", string.Empty)); + string idStr = str.Replace(tag, string.Empty); + #if UNITY_EDITOR - var asset = AssetDatabase.LoadAssetAtPath(AssetDatabase.GetAssetPath(parsedInt)); - return asset; +#if UNITY_6000_5_OR_NEWER + if (ulong.TryParse(idStr, out ulong parsedULong)) + { + EntityId entityId = EntityId.FromULong(parsedULong); + string path = AssetDatabase.GetAssetPath(entityId); + return !string.IsNullOrEmpty(path) ? AssetDatabase.LoadAssetAtPath(path) : null; + } +#elif UNITY_6000_3_OR_NEWER + if (int.TryParse(idStr, out int parsedInt)) + { + EntityId entityId = (EntityId)parsedInt; + string path = AssetDatabase.GetAssetPath(entityId); + return !string.IsNullOrEmpty(path) ? AssetDatabase.LoadAssetAtPath(path) : null; + } +#else + if (int.TryParse(idStr, out int parsedInt)) + { + string path = AssetDatabase.GetAssetPath(parsedInt); + return !string.IsNullOrEmpty(path) ? AssetDatabase.LoadAssetAtPath(path) : null; + } +#endif #endif + return null; } return null; diff --git a/Runtime/Shared/Utility/DefinedEventType.cs b/Runtime/Shared/Utility/DefinedEventType.cs index c0b25521..6c8b2df5 100644 --- a/Runtime/Shared/Utility/DefinedEventType.cs +++ b/Runtime/Shared/Utility/DefinedEventType.cs @@ -9,6 +9,7 @@ namespace Unity.VisualScripting.Community public class DefinedEventType { [Inspectable] + [NonSerialized] public Type type; public DefinedEventType() diff --git a/Runtime/Shared/Utility/EditorState.cs b/Runtime/Shared/Utility/EditorState.cs index 147b4fcd..330907c9 100644 --- a/Runtime/Shared/Utility/EditorState.cs +++ b/Runtime/Shared/Utility/EditorState.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using UnityEngine.Assemblies; namespace Unity.VisualScripting.Community.Utility { @@ -15,7 +16,11 @@ static EditorState() lock (lockObject) { var type = typeof(IEditorStateFetcher); +#if UNITY_6000_4_OR_NEWER + var types = CurrentAssemblies.GetLoadedAssemblies() +#else var types = AppDomain.CurrentDomain.GetAssemblies() +#endif .SelectMany(s => s.GetTypes()) .Where(p => { diff --git a/Runtime/Shared/Utility/HDRColor.cs b/Runtime/Shared/Utility/HDRColor.cs index 00fa2a15..1ee86db8 100644 --- a/Runtime/Shared/Utility/HDRColor.cs +++ b/Runtime/Shared/Utility/HDRColor.cs @@ -15,6 +15,11 @@ public struct HDRColor [ColorUsage(true, true)] public Color color; + public HDRColor(Color color) + { + this.color = color; + } + public static implicit operator Color(HDRColor hdrColor) { return hdrColor.color; @@ -24,7 +29,7 @@ public static implicit operator HDRColor(Color color) { return new HDRColor { color = color }; } - + public override string ToString() { return color.ToString(); diff --git a/Runtime/Shared/Utility/MemberUtility.cs b/Runtime/Shared/Utility/MemberUtility.cs index c2825c65..63f4cc25 100644 --- a/Runtime/Shared/Utility/MemberUtility.cs +++ b/Runtime/Shared/Utility/MemberUtility.cs @@ -18,34 +18,41 @@ public static Member ToManipulatorSafe(this MemberInfo memberInfo, Type targetTy if (memberInfo is EventInfo) return null; - if (memberInfo is FieldInfo fieldInfo) + try { - if (!nonPublic && !fieldInfo.IsPublic) return null; - return fieldInfo.ToManipulator(targetType); - } + if (memberInfo is FieldInfo fieldInfo) + { + if (!nonPublic && !fieldInfo.IsPublic) return null; + return fieldInfo.ToManipulator(targetType); + } - if (memberInfo is PropertyInfo propertyInfo) - { - if (propertyInfo.GetIndexParameters().Length > 0) return null; + if (memberInfo is PropertyInfo propertyInfo) + { + if (propertyInfo.GetIndexParameters().Length > 0) return null; - var getter = propertyInfo.GetGetMethod(nonPublic); - var setter = propertyInfo.GetSetMethod(nonPublic); - if (getter == null && setter == null) return null; + var getter = propertyInfo.GetGetMethod(nonPublic); + var setter = propertyInfo.GetSetMethod(nonPublic); + if (getter == null && setter == null) return null; - return propertyInfo.ToManipulator(targetType); - } + return propertyInfo.ToManipulator(targetType); + } - if (memberInfo is MethodInfo methodInfo) - { - if (methodInfo.IsSpecialName) return null; - if (!nonPublic && !methodInfo.IsPublic) return null; - return methodInfo.ToManipulator(targetType); - } + if (memberInfo is MethodInfo methodInfo) + { + if (methodInfo.IsSpecialName) return null; + if (!nonPublic && !methodInfo.IsPublic) return null; + return methodInfo.ToManipulator(targetType); + } - if (memberInfo is ConstructorInfo ctorInfo) + if (memberInfo is ConstructorInfo ctorInfo) + { + if (!nonPublic && !ctorInfo.IsPublic) return null; + return ctorInfo.ToManipulator(targetType); + } + } + catch (MissingMemberException) { - if (!nonPublic && !ctorInfo.IsPublic) return null; - return ctorInfo.ToManipulator(targetType); + return null; } return null; diff --git a/Runtime/Shared/Utility/TypeParam.cs b/Runtime/Shared/Utility/TypeParam.cs index 54d28b3b..afb0e0d4 100644 --- a/Runtime/Shared/Utility/TypeParam.cs +++ b/Runtime/Shared/Utility/TypeParam.cs @@ -14,6 +14,7 @@ public sealed class TypeParam : ISerializationCallbackReceiver { [SerializeField] [Inspectable] + [NonSerialized] [FullSerializer.fsProperty(Converter = typeof(FakeGenericParameterTypeConverter))] public Type type = typeof(object); @@ -43,6 +44,7 @@ public sealed class TypeParam : ISerializationCallbackReceiver [Serialize] [SerializeField] [InspectorToggleLeft] + [NonSerialized] public object defaultValue; #if VISUAL_SCRIPTING_1_7 public SerializableType typeHandle;