private GameContextController()
    {
        if (instance != null & instance != this)
        {
            instance = this;
        }

        mainMenuScene = new MainMenuScene(this);
        mainScene     = new MainScene(this);

        sceneDictionary = new Dictionary <string, IScene <GameContextController> >();
        sceneDictionary.Add(mainMenuScene.name, mainMenuScene);
        sceneDictionary.Add(mainScene.name, mainScene);
        sceneDictionary.Add("Start", null);

        log("Create GameContextController");

        model = new GameContextModel();
        view  = new GameContextView(this);


        log("Successfully Created GameContextController");

        log("Loading Main Menu");


        log("Main Menu Loaded");

        SceneManager.sceneLoaded += ((Scene scene, LoadSceneMode mode) =>
        {
            if (scene.name != "Start")
            {
                SetScene(sceneDictionary[scene.name]);
            }
        });
    }
Пример #2
0
 public GameContextView(GameContextController controller) : base(controller)
 {
     DontDestroyOnLoad(gameObject);
     Debug.Log(controller);
 }