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); } }
private void OnAddMinerHandle(MinesData mines) { buyMinerPanel.gameObject.SetActive(true); for (int i = 0; i < buyMinerItems.Length; i++) { buyMinerItems[i].SetData(mines); } }
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); }