Example #1
0
    public void SetData(MinesData data)
    {
        this.data = data;

        if (index == data.miner)
        {
            button.interactable = true;
            button.enabled      = true;
            priceText.text      = GameUtils.GetCurrencyString(data.costs[index]);
            costPanel.SetActive(true);
            purchasedTag.SetActive(false);
        }
        else if (index < data.miner)
        {
            button.interactable = true;
            button.enabled      = false;
            costPanel.SetActive(false);
            purchasedTag.SetActive(true);
        }
        else
        {
            button.enabled      = false;
            button.interactable = true;
            costPanel.SetActive(false);
            purchasedTag.SetActive(false);
        }
    }
Example #2
0
 private void OnAddMinerHandle(MinesData mines)
 {
     buyMinerPanel.gameObject.SetActive(true);
     for (int i = 0; i < buyMinerItems.Length; i++)
     {
         buyMinerItems[i].SetData(mines);
     }
 }
Example #3
0
    private int GetCanBuyMinnerIsland()
    {
        MinesData[] minesDatas = user.mapInfo.mines;
        for (int i = 0; i < minesDatas.Length; i++)
        {
            MinesData mines = minesDatas[i];
            if (mines.miner < 5)
            {
                return(i);
            }
        }

        return(user.islandId > 1 ? user.islandId - 2 : 0);
    }