summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-09-08 10:52:35 +0800
committerchai <chaifix@163.com>2021-09-08 10:52:35 +0800
commit21e186f75b504d832d9c7bef0456edd7d5d3155e (patch)
treee73c43fc78d0326f32da5fadfda57fa8e23c1d90 /Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs
parent7bd7b4c6c3be6840cab06aa4d8a38619bce44705 (diff)
+behavior design
Diffstat (limited to 'Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs')
-rw-r--r--Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs
new file mode 100644
index 00000000..75b87840
--- /dev/null
+++ b/Assets/ThirdParty/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