From 22891bf59032ba88262824255a706d652031384b Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 10 Mar 2022 14:07:40 +0800 Subject: * move folder --- .../Behavior Designer/Runtime/Actions/Wait.cs | 67 ---------------------- 1 file changed, 67 deletions(-) delete mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Actions/Wait.cs (limited to 'Assets/ThirdParty/Behavior Designer/Runtime/Actions/Wait.cs') diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Actions/Wait.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Actions/Wait.cs deleted file mode 100644 index 41f77a21..00000000 --- a/Assets/ThirdParty/Behavior Designer/Runtime/Actions/Wait.cs +++ /dev/null @@ -1,67 +0,0 @@ -using UnityEngine; - -namespace BehaviorDesigner.Runtime.Tasks -{ - [TaskDescription("Wait a specified amount of time. The task will return running until the task is done waiting. It will return success after the wait time has elapsed.")] - [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=22")] - [TaskIcon("{SkinColor}WaitIcon.png")] - public class Wait : Action - { - [Tooltip("The amount of time to wait")] - public SharedFloat waitTime = 1; - [Tooltip("Should the wait be randomized?")] - public SharedBool randomWait = false; - [Tooltip("The minimum wait time if random wait is enabled")] - public SharedFloat randomWaitMin = 1; - [Tooltip("The maximum wait time if random wait is enabled")] - public SharedFloat randomWaitMax = 1; - - // The time to wait - private float waitDuration; - // The time that the task started to wait. - private float startTime; - // Remember the time that the task is paused so the time paused doesn't contribute to the wait time. - private float pauseTime; - - public override void OnStart() - { - // Remember the start time. - startTime = Time.time; - if (randomWait.Value) { - waitDuration = Random.Range(randomWaitMin.Value, randomWaitMax.Value); - } else { - waitDuration = waitTime.Value; - } - } - - public override TaskStatus OnUpdate() - { - // The task is done waiting if the time waitDuration has elapsed since the task was started. - if (startTime + waitDuration < Time.time) { - return TaskStatus.Success; - } - // Otherwise we are still waiting. - return TaskStatus.Running; - } - - public override void OnPause(bool paused) - { - if (paused) { - // Remember the time that the behavior was paused. - pauseTime = Time.time; - } else { - // Add the difference between Time.time and pauseTime to figure out a new start time. - startTime += (Time.time - pauseTime); - } - } - - public override void OnReset() - { - // Reset the public properties back to their original values - waitTime = 1; - randomWait = false; - randomWaitMin = 1; - randomWaitMax = 1; - } - } -} \ No newline at end of file -- cgit v1.1-26-g67d0