summaryrefslogtreecommitdiff
path: root/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs')
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs
new file mode 100644
index 00000000..3fccd123
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs
@@ -0,0 +1,29 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2
+{
+ [TaskCategory("Basic/Vector2")]
+ [TaskDescription("Multiply the Vector2 by a float.")]
+ public class Multiply : Action
+ {
+ [Tooltip("The Vector2 to multiply of")]
+ public SharedVector2 vector2Variable;
+ [Tooltip("The value to multiply the Vector2 of")]
+ public SharedFloat multiplyBy;
+ [Tooltip("The multiplication resut")]
+ [RequiredField]
+ public SharedVector2 storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ storeResult.Value = vector2Variable.Value * multiplyBy.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ vector2Variable = storeResult = Vector2.zero;
+ multiplyBy = 0;
+ }
+ }
+} \ No newline at end of file