summaryrefslogtreecommitdiff
path: root/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs')
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs
new file mode 100644
index 00000000..75b87840
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTime
+{
+ [TaskCategory("Basic/Time")]
+ [TaskDescription("Returns the time in seconds it took to complete the last frame.")]
+ public class GetDeltaTime : Action
+ {
+ [Tooltip("The variable to store the result")]
+ public SharedFloat storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ storeResult.Value = Time.deltaTime;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ storeResult.Value = 0;
+ }
+ }
+} \ No newline at end of file