public void ChangeButton(ShopButton button, buttonValue value) { if (value.Equals(buttonValue.ADD)) { button.buttonStatus = 0; button.GetComponent <Image>().sprite = shopInventory.shopButtonSprites[0]; //Debug.Log("CHANGED TO ADD BUTTON"); } else if (value.Equals(buttonValue.REMOVE)) { button.buttonStatus = 1; button.GetComponent <Image>().sprite = shopInventory.shopButtonSprites[1]; //Debug.Log("CHANGED TO REMOVE BUTTON"); } else if (value.Equals(buttonValue.SELL)) { button.buttonStatus = 2; //button.GetComponent<Image>().sprite = shopInventory.shopButtonSprites[2]; button.GetComponentInChildren <TMP_Text>().text = "SELL\n" + "$" + shopInventory.totalCost; //Debug.Log("CHANGED TO SELL BUTTON"); } else if (value.Equals(buttonValue.DONTSELL)) { button.buttonStatus = 3; //button.GetComponent<Image>().sprite = shopInventory.shopButtonSprites[3]; button.GetComponentInChildren <TMP_Text>().text = "DON'T SELL"; //Debug.Log("CHANGED TO DONTSELL BUTTON"); } }
void Start() { this.GetComponent <Image>().alphaHitTestMinimumThreshold = 0.5f; btnVal = this.GetComponent <buttonValue>(); }