31 lines
694 B
C#
31 lines
694 B
C#
using BehaviorDesigner.Runtime.Tasks;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace BlueWaterProject
|
|
{
|
|
public class PatrolMove : Action
|
|
{
|
|
private IPatrol iPatrol;
|
|
|
|
public override void OnAwake()
|
|
{
|
|
iPatrol = transform.GetComponent<IPatrol>();
|
|
}
|
|
|
|
public override void OnStart()
|
|
{
|
|
iPatrol.SetMovePoint();
|
|
}
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
if (!iPatrol.HasReachedDestination())
|
|
{
|
|
iPatrol.UpdatePositionAndRotation();
|
|
return TaskStatus.Running;
|
|
}
|
|
|
|
return TaskStatus.Success;
|
|
}
|
|
}
|
|
} |