summaryrefslogtreecommitdiff
path: root/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs')
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs
new file mode 100644
index 00000000..e02937e0
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTime
+{
+ [TaskCategory("Basic/Time")]
+ [TaskDescription("Sets the scale at which time is passing.")]
+ public class SetTimeScale : Action
+ {
+ [Tooltip("The timescale")]
+ public SharedFloat timeScale;
+
+ public override TaskStatus OnUpdate()
+ {
+ Time.timeScale = timeScale.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ timeScale.Value = 0;
+ }
+ }
+} \ No newline at end of file