Example #1
0
    void Start()
    {
        if (!DataPersistance.GameStateExists())
        {
            throw new System.InvalidProgramException("Game state don't exist!");
        }
        CurrentGameId    = DataPersistance.GetCurrentGameId();
        PopupsController = GetComponent <PopupsController>();

        if (GSP.GameState.ItsMyTurn())
        {
            if (GSP.GameState.HasNotStarted())
            {
                GameEngine.StartGame();
            }
        }

        UpdateUI();
        CheckTheTurn();

        if (GSP.GameState.GetAvailableActions().FindAll((Action obj) => obj.Type == ActionType.EndTurn).Count == 1)
        {
            EndTurnParticleSystemVisible = true;
        }
        else
        {
            EndTurnParticleSystemVisible = false;
        }
    }
 private void Start()
 {
     currentGameId = DataPersistance.GetCurrentGameId();
     playerId      = DataPersistance.GetPlayerNickName();
     GetGameState();
 }