コード例 #1
0
    public void SwitchState()
    {
        GameObject.FindGameObjectWithTag("Player").GetComponent <WeaponScript>().AddAmmo();

        if (currentState == gameplayState)
        {
            gameplayState.ExitState();
            pauseState.EnterState();
            currentState = pauseState;
        }
        else if (currentState == pauseState)
        {
            pauseState.ExitState();
            gameplayState.EnterState();
            currentState = gameplayState;
        }
    }