summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2022-03-10 14:07:40 +0800
committerchai <chaifix@163.com>2022-03-10 14:07:40 +0800
commit22891bf59032ba88262824255a706d652031384b (patch)
tree7595439ba9966c9402d37e37cee5e8cf098757d5 /Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs
parent8b04ea73e540067f83870b61d89db4868fea5e8a (diff)
* move folder
Diffstat (limited to 'Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs')
-rw-r--r--Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs66
1 files changed, 0 insertions, 66 deletions
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs
deleted file mode 100644
index 1ad1bc62..00000000
--- a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-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,
- Modulo
- }
-
- [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;
- case Operation.Modulo:
- storeResult.Value = 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