Esempio n. 1
0
 public override void OnFrame(Entity entity)
 {
     if (Vector3.Distance(entity.GetState <PositionState>().Position, targetPosition) < PositionTolerance)
     {
         pathfindingState = entity.GetState <PathfindingState>();
         pathfindingState.ClearTarget();
         ActionStatus = ActionStatus.Succeeded;
     }
     //TODO: Add timeout.
 }
        public override void OnFrame(Entity entity)
        {
            pathfindingState.SetNewTarget(targetWaypoint.GetState <PositionState>().Position);

            if (Vector3.Distance(entity.GetState <PositionState>().Position, pathfindingState.GetTargetPosition().GetValueOrDefault()) < pathfindingState.GetStoppingDistance() + PositionTolerance)
            {
                pathfindingState = entity.GetState <PathfindingState>();
                pathfindingState.ClearTarget();
                ActionStatus = ActionStatus.Succeeded;
            }
            //TODO: Add timeout => Failure.
        }
Esempio n. 3
0
 public void Cancel()
 {
     pathfindingState.ClearTarget();
 }
Esempio n. 4
0
 private void RotationFinished()
 {
     pathfindingState.ClearTarget();
     ActionStatus = ActionStatus.Succeeded;
 }