Exemplo n.º 1
0
 public void DelaySwitchState()
 {
     if (nextDelayStateType != PlayerData.State.NONE)
     {
         SwitchState(nextDelayStateType);
         nextDelayStateType = PlayerData.State.NONE;
     }
 }
Exemplo n.º 2
0
        private void DelayToChangeState(PlayerController controller, PlayerData.State stateToChange)
        {
            if (isSwitchingState)
            {
                return;
            }

            isSwitchingState = true;
            controller.SetDelaySwithState(stateToChange, 0.5f);
        }
Exemplo n.º 3
0
        public void SwitchState(PlayerData.State newStateType)
        {
            if (states != null && states.ContainsKey(newStateType) && currentState.GetCurrentState() != newStateType)
            {
                currentState.End(this);
                currentState = states [newStateType];
                currentState.Start(this);

                currentStateType = newStateType;
            }
        }
Exemplo n.º 4
0
 public void SetDelaySwithState(PlayerData.State newStateType, float delay = 0.5f)
 {
     nextDelayStateType = newStateType;
     Invoke("DelaySwitchState", delay);
 }