diff options
author | chai <chaifix@163.com> | 2021-01-27 16:15:06 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-27 16:15:06 +0800 |
commit | 97da432c35b8c7aaf9dd2c39e2aa4b1f55f36065 (patch) | |
tree | d9b1db5908a3a030c529e230386fe01062923b09 /Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time | |
parent | 1fe4ffba72f56ccc6a89d1896142425c666887d4 (diff) |
+behaviour designer
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time')
10 files changed, 155 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 diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs.meta new file mode 100644 index 00000000..a895d9d5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: d9d47b1b40fc1214298a3f6bfdc37e87
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs new file mode 100644 index 00000000..eb54ab7f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs @@ -0,0 +1,23 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTime
+{
+ [TaskCategory("Basic/Time")]
+ [TaskDescription("Returns the real time in seconds since the game started.")]
+ public class GetRealtimeSinceStartup : Action
+ {
+ [Tooltip("The variable to store the result")]
+ public SharedFloat storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ storeResult.Value = Time.realtimeSinceStartup;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ storeResult.Value = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs.meta new file mode 100644 index 00000000..9c3e68ec --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: c265b103d220b0e4fa45138fcd605f62
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs new file mode 100644 index 00000000..f0585de6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs @@ -0,0 +1,23 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTime
+{
+ [TaskCategory("Basic/Time")]
+ [TaskDescription("Returns the time in second since the start of the game.")]
+ public class GetTime : Action
+ {
+ [Tooltip("The variable to store the result")]
+ public SharedFloat storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ storeResult.Value = Time.time;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ storeResult.Value = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs.meta new file mode 100644 index 00000000..fe77d1cd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 5afd2ca3dda059243bf7a9156438475e
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs new file mode 100644 index 00000000..7e5cf4f5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs @@ -0,0 +1,23 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTime
+{
+ [TaskCategory("Basic/Time")]
+ [TaskDescription("Returns the scale at which time is passing.")]
+ public class GetTimeScale : Action
+ {
+ [Tooltip("The variable to store the result")]
+ public SharedFloat storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ storeResult.Value = Time.timeScale;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ storeResult.Value = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs.meta new file mode 100644 index 00000000..7835d60c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 79be8ba43b4c1db468d2476318e7e71a
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
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 diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs.meta new file mode 100644 index 00000000..9987e403 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 6283d9f4bb690c64b9d986b6ff1271f0
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
|