summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs')
-rw-r--r--Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs65
1 files changed, 0 insertions, 65 deletions
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs
deleted file mode 100644
index c4cebd9d..00000000
--- a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-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,
- Modulo
- }
-
- [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;
- case Operation.Modulo:
- storeResult.Value = 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