using BehaviorDesigner.Runtime.Tasks; using DDD.Npcs.Crews; namespace DDD.BehaviorTrees.Actions { [TaskCategory("Custom/Npc/Crew")] public class MoveToRandomPositionInRange : Action { private Crew _crew; public override void OnAwake() { _crew = GetComponent(); } public override void OnStart() { _crew.AIMovement.MoveToRandomPositionInRange(10f); } public override TaskStatus OnUpdate() { if (_crew.AIMovement.HasReachedDestination()) { _crew.AIMovement.StopMove(); return TaskStatus.Success; } return TaskStatus.Running; } } }