diff options
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs')
-rw-r--r-- | Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs new file mode 100644 index 00000000..4af9ad76 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs @@ -0,0 +1,29 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2
+{
+ [TaskCategory("Basic/Vector2")]
+ [TaskDescription("Stores the dot product of two Vector2 values.")]
+ public class Dot : Action
+ {
+ [Tooltip("The left hand side of the dot product")]
+ public SharedVector2 leftHandSide;
+ [Tooltip("The right hand side of the dot product")]
+ public SharedVector2 rightHandSide;
+ [Tooltip("The dot product result")]
+ [RequiredField]
+ public SharedFloat storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ storeResult.Value = Vector2.Dot(leftHandSide.Value, rightHandSide.Value);
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ leftHandSide = rightHandSide = Vector2.zero;
+ storeResult = 0;
+ }
+ }
+}
\ No newline at end of file |