Beispiel #1
0
        IEnumerator DefferGameStart()
        {
            yield return(new WaitForEndOfFrame());

            Debug.Log("Launch casino");
            if (this.debugGame == CasinoGameType.None)
            {
                GUIController.Instance.ShowScreen <LobbyScreen>();
                GUIController.Instance.ShowScreen <TopBarScreen>();
            }
            else
            {
                currentGameType      = debugGame;
                currentSimpleGameTag = debugSimpleGameTag;

                LobbyGamesConfig newMainGame = DataManager.Instance.CasinoConfig.FindGame(debugGame);
                DataManager.Instance.LoadGameTypeConfig(newMainGame);
                DataManager.Instance.LoadSimpleGameConfig(debugSimpleGameTag);

                IGame mainGameObject = FindObjectsOfType <MonoBehaviour>().OfType <IGame>().FirstOrDefault();
                if (mainGameObject != null)
                {
                    mainGameObject.StartGame();
                }
                else
                {
                    Debug.LogError("IGame object not found in scene! Game didn't launch..");
                }
            }
        }
Beispiel #2
0
        public void LoadGameTypeConfig(LobbyGamesConfig lobbyGameConfig)
        {
            if (currentGameTypeConfig != null && currentGameTypeConfig.gameType != lobbyGameConfig.gameType)
            {
                currentGameTypeConfig = null;
            }
            else if (currentGameTypeConfig != null && currentGameTypeConfig.gameType == lobbyGameConfig.gameType)
            {
                return;
            }

            if (lobbyGameConfig.gameType == CasinoGameType.Slots)
            {
                currentGameTypeConfig = Resources.Load <SlotsGameConfig>(lobbyGameConfig.mainGameConfigInResources);
            }

            currentSimpleGameConfig = null;
        }
Beispiel #3
0
        public void ActivateMainGame(CasinoGameType gameType)
        {
            LobbyGamesConfig newMainGame = DataManager.Instance.CasinoConfig.FindGame(gameType);

            if (newMainGame != null)
            {
                currentGameType = gameType;
                Debug.Log("Activate main game: " + currentGameType);

                DataManager.Instance.LoadGameTypeConfig(newMainGame);

                GUIScreen gameLobbyScreen = GUIController.Instance.FoundScreen(newMainGame.gameLobby.GetType());
                if (gameLobbyScreen != null)
                {
                    GUIController.Instance.ShowScreen(gameLobbyScreen);
                }
            }
        }