示例#1
0
        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);
            }
        }
示例#3
0
 public void OnDestinationReached()
 {
     OnDestinationReachedEvent?.Invoke(this, WantedDestination);
 }
示例#4
0
 public virtual void OnDestinationReached(Location location)
 {
     OnDestinationReachedEvent?.Invoke(this, location);
 }