void Start() { coin = FindObjectOfType <Coin>(); button = GetComponent <Button>(); donationValidityCheck = FindObjectOfType <DonationValidityCheck>(); confirmButton.interactable = false; EventBroker.Instance().SubscribeMessage <EventUpdateAlternativesButtons>(OnButtonsInteractable); EventBroker.Instance().SubscribeMessage <EventTogglePopWindow>(OnClosePopUpWindow); }
public void ClearSlot() { donationValidityCheck = FindObjectOfType <DonationValidityCheck>(); var go = EventSystem.current.currentSelectedGameObject; if (go.transform.childCount <= 0) { return; } Destroy(EventSystem.current.currentSelectedGameObject.transform.GetChild(0).gameObject); Destroy(donationValidityCheck.upgradedItemSlot.transform.GetChild(0).gameObject); }