コード例 #1
0
    public void ChangeStage(GAMESTAGE eStage)
    {
        IGameStage stage = null;

        if (gameStageDic.ContainsKey(eStage))
        {
            stage = gameStageDic[eStage];
        }
        else
        {
            stage = GetStage(eStage);
            gameStageDic.Add(eStage, stage);
        }

        if (gameStage == null)
        {
            gameStage = stage;
            gameStage.OnEnter();
            return;
        }

        if (gameStage == stage)
        {
            return;
        }

        gameStage.OnExit();
        gameStage = stage;
        gameStage.OnEnter();
    }