public void ResearchClicked(IResearchItem clicked) { desciption.text = clicked.details; price.text = "" + clicked.Cost; clickedResearchName.text = clicked.researchName; buyButton.onClick.RemoveAllListeners(); buyButton.onClick.AddListener(clicked.Buy); buyButton.interactable = clicked.IsBuyable() && !clicked.Bought; }
private void RecalculateAvailability() { if (researchItem.Bought) { button.GetComponent <Image>().color = manager.boughtColor; } else { if (researchItem.IsBuyable()) { button.GetComponent <Image>().color = manager.activeColor; } else { button.GetComponent <Image>().color = manager.unactiveColor; } } }