예제 #1
0
 private void UpdateCoins(bool isAnimated = false)
 {
     if (isAnimated)
     {
         StartCoroutine(UpdateText(_coins, int.Parse(_coins.text), CloudVariables.GetCoins()));
     }
     else
     {
         _coins.text = CloudVariables.GetCoins().ToString();
     }
 }
예제 #2
0
    private void Awake()
    {
        _achievementsService    = ServiceLocator.GetService <AchievementsService>();
        _leaderBoardsService    = ServiceLocator.GetService <LeaderBoardsService>();
        _uiService              = ServiceLocator.GetService <UIService>();
        _uiService.CurrentPanel = this;

        _achievementsButton.onClick.AddListener(_achievementsService.ShowAchievementsUI);
        _leaderboardButton.onClick.AddListener(_leaderBoardsService.ShowLeaderBoardUI);

        _startButton.onClick.AddListener(StartGame);
        _rateButton.onClick.AddListener(RateApp);
        _storeButton.onClick.AddListener(OpenShop);

        _uiService.OpenMainMenu       += Open;
        _uiService.UpdateMainMenuData += UpdateData;

        LastScore.text = CloudVariables.ImportantValues[4].ToString();
        BestScore.text = CloudVariables.ImportantValues[0].ToString();
        Coins.text     = CloudVariables.GetCoins().ToString();
    }
예제 #3
0
 private void UpdateData()
 {
     LastScore.text = CloudVariables.ImportantValues[4].ToString();
     BestScore.text = CloudVariables.ImportantValues[0].ToString();
     StartCoroutine(UpdateText(Coins, int.Parse(Coins.text), CloudVariables.GetCoins()));
 }