private bool CheckDefenderAvailability()
    {
        int index = int.Parse(gameObject.name.Split(' ')[1]);
        int nr    = PlayerPrefsController.GetBoughtDefenderPrefs(index);

        if (nr == 0)
        {
            return(false);
        }
        else if (nr == 1)
        {
            return(true);
        }
        return(false);
    }
Пример #2
0
 private void ShowImages()
 {
     for (int i = 0; i < images.Count; i++)
     {
         int value = PlayerPrefsController.GetBoughtDefenderPrefs(i);
         if (value == 0)
         {
             images[i].color = new Color32(30, 30, 30, 255);
         }
         else if (value == 1)
         {
             images[i].color = new Color32(255, 255, 255, 255);
         }
     }
 }
Пример #3
0
    private void EnableBuyButton()
    {
        var storeButtons = FindObjectsOfType <StoreButton>();

        for (int i = 0; i < storeButtons.Length; i++)
        {
            if (storeButtons[i] == this)
            {
                selectedStoreBtn = storeButtons[i];
                int index = GetIndexButton();
                int nr    = PlayerPrefsController.GetBoughtDefenderPrefs(index);
                if (nr == 0)
                {
                    soldText.SetActive(false);
                    buyButton.SetActive(true);
                }
                else if (nr == 1)
                {
                    soldText.SetActive(true);
                    buyButton.SetActive(false);
                }
            }
        }
    }