Esempio n. 1
0
    private void UpdateNextState()
    {
        if (nextState != null)
        {
            if (currentState != null)
            {
                if (!CanUseAbility && !forceNextState)
                {
                    return;
                }
                else
                {
                    currentState.End();
                }
            }
            forceNextState = false;

            currentState = nextState;
            nextState    = null;
            currentState.Enter(this);

            stateTime = 0;
            objectAnimator.PlayAnimation(currentState.animationName, currentState.totalTime, currentState.blendTime);
        }
    }