*
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class AiDelay : AiBehavior {
|
||||
|
||||
public float delay = 1;
|
||||
private float _startTime;
|
||||
|
||||
protected override void OnBegin(AiBlackboard blackboard) {
|
||||
_startTime = Time.time;
|
||||
}
|
||||
|
||||
protected override BehaviorStatus OnExecute(AiBlackboard blackboard) {
|
||||
return (_startTime + delay) > Time.time ? BehaviorStatus.Running : BehaviorStatus.Success;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user