/// <summary> /// Deactivates the specified game item and resets its important values. /// </summary> private void ResetGameItem(GameItem gameItem) { DeactivateItem(gameItem.gameObject); Button button = gameItem.GetComponent <Button>(); // TODO protect against null reference exceptions button.interactable = true; button.onClick.RemoveAllListeners(); gameItem.text.text = string.Empty; gameItem.removeButton.SetActive(false); gameItem.checkMark.SetActive(false); }
// Start is called before the first frame update void Start() { button = gameObject.GetComponent <Button>(); image.sprite = gameItem.GetComponent <Image>().sprite; }