Exemplo n.º 1
0
        private void OnStartGameClick()
        {
            var player1Type = ((TypedOptionData)player1Dropdown.options[player1Dropdown.value]).Type;
            var player2Type = ((TypedOptionData)player2Dropdown.options[player2Dropdown.value]).Type;

            var loader = new GameSceneLoader
            {
                Player1Class = player1Type.FullName,
                Player2Class = player2Type.FullName,
                Player1No    = Config.Player1No,
                Player2No    = Config.Player2No
            };

            foreach (var parameter in initialValues1)
            {
                initializer1[parameter.Key] = parameter.Value;
            }
            foreach (var parameter in initialValues2)
            {
                initializer2[parameter.Key] = parameter.Value;
            }

            SceneLocalCache.AddLoader("game", loader);
            SceneManager.LoadScene("game");
        }
Exemplo n.º 2
0
        void LoadGame(GameSceneLoader loader)
        {
            gameLog.Load(loader.SaveGamePath);
            var autoplayer = new AutoPlayer(gameLog);

            player1 = autoplayer.Player1;
            player2 = autoplayer.Player2;
            StartGame();
        }
Exemplo n.º 3
0
        private void OnLoadGameClick()
        {
            if (!File.Exists(Config.SAVE_GAME_FILE))
            {
                return;
            }

            var loader = new GameSceneLoader
            {
                LoadGame     = true,
                SaveGamePath = Config.SAVE_GAME_FILE
            };

            SceneLocalCache.AddLoader("game", loader);
            SceneManager.LoadScene("game");
        }
Exemplo n.º 4
0
 private void OnBackButtonClick()
 {
     GameSceneLoader.LoadMainMenu();
 }
Exemplo n.º 5
0
 private void OnMainMenuButtonClick()
 {
     Time.timeScale = 1;
     GameSceneLoader.LoadMainMenu();
 }
Exemplo n.º 6
0
 private void OnReplayButtonClick()
 {
     Time.timeScale = 1;
     GameSceneLoader.ReloadScene();
 }