From cf157e6d4d556dd9d13db3cdb9dace4ecefb7d95 Mon Sep 17 00:00:00 2001 From: RealityStop Date: Mon, 17 Sep 2018 23:46:56 -0400 Subject: [PATCH 1/7] #1 Math Op now has a graph inspector toggle for non-numeric inputs. --- src/Fundamentals/Units/Math/MathParamNode.cs | 65 ++++++++++++++++++-- src/Fundamentals/Units/VariadicNode.cs | 4 +- 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/src/Fundamentals/Units/Math/MathParamNode.cs b/src/Fundamentals/Units/Math/MathParamNode.cs index 38b55c5d..d184c3ff 100644 --- a/src/Fundamentals/Units/Math/MathParamNode.cs +++ b/src/Fundamentals/Units/Math/MathParamNode.cs @@ -13,12 +13,17 @@ namespace Bolt.Addons.Community.Fundamentals [TypeIcon(typeof(Absolute))] public class MathParamNode : VariadicNode { - public enum MathType { Add, Subtract, Multiply, Divide} + public enum MathType { Add, Subtract, Multiply, Divide } [SerializeAs(nameof(OperationType))] private MathType _operationType; + [Serialize] + [Inspectable] + [InspectorLabel("Non-Numeric Inputs")] + private bool nonNumeric; + [DoNotSerialize] [Inspectable, UnitHeaderInspectable("Operation")] public MathType OperationType { get { return _operationType; } set { _operationType = value; } } @@ -31,9 +36,27 @@ public enum MathType { Add, Subtract, Multiply, Divide} protected override void Definition() { - output = ValueOutput(nameof(output), GetValue); - - base.Definition(); + arguments = new List(); + if (nonNumeric) + { + output = ValueOutput(nameof(output), GetObjectValue); + for (var i = 0; i < argumentCount; i++) + { + var argument = ValueInput("Arg_" + i); + arguments.Add(argument); + BuildRelations(argument); + } + } + else + { + output = ValueOutput(nameof(output), GetFloatValue); + for (var i = 0; i < argumentCount; i++) + { + var argument = ValueInput("Arg_" + i); + arguments.Add(argument); + BuildRelations(argument); + } + } } protected override void BuildRelations(ValueInput arg) @@ -41,12 +64,13 @@ protected override void BuildRelations(ValueInput arg) Requirement(arg, output); } - private float GetValue(Flow flow) + private float GetFloatValue(Flow flow) { float numeric = flow.GetValue(arguments[0]); for (int i = 1; i < argumentCount; i++) { + switch (OperationType) { case MathType.Add: @@ -65,8 +89,37 @@ private float GetValue(Flow flow) break; } } - return numeric; } + + + private object GetObjectValue(Flow flow) + { + + object obj = flow.GetValue(arguments[0]); + + for (int i = 1; i < argumentCount; i++) + { + switch (OperationType) + { + case MathType.Add: + obj = OperatorUtility.Add(obj, flow.GetValue(arguments[i])); + break; + case MathType.Subtract: + obj = OperatorUtility.Subtract(obj, flow.GetValue(arguments[i])); + break; + case MathType.Multiply: + obj = OperatorUtility.Multiply(obj, flow.GetValue(arguments[i])); + break; + case MathType.Divide: + obj = OperatorUtility.Divide(obj, flow.GetValue(arguments[i])); + break; + default: + break; + } + } + + return obj; + } } } \ No newline at end of file diff --git a/src/Fundamentals/Units/VariadicNode.cs b/src/Fundamentals/Units/VariadicNode.cs index 890eae91..48cc528d 100644 --- a/src/Fundamentals/Units/VariadicNode.cs +++ b/src/Fundamentals/Units/VariadicNode.cs @@ -9,13 +9,11 @@ namespace Bolt.Addons.Community.Fundamentals { public abstract class VariadicNode : Unit { - - [SerializeAs(nameof(argumentCount))] private int _argumentCount; [DoNotSerialize] - public List arguments { get; private set; } + public List arguments { get; protected set; } [DoNotSerialize] From cd5f845fe95d50a8b7c77daf9863afbf5dd42239 Mon Sep 17 00:00:00 2001 From: RealityStop Date: Sat, 29 Sep 2018 01:36:58 -0400 Subject: [PATCH 2/7] Unified Branch --- .../Bolt.Addons.Community.Fundamentals.csproj | 1 + .../Units/Logic/Branching/BranchParams.cs | 96 +++++++++++++++---- .../Units/Logic/Control/DoOnceV2.cs | 1 + .../Units/Logic/LogicParamNode.cs | 71 +++++++++++++- src/Fundamentals/Units/VariadicNode.cs | 9 +- .../Units/physics/OnParticleTriggerNode.cs | 72 ++++++++++++++ 6 files changed, 226 insertions(+), 24 deletions(-) create mode 100644 src/Fundamentals/Units/physics/OnParticleTriggerNode.cs diff --git a/src/Fundamentals/Bolt.Addons.Community.Fundamentals.csproj b/src/Fundamentals/Bolt.Addons.Community.Fundamentals.csproj index 66548476..91f7e3a0 100644 --- a/src/Fundamentals/Bolt.Addons.Community.Fundamentals.csproj +++ b/src/Fundamentals/Bolt.Addons.Community.Fundamentals.csproj @@ -72,6 +72,7 @@ + diff --git a/src/Fundamentals/Units/Logic/Branching/BranchParams.cs b/src/Fundamentals/Units/Logic/Branching/BranchParams.cs index ea5e50d4..f8b6c897 100644 --- a/src/Fundamentals/Units/Logic/Branching/BranchParams.cs +++ b/src/Fundamentals/Units/Logic/Branching/BranchParams.cs @@ -15,7 +15,7 @@ namespace Bolt.Addons.Community.Fundamentals [TypeIcon(typeof(Branch))] [RenamedFrom("Bolt.Addons.Community.Logic.Units.BranchAnd")] [RenamedFrom("Bolt.Addons.Community.Logic.Units.BranchParams")] - public sealed class BranchParams : LogicParamNode + public sealed class BranchParams : LogicParamNode, IBranchUnit { public BranchParams() { } @@ -31,12 +31,26 @@ public BranchParams() { } [DoNotSerialize] public ControlOutput exitFalse { get; private set; } + [PortLabel("Next")] + [DoNotSerialize] + public ControlOutput exitNext { get; private set; } + + [Serialize] + [Inspectable] + [InspectorLabel("Next Output")] + private bool showNext; + protected override void Definition() { - enter = ControlInput(nameof(enter), (x) => Branch(x)); + enter = ControlInput(nameof(enter), Branch); exitTrue = ControlOutput(nameof(exitTrue)); exitFalse = ControlOutput(nameof(exitFalse)); + if (showNext) + { + exitNext = ControlOutput(nameof(exitNext)); + Succession(enter, exitNext); + } base.Definition(); @@ -51,38 +65,80 @@ protected override void BuildRelations(ValueInput arg) private bool GetValue(Flow flow) { - foreach (var item in arguments) + switch (BranchingType) { - switch (BranchingType) - { - case BranchType.And: + case BranchType.And: + foreach (var item in arguments) + { if (!flow.GetValue(item)) return false; - break; - case BranchType.Or: + } + return true; + case BranchType.Or: + foreach (var item in arguments) + { if (flow.GetValue(item)) return true; - break; - default: - return false; - } - } + } + return false; + case BranchType.GreaterThan: + { + bool NumericComparison(float a, float b, bool allowEquals) + { + return (a > b) || (allowEquals && Mathf.Approximately(a, b)); + } - if (BranchingType == BranchType.And) - return true; + return NumericComparison(flow.GetValue(arguments[0]), flow.GetValue(arguments[1]), AllowEquals); + } + case BranchType.LessThan: + { + bool NumericComparison(float a, float b, bool allowEquals) + { + return (a < b) || (allowEquals && Mathf.Approximately(a, b)); + } - if (BranchingType == BranchType.Or) - return false; + return NumericComparison(flow.GetValue(arguments[0]), flow.GetValue(arguments[1]), AllowEquals); + } + case BranchType.Equal: + if (Numeric) + { + var target = flow.GetValue(arguments[0]); - return false; + for (int i = 1; i < arguments.Count; i++) + { + if (Mathf.Approximately(target, flow.GetValue(arguments[i]))) + return false; + } + return true; + } + else + { + var target = flow.GetValue(arguments[0]); + + for (int i = 1; i < arguments.Count; i++) + { + if (target != flow.GetValue(arguments[i])) + return false; + } + return true; + } + default: + return false; + } } + private ControlOutput Branch(Flow flow) { if (GetValue(flow)) - return exitTrue; + flow.Invoke(exitTrue); else - return exitFalse; + flow.Invoke(exitFalse); + + if (showNext) + return exitNext; + + return null; } } } \ No newline at end of file diff --git a/src/Fundamentals/Units/Logic/Control/DoOnceV2.cs b/src/Fundamentals/Units/Logic/Control/DoOnceV2.cs index 2e8c10e1..f72eb6a1 100644 --- a/src/Fundamentals/Units/Logic/Control/DoOnceV2.cs +++ b/src/Fundamentals/Units/Logic/Control/DoOnceV2.cs @@ -13,6 +13,7 @@ namespace Bolt.Addons.Community.Fundamentals [RenamedFrom("Bolt.Addons.Community.Logic.Units.DoOnceV2")] [UnitTitle("Do Once")] [TypeIcon(typeof(ISelectUnit))] + [Obsolete("Use the build in Once Unit!")] public sealed class DoOnceV2 : Unit { public DoOnceV2() : base() { } diff --git a/src/Fundamentals/Units/Logic/LogicParamNode.cs b/src/Fundamentals/Units/Logic/LogicParamNode.cs index 120c6b51..fc96af81 100644 --- a/src/Fundamentals/Units/Logic/LogicParamNode.cs +++ b/src/Fundamentals/Units/Logic/LogicParamNode.cs @@ -9,7 +9,7 @@ namespace Bolt.Addons.Community.Fundamentals { public abstract class LogicParamNode : VariadicNode { - public enum BranchType { And, Or } + public enum BranchType { And, Or, GreaterThan, LessThan, Equal } [SerializeAs(nameof(BranchingType))] @@ -20,9 +20,76 @@ public enum BranchType { And, Or } public BranchType BranchingType { get { return _branchingType; } set { _branchingType = value; } } + + [DoNotSerialize] + public bool supportsEqual => BranchingType == BranchType.LessThan || BranchingType == BranchType.GreaterThan; + + + + [Serialize] + [InspectorLabel("Allow Equals [[Less, Greater]]")] + [Inspectable] + //[InspectableIf(nameof(supportsEqual))] + protected bool AllowEquals = false; + + + + [DoNotSerialize] + public bool supportsNumeric => BranchingType == BranchType.Equal; + + + [Serialize] + [Inspectable] + [InspectorLabel("Numeric [[Equals]]")] + //[InspectableIf(nameof(supportsNumeric))] + protected bool Numeric = false; + + protected override void Definition() { - base.Definition(); + arguments = new List(); + + switch (BranchingType) + { + case BranchType.And: + case BranchType.Or: + ConstructArgs(); + break; + case BranchType.GreaterThan: + case BranchType.LessThan: + ConstructArgs(); + break; + case BranchType.Equal: + if (Numeric) + ConstructArgs(); + else + ConstructArgs(); + break; + default: + break; + } + } + + private void ConstructArgs() + { + for (var i = 0; i < Math.Min(argumentCount, ArgumentLimit()); i++) + { + var argument = ValueInput(GetArgumentName(i)); + arguments.Add(argument); + BuildRelations(argument); + } + } + + protected virtual string GetArgumentName(int index) + { + return "Arg_" + index; + } + + protected override int ArgumentLimit() + { + if (BranchingType == BranchType.GreaterThan || BranchingType == BranchType.LessThan) + return 2; + return base.ArgumentLimit(); } } } \ No newline at end of file diff --git a/src/Fundamentals/Units/VariadicNode.cs b/src/Fundamentals/Units/VariadicNode.cs index 48cc528d..c92500f6 100644 --- a/src/Fundamentals/Units/VariadicNode.cs +++ b/src/Fundamentals/Units/VariadicNode.cs @@ -26,7 +26,7 @@ public int argumentCount } set { - _argumentCount = Mathf.Clamp(value, 2, 10); + _argumentCount = Mathf.Clamp(value, 2, ArgumentLimit()); } } @@ -36,12 +36,17 @@ protected override void Definition() { arguments = new List(); - for (var i = 0; i < argumentCount; i++) + for (var i = 0; i < Math.Min(argumentCount, ArgumentLimit()); i++) { var argument = ValueInput("Arg_" + i); arguments.Add(argument); BuildRelations(argument); } } + + protected virtual int ArgumentLimit() + { + return 10; + } } } \ No newline at end of file diff --git a/src/Fundamentals/Units/physics/OnParticleTriggerNode.cs b/src/Fundamentals/Units/physics/OnParticleTriggerNode.cs new file mode 100644 index 00000000..72480b9c --- /dev/null +++ b/src/Fundamentals/Units/physics/OnParticleTriggerNode.cs @@ -0,0 +1,72 @@ +using Ludiq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEngine; + +namespace Bolt.Addons.Community.Fundamentals.Units.physics +{ + ///// + ///// Called when a particle hits a trigger. + ///// + //[UnitCategory("Events/Physics")] + //public sealed class OnParticleTriggerNode : GameObjectEventUnit + //{ + // protected override string hookName => EventHooks.OnParticleCollision; + + + // public ValueInput Particles { get; private set; } + + // [PortLabel("Enter")] + // [DoNotSerialize] + // private ValueOutput _enter; + + + // [PortLabel("Exit")] + // [DoNotSerialize] + // private ValueOutput _exit; + + + // [PortLabel("Inside")] + // [DoNotSerialize] + // private ValueOutput _inside; + + // [PortLabel("Outside")] + // [DoNotSerialize] + // public ValueOutput _outside; + + // protected override void Definition() + // { + // base.Definition(); + + // Particles = ValueInput(nameof(Particles)).NullMeansSelf(); + + // _enter = ValueOutput>(nameof(_enter)); + // _exit = ValueOutput>(nameof(_exit)); + // _inside = ValueOutput>(nameof(_inside)); + // _outside = ValueOutput>(nameof(_outside)); + // } + + // //Okay, we need to store the trigger particles list so that we can pass it to the GetTriggerParticlesCall. We can't directly set value. + + + // protected override void AssignArguments(Flow flow, EmptyEventArgs dummyArgs) + // { + // var particles = flow.GetValue(Particles); + + // if (_enter.hasAnyConnection) + // flow.SetValue(this._enter, particles.GetTriggerParticles(ParticleSystemTriggerEventType.Enter, ) + + // flow.SetValue(this.other, other); + + // var collisionEvents = new List(); + + // var data = flow.stack.GetElementData(this); + + // data.target.GetComponent().GetCollisionEvents(other, collisionEvents); + + // flow.SetValue(this.collisionEvents, collisionEvents); + // } + //} +} \ No newline at end of file From f4b591efcabad16d6b404e0117b51cbb7eb207fa Mon Sep 17 00:00:00 2001 From: RealityStop Date: Sat, 29 Sep 2018 03:00:16 -0400 Subject: [PATCH 3/7] Fixed logic flaws in branch params --- src/Fundamentals/Units/Logic/Branching/BranchParams.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Fundamentals/Units/Logic/Branching/BranchParams.cs b/src/Fundamentals/Units/Logic/Branching/BranchParams.cs index f8b6c897..722e94e8 100644 --- a/src/Fundamentals/Units/Logic/Branching/BranchParams.cs +++ b/src/Fundamentals/Units/Logic/Branching/BranchParams.cs @@ -106,7 +106,8 @@ bool NumericComparison(float a, float b, bool allowEquals) for (int i = 1; i < arguments.Count; i++) { - if (Mathf.Approximately(target, flow.GetValue(arguments[i]))) + Debug.Log(flow.GetValue(arguments[i])); + if (!Mathf.Approximately(target, flow.GetValue(arguments[i]))) return false; } return true; @@ -117,7 +118,7 @@ bool NumericComparison(float a, float b, bool allowEquals) for (int i = 1; i < arguments.Count; i++) { - if (target != flow.GetValue(arguments[i])) + if (!OperatorUtility.Equal(target, flow.GetValue(arguments[i]))) return false; } return true; From 7477239a292c324f926dc075bfe2cc8e090fa9d3 Mon Sep 17 00:00:00 2001 From: RealityStop Date: Sat, 29 Sep 2018 03:29:15 -0400 Subject: [PATCH 4/7] Old Nodes obsoleted. --- src/Fundamentals/Units/Logic/Branching/BranchEqual.cs | 1 + src/Fundamentals/Units/Logic/Branching/BranchGreater.cs | 1 + src/Fundamentals/Units/Logic/Branching/BranchLess.cs | 1 + src/Fundamentals/Units/Logic/Branching/BranchNext.cs | 1 + 4 files changed, 4 insertions(+) diff --git a/src/Fundamentals/Units/Logic/Branching/BranchEqual.cs b/src/Fundamentals/Units/Logic/Branching/BranchEqual.cs index bdda1343..0ea35dc4 100644 --- a/src/Fundamentals/Units/Logic/Branching/BranchEqual.cs +++ b/src/Fundamentals/Units/Logic/Branching/BranchEqual.cs @@ -14,6 +14,7 @@ namespace Bolt.Addons.Community.Fundamentals [UnitCategory("Community\\Control")] [RenamedFrom("Bolt.Addons.Community.Logic.Units.BranchEqual")] [UnitOrder(0)] + [Obsolete("Use the Branch (Param) node instead! It supersede this one!")] public sealed class BranchEqual : ComparisonBranch { public BranchEqual() : base() { } diff --git a/src/Fundamentals/Units/Logic/Branching/BranchGreater.cs b/src/Fundamentals/Units/Logic/Branching/BranchGreater.cs index 87772087..bc22d100 100644 --- a/src/Fundamentals/Units/Logic/Branching/BranchGreater.cs +++ b/src/Fundamentals/Units/Logic/Branching/BranchGreater.cs @@ -13,6 +13,7 @@ namespace Bolt.Addons.Community.Fundamentals [UnitCategory("Community\\Control")] [RenamedFrom("Bolt.Addons.Community.Logic.Units.BranchGreater")] [UnitOrder(1)] + [Obsolete("Use the Branch (Param) node instead! It supersede this one!")] public sealed class BranchGreater : ComparisonBranch { public BranchGreater() : base() { } diff --git a/src/Fundamentals/Units/Logic/Branching/BranchLess.cs b/src/Fundamentals/Units/Logic/Branching/BranchLess.cs index 99bda538..6367c76b 100644 --- a/src/Fundamentals/Units/Logic/Branching/BranchLess.cs +++ b/src/Fundamentals/Units/Logic/Branching/BranchLess.cs @@ -13,6 +13,7 @@ namespace Bolt.Addons.Community.Fundamentals [UnitCategory("Community\\Control")] [RenamedFrom("Bolt.Addons.Community.Logic.Units.BranchLess")] [UnitOrder(2)] + [Obsolete("Use the Branch (Param) node instead! It supersede this one!")] public sealed class BranchLess : ComparisonBranch { public BranchLess() : base() { } diff --git a/src/Fundamentals/Units/Logic/Branching/BranchNext.cs b/src/Fundamentals/Units/Logic/Branching/BranchNext.cs index baaa0b4a..58048268 100644 --- a/src/Fundamentals/Units/Logic/Branching/BranchNext.cs +++ b/src/Fundamentals/Units/Logic/Branching/BranchNext.cs @@ -14,6 +14,7 @@ namespace Bolt.Addons.Community.Fundamentals [RenamedFrom("Bolt.Addons.Community.Variables.Units.BranchNext")] [RenamedFrom("Bolt.Addons.Community.Logic.Units.BranchNext")] [UnitOrder(0)] + [Obsolete("Use the Branch (Param) node instead! It supersede this one!")] public sealed class BranchNext : Unit, IBranchUnit { public BranchNext() : base() { } From 68313d08ff4fe3e86635317665ac063ce1163adc Mon Sep 17 00:00:00 2001 From: RealityStop Date: Sun, 30 Sep 2018 00:01:08 -0400 Subject: [PATCH 5/7] Added Icons for branch --- ...ddons.Community.Fundamentals.Editor.csproj | 21 +++++ .../Descriptors/BranchParamsDescriptor.cs | 86 +++++++++++++++++- src/Fundamentals/Resources/Branch_And.png | Bin 0 -> 2203 bytes src/Fundamentals/Resources/Branch_Equal.png | Bin 0 -> 1950 bytes src/Fundamentals/Resources/Branch_Greater.png | Bin 0 -> 2025 bytes .../Resources/Branch_Greater_Equal.png | Bin 0 -> 2023 bytes src/Fundamentals/Resources/Branch_Less.png | Bin 0 -> 2009 bytes .../Resources/Branch_Less_Equal.png | Bin 0 -> 2040 bytes src/Fundamentals/Resources/Branch_Or.png | Bin 0 -> 2199 bytes .../Units/Logic/LogicParamNode.cs | 4 +- 10 files changed, 108 insertions(+), 3 deletions(-) create mode 100644 src/Fundamentals/Resources/Branch_And.png create mode 100644 src/Fundamentals/Resources/Branch_Equal.png create mode 100644 src/Fundamentals/Resources/Branch_Greater.png create mode 100644 src/Fundamentals/Resources/Branch_Greater_Equal.png create mode 100644 src/Fundamentals/Resources/Branch_Less.png create mode 100644 src/Fundamentals/Resources/Branch_Less_Equal.png create mode 100644 src/Fundamentals/Resources/Branch_Or.png diff --git a/src/Fundamentals/Bolt.Addons.Community.Fundamentals.Editor.csproj b/src/Fundamentals/Bolt.Addons.Community.Fundamentals.Editor.csproj index b7c38b60..942c587d 100644 --- a/src/Fundamentals/Bolt.Addons.Community.Fundamentals.Editor.csproj +++ b/src/Fundamentals/Bolt.Addons.Community.Fundamentals.Editor.csproj @@ -95,6 +95,27 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Fundamentals/Editor/Descriptors/BranchParamsDescriptor.cs b/src/Fundamentals/Editor/Descriptors/BranchParamsDescriptor.cs index b9ad28d9..669fd07e 100644 --- a/src/Fundamentals/Editor/Descriptors/BranchParamsDescriptor.cs +++ b/src/Fundamentals/Editor/Descriptors/BranchParamsDescriptor.cs @@ -14,7 +14,91 @@ public BranchParamsDescriptor(BranchParams unit) : base(unit) { } protected override EditorTexture DefinedIcon() { - return EditorTexture.Load(new AssemblyResourceProvider(Assembly.GetExecutingAssembly(), "Bolt.Addons.Community.Fundamentals.Editor", "Resources"), "arrow_switch.png", CreateTextureOptions.PixelPerfect, true); + switch (unit.BranchingType) + { + case LogicParamNode.BranchType.And: + return EditorTexture.Load(new AssemblyResourceProvider(Assembly.GetExecutingAssembly(), "Bolt.Addons.Community.Fundamentals.Editor", "Resources"), "Branch_And.png", CreateTextureOptions.PixelPerfect, true); + case LogicParamNode.BranchType.Or: + return EditorTexture.Load(new AssemblyResourceProvider(Assembly.GetExecutingAssembly(), "Bolt.Addons.Community.Fundamentals.Editor", "Resources"), "Branch_Or.png", CreateTextureOptions.PixelPerfect, true); + case LogicParamNode.BranchType.GreaterThan: + if (unit.AllowEquals) + return EditorTexture.Load(new AssemblyResourceProvider(Assembly.GetExecutingAssembly(), "Bolt.Addons.Community.Fundamentals.Editor", "Resources"), "Branch_Greater_Equal.png", CreateTextureOptions.PixelPerfect, true); + else + return EditorTexture.Load(new AssemblyResourceProvider(Assembly.GetExecutingAssembly(), "Bolt.Addons.Community.Fundamentals.Editor", "Resources"), "Branch_Greater.png", CreateTextureOptions.PixelPerfect, true); + case LogicParamNode.BranchType.LessThan: + if (unit.AllowEquals) + return EditorTexture.Load(new AssemblyResourceProvider(Assembly.GetExecutingAssembly(), "Bolt.Addons.Community.Fundamentals.Editor", "Resources"), "Branch_Less_Equal.png", CreateTextureOptions.PixelPerfect, true); + else + return EditorTexture.Load(new AssemblyResourceProvider(Assembly.GetExecutingAssembly(), "Bolt.Addons.Community.Fundamentals.Editor", "Resources"), "Branch_Less.png", CreateTextureOptions.PixelPerfect, true); + case LogicParamNode.BranchType.Equal: + return EditorTexture.Load(new AssemblyResourceProvider(Assembly.GetExecutingAssembly(), "Bolt.Addons.Community.Fundamentals.Editor", "Resources"), "Branch_Equal.png", CreateTextureOptions.PixelPerfect, true); + default: + return EditorTexture.Load(new AssemblyResourceProvider(Assembly.GetExecutingAssembly(), "Bolt.Addons.Community.Fundamentals.Editor", "Resources"), "arrow_switch.png", CreateTextureOptions.PixelPerfect, true); + } + + } + + protected override void DefinedPort(IUnitPort port, UnitPortDescription description) + { + base.DefinedPort(port, description); + + if (port == unit.exitTrue) + { + switch (unit.BranchingType) + { + case LogicParamNode.BranchType.And: + description.label = "True"; + description.summary = "Exit control flow if all inputs are true."; + break; + case LogicParamNode.BranchType.Or: + description.label = "True"; + description.summary = "Exit control flow if any of the inputs are true."; + break; + case LogicParamNode.BranchType.GreaterThan: + description.label = "Greater"; + description.summary = string.Format("Exit control flow if the first input is greater than {0}the second.", unit.AllowEquals ? "or equal to " : ""); + break; + case LogicParamNode.BranchType.LessThan: + description.label = "Less"; + description.summary = string.Format("Exit control flow if the first input is less than {0}the second.", unit.AllowEquals ? "or equal to " : ""); + break; + case LogicParamNode.BranchType.Equal: + description.label = "Equal"; + description.summary = "Exit control flow if all of the inputs are equal."; + break; + default: + break; + } + } + + if (port == unit.exitFalse) + { + switch (unit.BranchingType) + { + case LogicParamNode.BranchType.And: + description.label = "False"; + description.summary = "Exit control flow if one of the inputs is false."; + break; + case LogicParamNode.BranchType.Or: + description.label = "False"; + description.summary = "Exit control flow if none of the inputs are true."; + break; + case LogicParamNode.BranchType.GreaterThan: + description.label = "Less"; + description.summary = string.Format("Exit control flow if the first input is less than {0}the second.", unit.AllowEquals ? "" : "or equal to "); + break; + case LogicParamNode.BranchType.LessThan: + description.label = "Greater"; + description.summary = string.Format("Exit control flow if the first input is greater than {0}the second.", unit.AllowEquals ? "" : "or equal to "); + break; + case LogicParamNode.BranchType.Equal: + description.label = "Not Equal"; + description.summary = "Exit control flow if any of the inputs are not equal."; + break; + default: + break; + } + } } } } \ No newline at end of file diff --git a/src/Fundamentals/Resources/Branch_And.png b/src/Fundamentals/Resources/Branch_And.png new file mode 100644 index 0000000000000000000000000000000000000000..2326590217ea46a8f8350e553ec765f536f065c6 GIT binary patch literal 2203 zcmV;M2xRw(P)jeH zXlY1#a%EF`PE=!hYhyWNB0oL~Ja{^IZE$U6bYUQPZES9HI(R)IVPtP&WjbziI&Eci zVJ{*ecsh7(aCB=uB3MmOAVY6*Wgs;!H7+nBJ_;Z_a%5&YQba}|cx`NMb2@TlW<4Tk zbaZe!FE4j@cP@7`E^l&YFEKeeIWI6WFETPMa%5&Lb9rubVR$WWb0Z=?3Lqdna%5&Y zL}hbha%pgMX>V>Ia%5&YVPbD}bUh*>FFpz&JTG!&W;#+tMm`EWFL*k5ZE$U6bYVUU zJU@7FVPk7$bRcDJWIZBsB0oMFN~`Js00Dw&Lqkw=Qb$4{Nkv08F*!CiEix`K001bF zb&=02L{SvSKl6tC8c`?`WW`rN-(vzRbd@Kg#9tGZzcj|oq#Sh~ZT!i{P=wkUio z+-b-Kg|8hw?(&nvDVIMSHlpDmDD}er)Gv34hzqCWe27DH5`+eWGKM%lr4`Jsr|Zysr^k%gx8xO9l1X?zg4$VVxP{F|nx|6p^y6E2a4$Yn-G`@K;>F@AGi+I!&V_ZHkmTj&x+}^?AG=5kAH%n{ z%=YlFun!)>F7~-xZUEoF=38Oc%L_v+JAh|k=N)^wuMK+k&xg?8BcGO{ z{RK*wp?~OA9=U5D#vDW(z`pY=V&-#kjk62d{Rgn|2Iy{IPkYOq+?MJ>i7;4+u+?-| zs07w(dQU%!HL$(&2*2-pf)D-&GY~ffu;WGS?hRdRUDu8039^N=WDEUZHIv05gsB#u zd9@%+@I6}#)`K71^9H{?_7ER_0lm*4<^UWya>R+nVkxCmowY$@g%HN`yoo=K{Ur0~ z13O5%X)@WfjOWiG5MV5b5>`%u^%n;)U_5B7O|$2oW9vo80bA0Px?jL?X)X+FWv?hjMj?);~h?Zf55Ex^~mioy|pI|zC9Mt5JI`IB~ zpzrxAz@bBjZceAueeG-8TO*OEF68t0z5&2-G|@WWLH&>_uqzoqHs zM#>|G@`xdsZeqIM;)FD^8aH#MSSq2U(y3HxPeVgP3xJkz;>@d@{Ahl00O>~EwZ3O? zw1ZZ9jyu|6`ht%eiy$Nj32tqK@_@f+yzd#@sJpgUET#aIgcGOWy_XjL$!lvYLJB03 z*|iW%fl>-76?hU=Q{CF0M50hiW34|gp^yUKHh>u>;Ie2a_*-I-Zd^8rl77-Jxi z<4OsRJ-u)zWG0jOSX7HCrK=vimr@X4A0azDg{+at8cB9|iun2nQi`kMXB{Au$($Y- z7?^-Sj<>eM_U9InRhU0ruP{@CNsbar;`T$#ElQdbug2wLcKDRYU>{_<~pTcP8T zP7*5;D5(Ij*6`I=IY!4u7#%-DeB~soTH{2*A(kq~0*Iv3>9(Gpo^9RTn}56_ncPr) zjxnbE_wz?<63H)#g=5&ujWox0pj8+p6`ogNG=GYb!t3bTbJQg&I8OEO4a#u{hyzKW z4p7zS6(IY-bNu&*J$F+pzQY$^o@Q+7bFiQUL|mw?he#B(=9|g!%uoUjbFXT)3gPYi zC1y)!Gh5qtVf`AWis#7YKSN4I{_=2e!Cc~nWR4u)h;91?wyp{8y}gaKEuDOKMF(!E z6|7kDm28e2-zdP0b^i<-SrKHo*2VOCa=h%e>mc@@XZPCuuVFVoIiGXc{})_Wj+YzY ddUE`&eGQcPan6`y@D~68002ovPDHLkV1g962&Mo4 literal 0 HcmV?d00001 diff --git a/src/Fundamentals/Resources/Branch_Equal.png b/src/Fundamentals/Resources/Branch_Equal.png new file mode 100644 index 0000000000000000000000000000000000000000..66b723bdc41e4583dc90a2f3b4db92869470e389 GIT binary patch literal 1950 zcmV;P2VwY$P)jeH zXlY1#a%EF`PE=!hYhyWNB0oL~Ja{^IZE$U6bYUQPZES9HI(R)IVPtP&WjbziI&E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znN=;@QtT)=>DFdPgv_~%MG z=hj}LbNvyNiF#J}vSXAdP$zlmdnrGhin}X-Yem7)c-s>bTNdokG8wv!pn+(hJg6=c zXi+M^t~<-^)vHK+GK(ou^DrB&D5Cfi521nTKcHr3fCj!Vs+8id3o*Ej{B`~o)@TdS zsdl7G-@>6R0Sq9IsT_T!iq1`MQP*?>XU_n491N={j|!`^Av39ziVM3qS?3Q9K*fS% zC7rcS@wSSncSY*nZ;+o0PD}0Eb<$Dm5cRHzw@t*`EaGkQJ*^_0wN6>PX31zL5P+q- zkc*8gW$QOc-p1e)Yp^7S9k6HEzzg)j#HmpzkqW(++|<3(KuuXK1JVyB@n`4-dxnh_ z{ToBY$7FyL4Tm`S`vaK|5{ONSLF+)Ty9W~ICXoN>JQ81>g4i@XjViybspHhRqXAA_fYTogf80GQfD{>DA0~r{3;X$m}jd=Q?^4$?i(0sj#OltZwPWfF!zdqDR*Zod7MBtO`&*PKhl3NNkEif4kdMgeRCVFsHRI0aE^Y_{{BqilAB`Ryot$0{F z-k0-PywwuXzWj}4*wbxDAASc>^qM;wTpaoMCk8gIL$Nt^zX-5i9>R`;Htnmt!zE1C z4orJy8j4xJv580HYU5Q*MaM}h7H;1=A7sZN322~sAv!9F=d&s)+LOxh(qXGMGM4N> z7G}m#ICB|j7F<1zIJ)aWjAOo#oVf<4-WwwUfP&4)gvpRSHJNE~Gf0VH0wL{qya|M|<45=xCdY3B%?d;g00000NkvXX Hu0mjf0I-KT literal 0 HcmV?d00001 diff --git a/src/Fundamentals/Resources/Branch_Greater_Equal.png b/src/Fundamentals/Resources/Branch_Greater_Equal.png new file mode 100644 index 0000000000000000000000000000000000000000..e6e517c00940f1f83daa39825909de46790daee7 GIT binary patch literal 2023 zcmVjeH zXlY1#a%EF`PE=!hYhyWNB0oL~Ja{^IZE$U6bYUQPZES9HI(R)IVPtP&WjbziI&Eci zVJ{*ecsh7(aCB=uB3MmOAVY6*Wgs;!H7+nBJ_;Z_a%5&YQba}|cx`NMb2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FFizP;&2>#XY5&{mqUXi1X7Whro^D=6@N9W;qUlgj7}gL^zyC*9pDAWYCC3|iK~0t zxL)m|<3J~7M-18PXJLsoBL+jd#0b(GeSwubklq0}`hMh{P@IiUgc*PDcSBlMDvLi` zfPLe1hy(SCNeIhpxyBk&_Gzg+2V{!z^6e$CKP=*iX3~p)HmIYeISDKTJ-5i zwkNT0`+TOqHVtX>q3<ii=JsoxOk4s&3 z0KqC3Ak5J7hnqu{hw;8wiimgn^&&)ixd%B8+q6CT2i7uG+wHJtAPj!9=Fzy+dw;Mp} z#(f|;-2^8;8YcmO!Vi#fQy}-zbTU%1n3?z(lZ>e##s5B%g~{=~Aa4WGoapy3*100000NkvXXu0mjfyGNFs literal 0 HcmV?d00001 diff --git a/src/Fundamentals/Resources/Branch_Less_Equal.png b/src/Fundamentals/Resources/Branch_Less_Equal.png new file mode 100644 index 0000000000000000000000000000000000000000..b5d0c55870b806a11d0f04468bde2b86f5d55aa0 GIT binary patch literal 2040 zcmVjeH zXlY1#a%EF`PE=!hYhyWNB0oL~Ja{^IZE$U6bYUQPZES9HI(R)IVPtP&WjbziI&Eci zVJ{*ecsh7(aCB=uB3MmOAVY6*Wgs;!H7+nBJ_;Z_a%5&YQba}|cx`NMb2@TlW<4Tk zbaZe!FE4j@cP@7`E^l&YFEKeeIWI6WFETPMa%5&Lb9rubVR$WWb0Z=?3Lqdna%5&Y zL}hbha%pgMX>V>Ia%5&YVPbD}bUh*>FFpz&JTG!&W;#+tMm`EWFL*k5ZE$U6bYVUU zJU@7FVPk7$bRcDJWIZBsB0oMFN~`Js00Dw&Lqkw=Qb$4{Nkv08F*!CiEix`K001bF zb&=02L{SvSKl6tC8c`?`WW`rN-(vzRbd@Kg#9tGZzcj|oq#Sh~ZT!i{P=wkUio z+-b-Kg|8hw?(&nvDVIMSHlpDmDD}er)Gv34hzqCWe27DH5`+eWGKM%lr4`Jsr|Zysr^k%gx8xO9l1X?zg4$VVxPUqyOp`5|Y#%W0gNxg;7$eE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2rr7z<; z%k4t^-k$BEyuNm{l)Z$)KiE%yed+OI)hjvWYlS-tg*d@0|lS+g>ji z+!8LQG8b}Pg0^YRpSR0WP{Pv){clm$?`x}ZGQKj~j}26rbx>g=%18B`fMZ1GhTK>O z=uEu0fTcTqbO?5Mb6#Y_#&vmNVX3-Eu6aB|=&^Qa^kACXNMi!ia(w%};;zboaEf}V z%kb_>TmqWv+55brsX%CEuC_oxDpkGjPPUFtm(1Nwu?2OKrCxDM1=nlGi~YvNenBan z%D04bKim3liPpwi-0PLE_&uIiw9*z%{$AGJO5K>L1v{LKe4eivKSo&ceDN`-c}DfNlW+6?Zj&pOPcfJh!Gd z&*)b(*?HXAvS`_Rsq_%87FxOI$JS0o4v&UZ Selq@OpD;gfV^U${9`!$k2k@u> literal 0 HcmV?d00001 diff --git a/src/Fundamentals/Units/Logic/LogicParamNode.cs b/src/Fundamentals/Units/Logic/LogicParamNode.cs index fc96af81..78df32f0 100644 --- a/src/Fundamentals/Units/Logic/LogicParamNode.cs +++ b/src/Fundamentals/Units/Logic/LogicParamNode.cs @@ -30,7 +30,7 @@ public enum BranchType { And, Or, GreaterThan, LessThan, Equal } [InspectorLabel("Allow Equals [[Less, Greater]]")] [Inspectable] //[InspectableIf(nameof(supportsEqual))] - protected bool AllowEquals = false; + public bool AllowEquals = false; @@ -42,7 +42,7 @@ public enum BranchType { And, Or, GreaterThan, LessThan, Equal } [Inspectable] [InspectorLabel("Numeric [[Equals]]")] //[InspectableIf(nameof(supportsNumeric))] - protected bool Numeric = false; + public bool Numeric = false; protected override void Definition() From f0e5ac35ea6e3e8ac2241753a7458fb238bab867 Mon Sep 17 00:00:00 2001 From: RealityStop Date: Sun, 30 Sep 2018 00:33:29 -0400 Subject: [PATCH 6/7] Minor Updates to branch documentation. --- src/Fundamentals/Editor/Descriptors/BranchParamsDescriptor.cs | 3 +++ src/Fundamentals/Units/Logic/LogicParamNode.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Fundamentals/Editor/Descriptors/BranchParamsDescriptor.cs b/src/Fundamentals/Editor/Descriptors/BranchParamsDescriptor.cs index 669fd07e..6b958be6 100644 --- a/src/Fundamentals/Editor/Descriptors/BranchParamsDescriptor.cs +++ b/src/Fundamentals/Editor/Descriptors/BranchParamsDescriptor.cs @@ -42,6 +42,9 @@ protected override void DefinedPort(IUnitPort port, UnitPortDescription descript { base.DefinedPort(port, description); + if (port == unit.exitNext) + description.summary = "Exit control flow after True/False evaluation. Will always be called following the comparison."; + if (port == unit.exitTrue) { switch (unit.BranchingType) diff --git a/src/Fundamentals/Units/Logic/LogicParamNode.cs b/src/Fundamentals/Units/Logic/LogicParamNode.cs index 78df32f0..98330b48 100644 --- a/src/Fundamentals/Units/Logic/LogicParamNode.cs +++ b/src/Fundamentals/Units/Logic/LogicParamNode.cs @@ -27,7 +27,7 @@ public enum BranchType { And, Or, GreaterThan, LessThan, Equal } [Serialize] - [InspectorLabel("Allow Equals [[Less, Greater]]")] + [InspectorLabel("[[<,>]] Allow Equals")] [Inspectable] //[InspectableIf(nameof(supportsEqual))] public bool AllowEquals = false; @@ -40,7 +40,7 @@ public enum BranchType { And, Or, GreaterThan, LessThan, Equal } [Serialize] [Inspectable] - [InspectorLabel("Numeric [[Equals]]")] + [InspectorLabel("[[ = ]] Numeric")] //[InspectableIf(nameof(supportsNumeric))] public bool Numeric = false; From 11a61755ca6c5abb063fb29aea781fff23688aa4 Mon Sep 17 00:00:00 2001 From: RealityStop Date: Sat, 13 Oct 2018 02:51:29 -0400 Subject: [PATCH 7/7] Added Jason's Super Awesome Manual Event --- src/Bolt.Addons.Community.sln | 63 +++++++++++++++++ src/Event Types.txt | 8 +++ ...ddons.Community.Fundamentals.Editor.csproj | 6 ++ .../Bolt.Addons.Community.Fundamentals.csproj | 8 ++- .../Editor/Controls/UnitButton.cs | 10 +++ .../Editor/Controls/UnitButtonAttribute.cs | 18 +++++ .../Editor/Controls/UnitButtonInspector.cs | 51 ++++++++++++++ .../Controls/UnitButtonPropertyDrawer.cs | 13 ++++ .../Inspectors/BranchParamsInspector.cs | 54 +++++++++++++++ .../Units/FlowEvents/ManualEvent.cs | 28 ++++++++ .../Units/Logic/LogicParamNode.cs | 12 +++- .../Units/Variables/OnVariableChanged.cs | 2 +- ...olt.Addons.Community.Utility.Editor.csproj | 68 +++++++++++++++++++ .../Bolt.Addons.Community.Utility.csproj | 44 ++++++++++++ src/Utility/Editor/UnitButtonInspector.cs | 52 ++++++++++++++ .../Editor/UnitButtonPropertyDrawer.cs | 13 ++++ src/Utility/Properties/AssemblyInfo.Editor.cs | 36 ++++++++++ src/Utility/Properties/AssemblyInfo.cs | 36 ++++++++++ src/Utility/UnitButton.cs | 10 +++ src/Utility/UnitButtonAttribute.cs | 18 +++++ 20 files changed, 545 insertions(+), 5 deletions(-) create mode 100644 src/Event Types.txt create mode 100644 src/Fundamentals/Editor/Controls/UnitButton.cs create mode 100644 src/Fundamentals/Editor/Controls/UnitButtonAttribute.cs create mode 100644 src/Fundamentals/Editor/Controls/UnitButtonInspector.cs create mode 100644 src/Fundamentals/Editor/Controls/UnitButtonPropertyDrawer.cs create mode 100644 src/Fundamentals/Editor/Inspectors/BranchParamsInspector.cs create mode 100644 src/Fundamentals/Units/FlowEvents/ManualEvent.cs create mode 100644 src/Utility/Bolt.Addons.Community.Utility.Editor.csproj create mode 100644 src/Utility/Bolt.Addons.Community.Utility.csproj create mode 100644 src/Utility/Editor/UnitButtonInspector.cs create mode 100644 src/Utility/Editor/UnitButtonPropertyDrawer.cs create mode 100644 src/Utility/Properties/AssemblyInfo.Editor.cs create mode 100644 src/Utility/Properties/AssemblyInfo.cs create mode 100644 src/Utility/UnitButton.cs create mode 100644 src/Utility/UnitButtonAttribute.cs diff --git a/src/Bolt.Addons.Community.sln b/src/Bolt.Addons.Community.sln index 50e0bc7f..71408728 100644 --- a/src/Bolt.Addons.Community.sln +++ b/src/Bolt.Addons.Community.sln @@ -28,51 +28,114 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bolt.Addons.Community.Funda EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bolt.Addons.Community.Events", "Events\Bolt.Addons.Community.Events.csproj", "{33411767-CA47-4D3B-A82C-D77AB4C5FA97}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "API Documentation", "API Documentation", "{E404D72B-E478-4BE1-8DFE-6DBEAD56B784}" + ProjectSection(SolutionItems) = preProject + Event Types.txt = Event Types.txt + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utility", "Utility", "{4C7742BC-F6EB-463D-BB44-2783BEC16520}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Events", "Events", "{7D856461-F36E-4843-AA41-C908A2FA7E2C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bolt.Addons.Community.Utility", "Utility\Bolt.Addons.Community.Utility.csproj", "{A2FDB1FB-E259-45C0-B46A-4E416110BBB3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bolt.Addons.Community.Utility.Editor", "Utility\Bolt.Addons.Community.Utility.Editor.csproj", "{FCADD801-FF9E-46E5-A573-E06FA0C8661B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU Release3.5|Any CPU = Release3.5|Any CPU Release4.6|Any CPU = Release4.6|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A48FB4F2-A962-4628-8F1E-35191B078F43}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {A48FB4F2-A962-4628-8F1E-35191B078F43}.Release|Any CPU.ActiveCfg = Release|Any CPU {A48FB4F2-A962-4628-8F1E-35191B078F43}.Release3.5|Any CPU.ActiveCfg = Release|Any CPU {A48FB4F2-A962-4628-8F1E-35191B078F43}.Release4.6|Any CPU.ActiveCfg = Release|Any CPU + {63E0BE87-2979-4275-A37E-B7F8CBD365F9}.Debug|Any CPU.ActiveCfg = Release4.6|Any CPU + {63E0BE87-2979-4275-A37E-B7F8CBD365F9}.Debug|Any CPU.Build.0 = Release4.6|Any CPU + {63E0BE87-2979-4275-A37E-B7F8CBD365F9}.Release|Any CPU.ActiveCfg = Release4.6|Any CPU + {63E0BE87-2979-4275-A37E-B7F8CBD365F9}.Release|Any CPU.Build.0 = Release4.6|Any CPU {63E0BE87-2979-4275-A37E-B7F8CBD365F9}.Release3.5|Any CPU.ActiveCfg = Release3.5|Any CPU {63E0BE87-2979-4275-A37E-B7F8CBD365F9}.Release3.5|Any CPU.Build.0 = Release3.5|Any CPU {63E0BE87-2979-4275-A37E-B7F8CBD365F9}.Release4.6|Any CPU.ActiveCfg = Release4.6|Any CPU {63E0BE87-2979-4275-A37E-B7F8CBD365F9}.Release4.6|Any CPU.Build.0 = Release4.6|Any CPU + {A92A0A22-56D4-4B8A-9623-913B6846A106}.Debug|Any CPU.ActiveCfg = Release4.6|Any CPU + {A92A0A22-56D4-4B8A-9623-913B6846A106}.Debug|Any CPU.Build.0 = Release4.6|Any CPU + {A92A0A22-56D4-4B8A-9623-913B6846A106}.Release|Any CPU.ActiveCfg = Release4.6|Any CPU + {A92A0A22-56D4-4B8A-9623-913B6846A106}.Release|Any CPU.Build.0 = Release4.6|Any CPU {A92A0A22-56D4-4B8A-9623-913B6846A106}.Release3.5|Any CPU.ActiveCfg = Release3.5|Any CPU {A92A0A22-56D4-4B8A-9623-913B6846A106}.Release3.5|Any CPU.Build.0 = Release3.5|Any CPU {A92A0A22-56D4-4B8A-9623-913B6846A106}.Release4.6|Any CPU.ActiveCfg = Release4.6|Any CPU {A92A0A22-56D4-4B8A-9623-913B6846A106}.Release4.6|Any CPU.Build.0 = Release4.6|Any CPU + {5E5C0512-81BC-4C47-878C-89F723D1A589}.Debug|Any CPU.ActiveCfg = Release4.6|Any CPU + {5E5C0512-81BC-4C47-878C-89F723D1A589}.Debug|Any CPU.Build.0 = Release4.6|Any CPU + {5E5C0512-81BC-4C47-878C-89F723D1A589}.Release|Any CPU.ActiveCfg = Release4.6|Any CPU + {5E5C0512-81BC-4C47-878C-89F723D1A589}.Release|Any CPU.Build.0 = Release4.6|Any CPU {5E5C0512-81BC-4C47-878C-89F723D1A589}.Release3.5|Any CPU.ActiveCfg = Release3.5|Any CPU {5E5C0512-81BC-4C47-878C-89F723D1A589}.Release3.5|Any CPU.Build.0 = Release3.5|Any CPU {5E5C0512-81BC-4C47-878C-89F723D1A589}.Release4.6|Any CPU.ActiveCfg = Release4.6|Any CPU {5E5C0512-81BC-4C47-878C-89F723D1A589}.Release4.6|Any CPU.Build.0 = Release4.6|Any CPU + {3251CB2C-90A6-4EB2-9F39-5BD80FB032A0}.Debug|Any CPU.ActiveCfg = Release4.6|Any CPU + {3251CB2C-90A6-4EB2-9F39-5BD80FB032A0}.Debug|Any CPU.Build.0 = Release4.6|Any CPU + {3251CB2C-90A6-4EB2-9F39-5BD80FB032A0}.Release|Any CPU.ActiveCfg = Release4.6|Any CPU + {3251CB2C-90A6-4EB2-9F39-5BD80FB032A0}.Release|Any CPU.Build.0 = Release4.6|Any CPU {3251CB2C-90A6-4EB2-9F39-5BD80FB032A0}.Release3.5|Any CPU.ActiveCfg = Release3.5|Any CPU {3251CB2C-90A6-4EB2-9F39-5BD80FB032A0}.Release3.5|Any CPU.Build.0 = Release3.5|Any CPU {3251CB2C-90A6-4EB2-9F39-5BD80FB032A0}.Release4.6|Any CPU.ActiveCfg = Release4.6|Any CPU {3251CB2C-90A6-4EB2-9F39-5BD80FB032A0}.Release4.6|Any CPU.Build.0 = Release4.6|Any CPU + {C7FA2FB0-ACD3-4957-A653-979AFADC3145}.Debug|Any CPU.ActiveCfg = Release4.6|Any CPU + {C7FA2FB0-ACD3-4957-A653-979AFADC3145}.Debug|Any CPU.Build.0 = Release4.6|Any CPU + {C7FA2FB0-ACD3-4957-A653-979AFADC3145}.Release|Any CPU.ActiveCfg = Release4.6|Any CPU + {C7FA2FB0-ACD3-4957-A653-979AFADC3145}.Release|Any CPU.Build.0 = Release4.6|Any CPU {C7FA2FB0-ACD3-4957-A653-979AFADC3145}.Release3.5|Any CPU.ActiveCfg = Release3.5|Any CPU {C7FA2FB0-ACD3-4957-A653-979AFADC3145}.Release3.5|Any CPU.Build.0 = Release3.5|Any CPU {C7FA2FB0-ACD3-4957-A653-979AFADC3145}.Release4.6|Any CPU.ActiveCfg = Release4.6|Any CPU {C7FA2FB0-ACD3-4957-A653-979AFADC3145}.Release4.6|Any CPU.Build.0 = Release4.6|Any CPU + {3CE813EF-2925-41C5-B8BA-D8F2BE90058B}.Debug|Any CPU.ActiveCfg = Release4.6|Any CPU + {3CE813EF-2925-41C5-B8BA-D8F2BE90058B}.Debug|Any CPU.Build.0 = Release4.6|Any CPU + {3CE813EF-2925-41C5-B8BA-D8F2BE90058B}.Release|Any CPU.ActiveCfg = Release4.6|Any CPU + {3CE813EF-2925-41C5-B8BA-D8F2BE90058B}.Release|Any CPU.Build.0 = Release4.6|Any CPU {3CE813EF-2925-41C5-B8BA-D8F2BE90058B}.Release3.5|Any CPU.ActiveCfg = Release3.5|Any CPU {3CE813EF-2925-41C5-B8BA-D8F2BE90058B}.Release3.5|Any CPU.Build.0 = Release3.5|Any CPU {3CE813EF-2925-41C5-B8BA-D8F2BE90058B}.Release4.6|Any CPU.ActiveCfg = Release4.6|Any CPU {3CE813EF-2925-41C5-B8BA-D8F2BE90058B}.Release4.6|Any CPU.Build.0 = Release4.6|Any CPU + {33411767-CA47-4D3B-A82C-D77AB4C5FA97}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {33411767-CA47-4D3B-A82C-D77AB4C5FA97}.Release|Any CPU.ActiveCfg = Release|Any CPU {33411767-CA47-4D3B-A82C-D77AB4C5FA97}.Release3.5|Any CPU.ActiveCfg = Release|Any CPU {33411767-CA47-4D3B-A82C-D77AB4C5FA97}.Release4.6|Any CPU.ActiveCfg = Release|Any CPU + {A2FDB1FB-E259-45C0-B46A-4E416110BBB3}.Debug|Any CPU.ActiveCfg = Release3.5|Any CPU + {A2FDB1FB-E259-45C0-B46A-4E416110BBB3}.Debug|Any CPU.Build.0 = Release3.5|Any CPU + {A2FDB1FB-E259-45C0-B46A-4E416110BBB3}.Release|Any CPU.ActiveCfg = Release3.5|Any CPU + {A2FDB1FB-E259-45C0-B46A-4E416110BBB3}.Release|Any CPU.Build.0 = Release3.5|Any CPU + {A2FDB1FB-E259-45C0-B46A-4E416110BBB3}.Release3.5|Any CPU.ActiveCfg = Release3.5|Any CPU + {A2FDB1FB-E259-45C0-B46A-4E416110BBB3}.Release3.5|Any CPU.Build.0 = Release3.5|Any CPU + {A2FDB1FB-E259-45C0-B46A-4E416110BBB3}.Release4.6|Any CPU.ActiveCfg = Release4.6|Any CPU + {A2FDB1FB-E259-45C0-B46A-4E416110BBB3}.Release4.6|Any CPU.Build.0 = Release4.6|Any CPU + {FCADD801-FF9E-46E5-A573-E06FA0C8661B}.Debug|Any CPU.ActiveCfg = Release3.5|Any CPU + {FCADD801-FF9E-46E5-A573-E06FA0C8661B}.Debug|Any CPU.Build.0 = Release3.5|Any CPU + {FCADD801-FF9E-46E5-A573-E06FA0C8661B}.Release|Any CPU.ActiveCfg = Release3.5|Any CPU + {FCADD801-FF9E-46E5-A573-E06FA0C8661B}.Release|Any CPU.Build.0 = Release3.5|Any CPU + {FCADD801-FF9E-46E5-A573-E06FA0C8661B}.Release3.5|Any CPU.ActiveCfg = Release3.5|Any CPU + {FCADD801-FF9E-46E5-A573-E06FA0C8661B}.Release3.5|Any CPU.Build.0 = Release3.5|Any CPU + {FCADD801-FF9E-46E5-A573-E06FA0C8661B}.Release4.6|Any CPU.ActiveCfg = Release4.6|Any CPU + {FCADD801-FF9E-46E5-A573-E06FA0C8661B}.Release4.6|Any CPU.Build.0 = Release4.6|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution + {A48FB4F2-A962-4628-8F1E-35191B078F43} = {7D856461-F36E-4843-AA41-C908A2FA7E2C} {63E0BE87-2979-4275-A37E-B7F8CBD365F9} = {0F6B5AB0-D090-41AF-9266-29998CC557E7} {A92A0A22-56D4-4B8A-9623-913B6846A106} = {0F6B5AB0-D090-41AF-9266-29998CC557E7} {5E5C0512-81BC-4C47-878C-89F723D1A589} = {0F6B5AB0-D090-41AF-9266-29998CC557E7} {3251CB2C-90A6-4EB2-9F39-5BD80FB032A0} = {0F6B5AB0-D090-41AF-9266-29998CC557E7} {C7FA2FB0-ACD3-4957-A653-979AFADC3145} = {F1756C9F-2895-479E-811A-6E7AA3086E57} {3CE813EF-2925-41C5-B8BA-D8F2BE90058B} = {F1756C9F-2895-479E-811A-6E7AA3086E57} + {33411767-CA47-4D3B-A82C-D77AB4C5FA97} = {7D856461-F36E-4843-AA41-C908A2FA7E2C} + {A2FDB1FB-E259-45C0-B46A-4E416110BBB3} = {4C7742BC-F6EB-463D-BB44-2783BEC16520} + {FCADD801-FF9E-46E5-A573-E06FA0C8661B} = {4C7742BC-F6EB-463D-BB44-2783BEC16520} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FBD3EB6F-0BDA-4218-8D0C-0756C8AFE605} diff --git a/src/Event Types.txt b/src/Event Types.txt new file mode 100644 index 00000000..35393b9d --- /dev/null +++ b/src/Event Types.txt @@ -0,0 +1,8 @@ +@Reality.Stop() Here goes for the type of events: + +- Global Event: Is triggered to the event bus (EventBus.Trigger) on all handlers. +- Game Object Event: Is triggered through the event bus (EventBus.Trigger), but only on handlers where the EventHook's target matches. (Basically: "local" events) +- Manual Event: Will have to get triggered through TriggerEventHandler. Usually used for special cases & edit mode stuff like gizmos. +- Event (abstract): None of this is very well defined, so you can derive it to implement really customized events. + +It's important to note that the event bus does not exist during edit mode, so if you need to run graph code then, you'll probably need Manual Event. \ No newline at end of file diff --git a/src/Fundamentals/Bolt.Addons.Community.Fundamentals.Editor.csproj b/src/Fundamentals/Bolt.Addons.Community.Fundamentals.Editor.csproj index 942c587d..787f1bf3 100644 --- a/src/Fundamentals/Bolt.Addons.Community.Fundamentals.Editor.csproj +++ b/src/Fundamentals/Bolt.Addons.Community.Fundamentals.Editor.csproj @@ -58,6 +58,11 @@ + + + + + @@ -116,6 +121,7 @@ + \ No newline at end of file diff --git a/src/Fundamentals/Bolt.Addons.Community.Fundamentals.csproj b/src/Fundamentals/Bolt.Addons.Community.Fundamentals.csproj index 91f7e3a0..e0f4d63b 100644 --- a/src/Fundamentals/Bolt.Addons.Community.Fundamentals.csproj +++ b/src/Fundamentals/Bolt.Addons.Community.Fundamentals.csproj @@ -39,6 +39,7 @@ + @@ -80,7 +81,12 @@ - + + + {a2fdb1fb-e259-45c0-b46a-4e416110bbb3} + Bolt.Addons.Community.Utility + + \ No newline at end of file diff --git a/src/Fundamentals/Editor/Controls/UnitButton.cs b/src/Fundamentals/Editor/Controls/UnitButton.cs new file mode 100644 index 00000000..9d1dea7f --- /dev/null +++ b/src/Fundamentals/Editor/Controls/UnitButton.cs @@ -0,0 +1,10 @@ +using Ludiq; + +namespace Bolt.Community.Addons.Fundamentals.Editor.Controls +{ + [Inspectable] + public class UnitButton + { + public System.Action action; + } +} \ No newline at end of file diff --git a/src/Fundamentals/Editor/Controls/UnitButtonAttribute.cs b/src/Fundamentals/Editor/Controls/UnitButtonAttribute.cs new file mode 100644 index 00000000..9e352022 --- /dev/null +++ b/src/Fundamentals/Editor/Controls/UnitButtonAttribute.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Bolt.Community.Addons.Fundamentals.Editor.Controls +{ + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)] + public class UnitButtonAttribute : Attribute + { + public string action; + + public UnitButtonAttribute(string action) + { + this.action = action; + } + } +} \ No newline at end of file diff --git a/src/Fundamentals/Editor/Controls/UnitButtonInspector.cs b/src/Fundamentals/Editor/Controls/UnitButtonInspector.cs new file mode 100644 index 00000000..6ea04fcf --- /dev/null +++ b/src/Fundamentals/Editor/Controls/UnitButtonInspector.cs @@ -0,0 +1,51 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Ludiq; +using System.Reflection; +using System; + +namespace Bolt.Community.Addons.Fundamentals.Editor.Controls +{ + [Inspector(typeof(UnitButton) )] + public class UnitButtonInspector : Inspector + { + public UnitButtonInspector(Metadata metadata) : base(metadata) { } + + protected override float GetHeight(float width, GUIContent label) + { + return 16; + } + + protected override void OnGUI(Rect position, GUIContent label) + { + BeginBlock(metadata, position, GUIContent.none); + + var buttonPosition = new Rect( + position.x, + position.y, + position.width + 8, + 16 + ); + + if (GUI.Button(buttonPosition, "Trigger", new GUIStyle(UnityEditor.EditorStyles.miniButton))) + { + var attribute = metadata.GetAttribute(true); + + if (attribute != null) + { + var method = attribute.action; + + object typeObject = metadata.parent.value; + typeObject.GetType().GetMethod(method).Invoke(typeObject, new object[0] { }); + + } + } + + if (EndBlock(metadata)) + { + metadata.RecordUndo(); + } + } + } +} \ No newline at end of file diff --git a/src/Fundamentals/Editor/Controls/UnitButtonPropertyDrawer.cs b/src/Fundamentals/Editor/Controls/UnitButtonPropertyDrawer.cs new file mode 100644 index 00000000..6ee8148b --- /dev/null +++ b/src/Fundamentals/Editor/Controls/UnitButtonPropertyDrawer.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace Bolt.Community.Addons.Fundamentals.Editor.Controls +{ + [CustomPropertyDrawer(typeof(UnitButton))] + public class UnitButtonPropertyDrawer : PropertyDrawer + { + + } +} \ No newline at end of file diff --git a/src/Fundamentals/Editor/Inspectors/BranchParamsInspector.cs b/src/Fundamentals/Editor/Inspectors/BranchParamsInspector.cs new file mode 100644 index 00000000..2e90d1dd --- /dev/null +++ b/src/Fundamentals/Editor/Inspectors/BranchParamsInspector.cs @@ -0,0 +1,54 @@ +//using Ludiq; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using UnityEngine; + +//namespace Bolt.Addons.Community.Fundamentals.Editor.Editor.Inspectors +//{ +// [Inspector(typeof(BranchParams))] +// public class BranchParamsInspector : ReflectedInspector +// { +// public BranchParamsInspector(Metadata metadata) : base(metadata) +// { +// } +///* +// protected override void OnMemberGUI(Metadata member, Rect memberPosition) +// { +// Debug.Log(member.path); +// foreach (var item in member.Keys) +// { +// Debug.Log("--" + item); +// } + +// if (member.path.Equals("Root.FlowGraph.elements.BranchParams.AllowEquals", StringComparison.CurrentCultureIgnoreCase)) +// { +// //Debug.Log("a"); +// //Debug.Log(member.parent["SupportsEqual"]); +// //Debug.Log("a2"); + +// //var val = member.parent.Member("Root.FlowGraph.elements.BranchParams.supportsEqual"); + +// //Debug.Log("b"); +// //if (val != null) +// //{ + +// // Debug.Log("c"); +// // Debug.Log(val.path); +// //} + + +// //Debug.Log("d"); +// //Debug.Log(member.parent["Root.FlowGraph.elements.BranchParams.supportsEqual"].value); + +// //if (!((bool)member.parent["Root.FlowGraph.elements.BranchParams.supportsEqual"].value)) +// // return; +// } + +// base.OnMemberGUI(member, memberPosition); +// } +// } +// */ +//} diff --git a/src/Fundamentals/Units/FlowEvents/ManualEvent.cs b/src/Fundamentals/Units/FlowEvents/ManualEvent.cs new file mode 100644 index 00000000..a81b7006 --- /dev/null +++ b/src/Fundamentals/Units/FlowEvents/ManualEvent.cs @@ -0,0 +1,28 @@ +using Bolt; +using Bolt.Community.Addons.Utility; +using Ludiq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Bolt.Addons.Community.Fundamentals.Units.FlowEvents +{ + [UnitCategory("Events/Editor")] + [UnitShortTitle("Manual Event")] + [UnitTitle("Manual Event")] + public class ManualEvent : ManualEventUnit + { + protected override string hookName { get { return "EditorButtonEvent"; } } + + [UnitHeaderInspectable] + [UnitButton("TriggerButton")] + public UnitButton triggerButton; + + public void TriggerButton(GraphReference reference) + { + Flow flow = Flow.New(reference); + flow.Invoke(trigger); + } + } +} diff --git a/src/Fundamentals/Units/Logic/LogicParamNode.cs b/src/Fundamentals/Units/Logic/LogicParamNode.cs index 98330b48..a565040e 100644 --- a/src/Fundamentals/Units/Logic/LogicParamNode.cs +++ b/src/Fundamentals/Units/Logic/LogicParamNode.cs @@ -26,10 +26,14 @@ public enum BranchType { And, Or, GreaterThan, LessThan, Equal } + + /// + /// Adds Equals to the comparison such that a Less comparison becomes a Less Than or Equals and a Greater comparison becomes a Greater Than or Equals. Has no effect on other comparison modes. + /// [Serialize] [InspectorLabel("[[<,>]] Allow Equals")] [Inspectable] - //[InspectableIf(nameof(supportsEqual))] + [InspectorExpandTooltip] public bool AllowEquals = false; @@ -37,11 +41,13 @@ public enum BranchType { And, Or, GreaterThan, LessThan, Equal } [DoNotSerialize] public bool supportsNumeric => BranchingType == BranchType.Equal; - + /// + /// Makes an Equals comparison a Numeric comparison, allowing approximately close values to match. + /// [Serialize] [Inspectable] [InspectorLabel("[[ = ]] Numeric")] - //[InspectableIf(nameof(supportsNumeric))] + [InspectableIf(nameof(supportsNumeric))] public bool Numeric = false; diff --git a/src/Fundamentals/Units/Variables/OnVariableChanged.cs b/src/Fundamentals/Units/Variables/OnVariableChanged.cs index ba3fcee7..5b626db2 100644 --- a/src/Fundamentals/Units/Variables/OnVariableChanged.cs +++ b/src/Fundamentals/Units/Variables/OnVariableChanged.cs @@ -79,7 +79,7 @@ protected override void Definition() if (provideInitial) { - Initial = ValueInput(nameof(Initial)); + Initial = ValueInput(nameof(Initial)).AllowsNull(); Requirement(Initial, value); } diff --git a/src/Utility/Bolt.Addons.Community.Utility.Editor.csproj b/src/Utility/Bolt.Addons.Community.Utility.Editor.csproj new file mode 100644 index 00000000..2948b758 --- /dev/null +++ b/src/Utility/Bolt.Addons.Community.Utility.Editor.csproj @@ -0,0 +1,68 @@ + + + + + Debug + AnyCPU + {FCADD801-FF9E-46E5-A573-E06FA0C8661B} + Library + Properties + Bolt.Addons.Community.Utility.Editor + Bolt.Addons.Community.Utility.Editor + 512 + + + + + $(SolutionDir)\..\Dependencies\\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Bolt.Core.Runtime.dll + + + $(SolutionDir)\..\Dependencies\\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Bolt.Flow.Runtime.dll + + + $(SolutionDir)\..\Dependencies\\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Ludiq.Core.Runtime.dll + + + $(SolutionDir)\..\Dependencies\\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Ludiq.Graphs.Runtime.dll + + + $(SolutionDir)\..\Dependencies\\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Bolt.Core.Editor.dll + + + $(SolutionDir)\..\Dependencies\\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Bolt.Flow.Editor.dll + + + $(SolutionDir)\..\Dependencies\\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Bolt.State.Editor.dll + + + $(SolutionDir)\..\Dependencies\\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Ludiq.Core.Editor.dll + + + $(SolutionDir)\..\Dependencies\\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Ludiq.Graphs.Editor.dll + + + + + $(SolutionDir)\..\Dependencies\\UnityBinaries\UnityEngine.dll + + + $(SolutionDir)\..\Dependencies\\UnityBinaries\UnityEngine.UI.dll + + + $(SolutionDir)\..\Dependencies\\UnityBinaries\UnityEditor.dll + + + + + + + + + + {a2fdb1fb-e259-45c0-b46a-4e416110bbb3} + Bolt.Addons.Community.Utility + + + + + \ No newline at end of file diff --git a/src/Utility/Bolt.Addons.Community.Utility.csproj b/src/Utility/Bolt.Addons.Community.Utility.csproj new file mode 100644 index 00000000..35a66a01 --- /dev/null +++ b/src/Utility/Bolt.Addons.Community.Utility.csproj @@ -0,0 +1,44 @@ + + + + + Debug + AnyCPU + {A2FDB1FB-E259-45C0-B46A-4E416110BBB3} + Library + Properties + Bolt.Addons.Community.Utility + Bolt.Addons.Community.Utility + 512 + + + + + $(SolutionDir)..\Dependencies\UnityBinaries\UnityEngine.dll + + + $(SolutionDir)..\Dependencies\UnityBinaries\UnityEngine.UI.dll + + + $(SolutionDir)\..\Dependencies\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Bolt.Core.Runtime.dll + + + $(SolutionDir)..\Dependencies\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Bolt.Flow.Runtime.dll + + + $(SolutionDir)..\Dependencies\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Ludiq.Core.Runtime.dll + + + $(SolutionDir)..\Dependencies\BoltBinaries\$(BoltVersion)\.NET$(TargetFrameworkVersionNumber)\Ludiq.Graphs.Runtime.dll + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Utility/Editor/UnitButtonInspector.cs b/src/Utility/Editor/UnitButtonInspector.cs new file mode 100644 index 00000000..1da2f36a --- /dev/null +++ b/src/Utility/Editor/UnitButtonInspector.cs @@ -0,0 +1,52 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Ludiq; +using System.Reflection; +using System; + +namespace Bolt.Community.Addons.Utility.Editor +{ + [Inspector(typeof(UnitButton) )] + public class UnitButtonInspector : Inspector + { + public UnitButtonInspector(Metadata metadata) : base(metadata) { } + + protected override float GetHeight(float width, GUIContent label) + { + return 16; + } + + protected override void OnGUI(Rect position, GUIContent label) + { + BeginBlock(metadata, position, GUIContent.none); + + var buttonPosition = new Rect( + position.x, + position.y, + position.width + 8, + 16 + ); + + if (GUI.Button(buttonPosition, "Trigger", new GUIStyle(UnityEditor.EditorStyles.miniButton))) + { + var attribute = metadata.GetAttribute(true); + + if (attribute != null) + { + var method = attribute.action; + + object typeObject = metadata.parent.value; + GraphReference reference = GraphWindow.activeReference; + typeObject.GetType().GetMethod(method).Invoke(typeObject, new object[1] { reference }); + + } + } + + if (EndBlock(metadata)) + { + metadata.RecordUndo(); + } + } + } +} \ No newline at end of file diff --git a/src/Utility/Editor/UnitButtonPropertyDrawer.cs b/src/Utility/Editor/UnitButtonPropertyDrawer.cs new file mode 100644 index 00000000..0166a3d4 --- /dev/null +++ b/src/Utility/Editor/UnitButtonPropertyDrawer.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace Bolt.Community.Addons.Utility.Editor +{ + [CustomPropertyDrawer(typeof(UnitButton))] + public class UnitButtonPropertyDrawer : PropertyDrawer + { + + } +} \ No newline at end of file diff --git a/src/Utility/Properties/AssemblyInfo.Editor.cs b/src/Utility/Properties/AssemblyInfo.Editor.cs new file mode 100644 index 00000000..2f6082f1 --- /dev/null +++ b/src/Utility/Properties/AssemblyInfo.Editor.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Bolt.Addons.Community.Utility.Editor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Bolt.Addons.Community.Utility.Editor")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("fcadd801-ff9e-46e5-a573-e06fa0c8661b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Utility/Properties/AssemblyInfo.cs b/src/Utility/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..d3ba24c8 --- /dev/null +++ b/src/Utility/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Bolt.Addons.Community.Utility")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Bolt.Addons.Community.Utility")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a2fdb1fb-e259-45c0-b46a-4e416110bbb3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Utility/UnitButton.cs b/src/Utility/UnitButton.cs new file mode 100644 index 00000000..a04f1e76 --- /dev/null +++ b/src/Utility/UnitButton.cs @@ -0,0 +1,10 @@ +using Ludiq; + +namespace Bolt.Community.Addons.Utility +{ + [Inspectable] + public class UnitButton + { + public System.Action action; + } +} \ No newline at end of file diff --git a/src/Utility/UnitButtonAttribute.cs b/src/Utility/UnitButtonAttribute.cs new file mode 100644 index 00000000..c79d68c1 --- /dev/null +++ b/src/Utility/UnitButtonAttribute.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Bolt.Community.Addons.Utility +{ + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)] + public class UnitButtonAttribute : Attribute + { + public string action; + + public UnitButtonAttribute(string action) + { + this.action = action; + } + } +} \ No newline at end of file