diff options
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math')
42 files changed, 873 insertions, 0 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs new file mode 100644 index 00000000..bc351241 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs @@ -0,0 +1,25 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Performs a comparison between two bools.")]
+ public class BoolComparison : Conditional
+ {
+ [Tooltip("The first bool")]
+ public SharedBool bool1;
+ [Tooltip("The second bool")]
+ public SharedBool bool2;
+
+ public override TaskStatus OnUpdate()
+ {
+ return bool1.Value == bool2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ }
+
+ public override void OnReset()
+ {
+ bool1.Value = false;
+ bool2.Value = false;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs.meta new file mode 100644 index 00000000..ec4e2beb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: abaa3d78e68f249428f3be7acae86b0d
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs new file mode 100644 index 00000000..3067ffdd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs @@ -0,0 +1,23 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Flips the value of the bool.")]
+ public class BoolFlip : Action
+ {
+ [Tooltip("The bool to flip the value of")]
+ public SharedBool boolVariable;
+
+ public override TaskStatus OnUpdate()
+ {
+ boolVariable.Value = !boolVariable.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ boolVariable.Value = false;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs.meta new file mode 100644 index 00000000..44658dae --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 54aae1e47fe3be6458751bf1f9defe8f
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs new file mode 100644 index 00000000..dddb3db6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs @@ -0,0 +1,53 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Performs a math operation on two bools: AND, OR, NAND, or XOR.")]
+ public class BoolOperator : Action
+ {
+ public enum Operation
+ {
+ AND,
+ OR,
+ NAND,
+ XOR
+ }
+
+ [Tooltip("The operation to perform")]
+ public Operation operation;
+ [Tooltip("The first bool")]
+ public SharedBool bool1;
+ [Tooltip("The second bool")]
+ public SharedBool bool2;
+ [Tooltip("The variable to store the result")]
+ public SharedBool storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ switch (operation) {
+ case Operation.AND:
+ storeResult.Value = bool1.Value && bool2.Value;
+ break;
+ case Operation.OR:
+ storeResult.Value = bool1.Value || bool2.Value;
+ break;
+ case Operation.NAND:
+ storeResult.Value = !(bool1.Value && bool2.Value);
+ break;
+ case Operation.XOR:
+ storeResult.Value = bool1.Value ^ bool2.Value;
+ break;
+ }
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ operation = Operation.AND;
+ bool1.Value = false;
+ bool2.Value = false;
+ storeResult.Value = false;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs.meta new file mode 100644 index 00000000..7b4a9b28 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: bd7b9dfddd114be4a8c8a8521262970d
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs new file mode 100644 index 00000000..16c2e345 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs @@ -0,0 +1,23 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Stores the absolute value of the float.")]
+ public class FloatAbs : Action
+ {
+ [Tooltip("The float to return the absolute value of")]
+ public SharedFloat floatVariable;
+
+ public override TaskStatus OnUpdate()
+ {
+ floatVariable.Value = Mathf.Abs(floatVariable.Value);
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ floatVariable = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs.meta new file mode 100644 index 00000000..805bd7e7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: ab5531c4ed335b643a6f310c048a6b00
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs new file mode 100644 index 00000000..89f406b9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs @@ -0,0 +1,27 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Clamps the float between two values.")]
+ public class FloatClamp : Action
+ {
+ [Tooltip("The float to clamp")]
+ public SharedFloat floatVariable;
+ [Tooltip("The maximum value of the float")]
+ public SharedFloat minValue;
+ [Tooltip("The maximum value of the float")]
+ public SharedFloat maxValue;
+
+ public override TaskStatus OnUpdate()
+ {
+ floatVariable.Value = Mathf.Clamp(floatVariable.Value, minValue.Value, maxValue.Value);
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ floatVariable = minValue = maxValue = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs.meta new file mode 100644 index 00000000..dbe8a35c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 75c3634f2c8f1dd49b826a7ac0c7bdbe
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs new file mode 100644 index 00000000..b64d25c1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs @@ -0,0 +1,52 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Performs comparison between two floats: less than, less than or equal to, equal to, not equal to, greater than or equal to, or greater than.")]
+ public class FloatComparison : Conditional
+ {
+ public enum Operation
+ {
+ LessThan,
+ LessThanOrEqualTo,
+ EqualTo,
+ NotEqualTo,
+ GreaterThanOrEqualTo,
+ GreaterThan
+ }
+
+ [Tooltip("The operation to perform")]
+ public Operation operation;
+ [Tooltip("The first float")]
+ public SharedFloat float1;
+ [Tooltip("The second float")]
+ public SharedFloat float2;
+
+ public override TaskStatus OnUpdate()
+ {
+ switch (operation) {
+ case Operation.LessThan:
+ return float1.Value < float2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ case Operation.LessThanOrEqualTo:
+ return float1.Value <= float2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ case Operation.EqualTo:
+ return float1.Value == float2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ case Operation.NotEqualTo:
+ return float1.Value != float2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ case Operation.GreaterThanOrEqualTo:
+ return float1.Value >= float2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ case Operation.GreaterThan:
+ return float1.Value > float2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ }
+ return TaskStatus.Failure;
+ }
+
+ public override void OnReset()
+ {
+ operation = Operation.LessThan;
+ float1.Value = 0;
+ float2.Value = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs.meta new file mode 100644 index 00000000..f4f6d874 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 79c81f4e67dbdc44880734e78153117c
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs new file mode 100644 index 00000000..9c4b249f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs @@ -0,0 +1,61 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Performs a math operation on two floats: Add, Subtract, Multiply, Divide, Min, or Max.")]
+ public class FloatOperator : Action
+ {
+ public enum Operation
+ {
+ Add,
+ Subtract,
+ Multiply,
+ Divide,
+ Min,
+ Max
+ }
+
+ [Tooltip("The operation to perform")]
+ public Operation operation;
+ [Tooltip("The first float")]
+ public SharedFloat float1;
+ [Tooltip("The second float")]
+ public SharedFloat float2;
+ [Tooltip("The variable to store the result")]
+ public SharedFloat storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ switch (operation) {
+ case Operation.Add:
+ storeResult.Value = float1.Value + float2.Value;
+ break;
+ case Operation.Subtract:
+ storeResult.Value = float1.Value - float2.Value;
+ break;
+ case Operation.Multiply:
+ storeResult.Value = float1.Value * float2.Value;
+ break;
+ case Operation.Divide:
+ storeResult.Value = float1.Value / float2.Value;
+ break;
+ case Operation.Min:
+ storeResult.Value = Mathf.Min(float1.Value, float2.Value);
+ break;
+ case Operation.Max:
+ storeResult.Value = Mathf.Max(float1.Value, float2.Value);
+ break;
+ }
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ operation = Operation.Add;
+ float1.Value = 0;
+ float2.Value = 0;
+ storeResult.Value = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs.meta new file mode 100644 index 00000000..1641d6ce --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 9144ac2a8b796c941aeb3d6a4bc2cf7c
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs new file mode 100644 index 00000000..05f97250 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs @@ -0,0 +1,23 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Stores the absolute value of the int.")]
+ public class IntAbs : Action
+ {
+ [Tooltip("The int to return the absolute value of")]
+ public SharedInt intVariable;
+
+ public override TaskStatus OnUpdate()
+ {
+ intVariable.Value = Mathf.Abs(intVariable.Value);
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ intVariable = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs.meta new file mode 100644 index 00000000..b3363f74 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 8edcbab77068fe044842381cfe0acc19
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs new file mode 100644 index 00000000..fed3a146 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs @@ -0,0 +1,27 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Clamps the int between two values.")]
+ public class IntClamp : Action
+ {
+ [Tooltip("The int to clamp")]
+ public SharedInt intVariable;
+ [Tooltip("The maximum value of the int")]
+ public SharedInt minValue;
+ [Tooltip("The maximum value of the int")]
+ public SharedInt maxValue;
+
+ public override TaskStatus OnUpdate()
+ {
+ intVariable.Value = Mathf.Clamp(intVariable.Value, minValue.Value, maxValue.Value);
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ intVariable = minValue = maxValue = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs.meta new file mode 100644 index 00000000..c1bf1d66 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 67cbe30015f2b4940a069cbbee22d888
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs new file mode 100644 index 00000000..bcef3078 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs @@ -0,0 +1,52 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Performs comparison between two integers: less than, less than or equal to, equal to, not equal to, greater than or equal to, or greater than.")]
+ public class IntComparison : Conditional
+ {
+ public enum Operation
+ {
+ LessThan,
+ LessThanOrEqualTo,
+ EqualTo,
+ NotEqualTo,
+ GreaterThanOrEqualTo,
+ GreaterThan
+ }
+
+ [Tooltip("The operation to perform")]
+ public Operation operation;
+ [Tooltip("The first integer")]
+ public SharedInt integer1;
+ [Tooltip("The second integer")]
+ public SharedInt integer2;
+
+ public override TaskStatus OnUpdate()
+ {
+ switch (operation) {
+ case Operation.LessThan:
+ return integer1.Value < integer2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ case Operation.LessThanOrEqualTo:
+ return integer1.Value <= integer2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ case Operation.EqualTo:
+ return integer1.Value == integer2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ case Operation.NotEqualTo:
+ return integer1.Value != integer2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ case Operation.GreaterThanOrEqualTo:
+ return integer1.Value >= integer2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ case Operation.GreaterThan:
+ return integer1.Value > integer2.Value ? TaskStatus.Success : TaskStatus.Failure;
+ }
+ return TaskStatus.Failure;
+ }
+
+ public override void OnReset()
+ {
+ operation = Operation.LessThan;
+ integer1.Value = 0;
+ integer2.Value = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs.meta new file mode 100644 index 00000000..e8807d6b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 99108c35b6d8e9942b8cf441a63f97b5
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs new file mode 100644 index 00000000..4805508e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs @@ -0,0 +1,62 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Performs a math operation on two integers: Add, Subtract, Multiply, Divide, Min, or Max.")]
+ public class IntOperator : Action
+ {
+ public enum Operation
+ {
+ Add,
+ Subtract,
+ Multiply,
+ Divide,
+ Min,
+ Max
+ }
+
+ [Tooltip("The operation to perform")]
+ public Operation operation;
+ [Tooltip("The first integer")]
+ public SharedInt integer1;
+ [Tooltip("The second integer")]
+ public SharedInt integer2;
+ [RequiredField]
+ [Tooltip("The variable to store the result")]
+ public SharedInt storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ switch (operation) {
+ case Operation.Add:
+ storeResult.Value = integer1.Value + integer2.Value;
+ break;
+ case Operation.Subtract:
+ storeResult.Value = integer1.Value - integer2.Value;
+ break;
+ case Operation.Multiply:
+ storeResult.Value = integer1.Value * integer2.Value;
+ break;
+ case Operation.Divide:
+ storeResult.Value = integer1.Value / integer2.Value;
+ break;
+ case Operation.Min:
+ storeResult.Value = Mathf.Min(integer1.Value, integer2.Value);
+ break;
+ case Operation.Max:
+ storeResult.Value = Mathf.Max(integer1.Value, integer2.Value);
+ break;
+ }
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ operation = Operation.Add;
+ integer1.Value = 0;
+ integer2.Value = 0;
+ storeResult.Value = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs.meta new file mode 100644 index 00000000..fc1fa364 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 84208004fb80c0945acc5685aa0a2681
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs new file mode 100644 index 00000000..b1a9f3e4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs @@ -0,0 +1,22 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Is the float a positive value?")]
+ public class IsFloatPositive : Conditional
+ {
+ [Tooltip("The float to check if positive")]
+ public SharedFloat floatVariable;
+
+ public override TaskStatus OnUpdate()
+ {
+ return floatVariable.Value > 0 ? TaskStatus.Success : TaskStatus.Failure;
+ }
+
+ public override void OnReset()
+ {
+ floatVariable = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs.meta new file mode 100644 index 00000000..6502aa63 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: db01d0da1f282134ca0ff7332eb19208
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs new file mode 100644 index 00000000..433e60f7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs @@ -0,0 +1,22 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Is the int a positive value?")]
+ public class IsIntPositive : Conditional
+ {
+ [Tooltip("The int to check if positive")]
+ public SharedInt intVariable;
+
+ public override TaskStatus OnUpdate()
+ {
+ return intVariable.Value > 0 ? TaskStatus.Success : TaskStatus.Failure;
+ }
+
+ public override void OnReset()
+ {
+ intVariable = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs.meta new file mode 100644 index 00000000..0fd5bd95 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 0caff63c23ae17343a455fcbe6eab40a
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs new file mode 100644 index 00000000..1e39179c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs @@ -0,0 +1,30 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Lerp the float by an amount.")]
+ public class Lerp : Action
+ {
+ [Tooltip("The from value")]
+ public SharedFloat fromValue;
+ [Tooltip("The to value")]
+ public SharedFloat toValue;
+ [Tooltip("The amount to lerp")]
+ public SharedFloat lerpAmount;
+ [Tooltip("The lerp resut")]
+ [RequiredField]
+ public SharedFloat storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ storeResult.Value = Mathf.Lerp(fromValue.Value, toValue.Value, lerpAmount.Value);
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ fromValue = toValue = lerpAmount = storeResult = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs.meta new file mode 100644 index 00000000..b6e18c51 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 355f3f83182cc434cb3a1bfb66862e29
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs new file mode 100644 index 00000000..11cd8165 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs @@ -0,0 +1,30 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Lerp the angle by an amount.")]
+ public class LerpAngle : Action
+ {
+ [Tooltip("The from value")]
+ public SharedFloat fromValue;
+ [Tooltip("The to value")]
+ public SharedFloat toValue;
+ [Tooltip("The amount to lerp")]
+ public SharedFloat lerpAmount;
+ [Tooltip("The lerp resut")]
+ [RequiredField]
+ public SharedFloat storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ storeResult.Value = Mathf.LerpAngle(fromValue.Value, toValue.Value, lerpAmount.Value);
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ fromValue = toValue = lerpAmount = storeResult = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs.meta new file mode 100644 index 00000000..6b5fc782 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: c3b148edcb926b744a2bb789f7967e24
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs new file mode 100644 index 00000000..2cb731d3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs @@ -0,0 +1,23 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Sets a random bool value")]
+ public class RandomBool : Action
+ {
+ [Tooltip("The variable to store the result")]
+ public SharedBool storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ storeResult.Value = Random.value < 0.5f;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ storeResult.Value = false;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs.meta new file mode 100644 index 00000000..e666e5ed --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 76d2565ca99ca26459dbefb44dcac109
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs new file mode 100644 index 00000000..57ca24f8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs @@ -0,0 +1,36 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Sets a random float value")]
+ public class RandomFloat : Action
+ {
+ [Tooltip("The minimum amount")]
+ public SharedFloat min;
+ [Tooltip("The maximum amount")]
+ public SharedFloat max;
+ [Tooltip("Is the maximum value inclusive?")]
+ public bool inclusive;
+ [Tooltip("The variable to store the result")]
+ public SharedFloat storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ if (inclusive) {
+ storeResult.Value = Random.Range(min.Value, max.Value + 1);
+ } else {
+ storeResult.Value = Random.Range(min.Value, max.Value);
+ }
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ min.Value = 0;
+ max.Value = 0;
+ inclusive = false;
+ storeResult.Value = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs.meta new file mode 100644 index 00000000..9b1e5fc8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 9f81e111c77731b418178f1226975c3f
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs new file mode 100644 index 00000000..6fa4db81 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs @@ -0,0 +1,36 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Sets a random int value")]
+ public class RandomInt : Action
+ {
+ [Tooltip("The minimum amount")]
+ public SharedInt min;
+ [Tooltip("The maximum amount")]
+ public SharedInt max;
+ [Tooltip("Is the maximum value inclusive?")]
+ public bool inclusive;
+ [Tooltip("The variable to store the result")]
+ public SharedInt storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ if (inclusive) {
+ storeResult.Value = Random.Range(min.Value, max.Value + 1);
+ } else {
+ storeResult.Value = Random.Range(min.Value, max.Value);
+ }
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ min.Value = 0;
+ max.Value = 0;
+ inclusive = false;
+ storeResult.Value = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs.meta new file mode 100644 index 00000000..2d3efdac --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 067384c41f33cff49bcdf6adec9da049
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs new file mode 100644 index 00000000..6cde489c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs @@ -0,0 +1,26 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Sets a bool value")]
+ public class SetBool : Action
+ {
+ [Tooltip("The bool value to set")]
+ public SharedBool boolValue;
+ [Tooltip("The variable to store the result")]
+ public SharedBool storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ storeResult.Value = boolValue.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ boolValue.Value = false;
+ storeResult.Value = false;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs.meta new file mode 100644 index 00000000..33f077c7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 55f244424a532d24bba59542e2f0fc59
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs new file mode 100644 index 00000000..a4c97c32 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs @@ -0,0 +1,26 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Sets a float value")]
+ public class SetFloat : Action
+ {
+ [Tooltip("The float value to set")]
+ public SharedFloat floatValue;
+ [Tooltip("The variable to store the result")]
+ public SharedFloat storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ storeResult.Value = floatValue.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ floatValue.Value = 0;
+ storeResult.Value = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs.meta new file mode 100644 index 00000000..794328f7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 4d915065ba447c64ba05f8e2841c6efd
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs new file mode 100644 index 00000000..210b6452 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs @@ -0,0 +1,26 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
+{
+ [TaskCategory("Basic/Math")]
+ [TaskDescription("Sets an int value")]
+ public class SetInt : Action
+ {
+ [Tooltip("The int value to set")]
+ public SharedInt intValue;
+ [Tooltip("The variable to store the result")]
+ public SharedInt storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ storeResult.Value = intValue.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ intValue.Value = 0;
+ storeResult.Value = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs.meta new file mode 100644 index 00000000..c5a42a46 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: da57a0a43f227e445b9311bae043401f
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
|