コード例 #1
0
ファイル: Main.cs プロジェクト: AnthonyStonge/GlobalGameJam
    private void Awake()
    {
        #region MonoSingleton
        if (Instance != null)
        {
            Destroy(this.gameObject);
            //throw new System.Exception("An instance of this singleton already exists.");
            //On peut aussi faire un return ici
            //return;
        }
        else
        {
            instance = Main.Instance;
            DontDestroyOnLoad(gameObject);
        }
        #endregion

        //Instances:
        game = Game.Instance;

        //Setters:
        currentFlow = game;

        intNotUsed1 = 0;
        intNotUsed2 = 0;

        SceneController.SetCurrentScene(startSceneName);

        //Init:
        currentFlow.PreInitialize();
    }