Ejemplo n.º 1
0
    public void LoadGameScene(GameController.GameType_t gameType, System.Action callback)
    {
        LoadingScreenManager.Instance.ShowLoadingScreen(true, false);

        this.LoadScene(AppScene.GAME_SCENE, (success) => {
            if (success)
            {
                GameController gameController = new GameController(new GameController.Config {
                    gameType = gameType
                });
                if (callback != null)
                {
                    callback.Invoke();
                }
            }
        });
    }
Ejemplo n.º 2
0
 private void StartGame(GameController.GameType_t gameType)
 {
     DebugLog.LogColor("Starting game: " + gameType.ToString(), LogColor.green);
     AppSceneManager.Instance.LoadGameScene(gameType, () => {
         // TODO: Hack: This delay is to make sure the game scenes are created and synced across the different clients
         // Otherwise, we will see some gameobjects of other players "drift" into their initial positions
         if (gameType == GameController.GameType_t.SINGLE_PLAYER)
         {
             this.RemoveDialog();
         }
         else
         {
             CoroutineHelper.Instance.RunAfterDelay(2.5f, () => {
                 if (this != null && this.View != null)
                 {
                     this.RemoveDialog();
                 }
             });
         }
     });
 }