Пример #1
0
    private new void Awake()
    {
        base.Awake();
        MenuPage = this;

        if (!LevelsState.IsLevelAvailible(0))
        {
            LevelsState.UnlockLevel(0);
        }
        soundSettingsButton.onClick.AddListener(OpenSoundSettings);
        newGameButton.onClick.AddListener(NewGame);
    }
Пример #2
0
 private void OpenOrBuy()
 {
     if (LevelsState.IsLevelAvailible(levelId))
     {
         OpenLevel();
     }
     else
     {
         if (Purse.RemoveMoney(priceCoin, priceDiamond))
         {
             LevelsState.UnlockLevel(levelId);
             Unlock();
             OpenLevel();
         }
     }
 }
Пример #3
0
 public void Init()
 {
     button.onClick.AddListener(OpenOrBuy);
     priceCoinText.text = LevelsState.IsLevelAvailible(levelId - 1) ?
                          (SetMoneyText(Purse.Coins) + "/" + SetMoneyText(priceCoin)) :
                          (SetMoneyText(priceCoin) + "");
     priceDiamondText.text = LevelsState.IsLevelAvailible(levelId - 1) ?
                             (SetMoneyText(Purse.Diamonds) + "/" + SetMoneyText(priceDiamond)) :
                             (priceDiamond + "");
     if (LevelsState.IsLevelAvailible(levelId))
     {
         Unlock();
     }
     else
     {
         Lock();
     }
 }
 public static bool NextLevelIsOpen(int levelId)
 {
     return(LevelsState.IsLevelAvailible(levelId + 1));
 }