예제 #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");
        }
예제 #2
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");
        }