コード例 #1
0
ファイル: GameManager.cs プロジェクト: yazici/not_tetris
    //Changes the current game state
    public void SetState(System.Type newStateType)
    {
        if (currentState != null)
        {
            currentState.OnDeactivate();
        }

        currentState = GetComponentInChildren(newStateType) as _StatesBase;
        if (currentState != null)
        {
            currentState.OnActivate();
        }
    }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: ocogamas/First
    //Changes the current game state
    public void SetState(System.Type newStateType)
    {
        Debug.Log_cyan($"SetState > {newStateType}", this, 2);

        if (currentState != null)
        {
            currentState.OnDeactivate();
        }

        currentState = GetComponentInChildren(newStateType) as _StatesBase;
        if (currentState != null)
        {
            currentState.OnActivate();
        }
    }