protected virtual void MovingToPosition_Update() { if (!CurrentLocomotionType.CanMove()) { FSM.ChangeState(FStatesLocomotion.CannotMove); } else if (IsNotFocusedOrReachedDestination()) { if (FocusedOnPosition != null) { OnDestinationReached.Invoke(FocusedOnPosition.Value); } FSM.ChangeState(FStatesLocomotion.NotMoving); } }
protected virtual void MovingToPosition_Update() { if (BotComponent.FocusedOnPosition == null || reachedDestination()) { if (BotComponent.FocusedOnPosition != null) { OnDestinationReached.Invoke(BotComponent.FocusedOnPosition.Value); } m_FSM.ChangeState(LocomotionState.NotMoving); } else { MoveTowardsPosition(m_fullspeed); } }
public void OnDestinationReached() { OnDestinationReachedEvent?.Invoke(this, WantedDestination); }
public virtual void OnDestinationReached(Location location) { OnDestinationReachedEvent?.Invoke(this, location); }