diff options
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs')
-rw-r--r-- | Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs | 30 |
1 files changed, 30 insertions, 0 deletions
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 |