mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
34 lines
684 B
C#
34 lines
684 B
C#
|
using System.Xml.Serialization;
|
|||
|
namespace BehaviorTreeSlayer
|
|||
|
{
|
|||
|
public class Wait : ActionNode
|
|||
|
{
|
|||
|
[OutField]
|
|||
|
public double time = 3;
|
|||
|
double t;
|
|||
|
[ShowMe]
|
|||
|
private double timer;
|
|||
|
public Wait()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public Wait(double time)
|
|||
|
{
|
|||
|
this.time = time;
|
|||
|
}
|
|||
|
|
|||
|
public override TaskResult Tick(double dt, object args = null)
|
|||
|
{
|
|||
|
timer += dt;
|
|||
|
if (timer >= time)
|
|||
|
{
|
|||
|
UnityEngine.Debug.Log(timer);
|
|||
|
timer = 0;
|
|||
|
return TaskResult.OK;
|
|||
|
}
|
|||
|
return TaskResult.Running;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|