using BehaviorDesigner.Runtime.Tasks; using UnityEngine; // ReSharper disable once CheckNamespace namespace BlueWaterProject { public class PatrolWait : Action { private IPatrol iPatrol; private float currentWaitTime; private float time; public override void OnAwake() { iPatrol = transform.GetComponent(); } public override void OnStart() { currentWaitTime = iPatrol.GetCurrentWayPointInfo().WaitTime; time = 0f; } public override TaskStatus OnUpdate() { time += Time.deltaTime; if (time < currentWaitTime) { return TaskStatus.Running; } return TaskStatus.Success; } } }