private void SetButton(AbstractBuildingTile tile) { delete.onClick.RemoveAllListeners(); int price = tile.DebrisRemovalCost; priceText.text = price.ToString(); if (MoneyManager.Instance.PlayerHasEnoughMoney(price)) { delete.onClick.AddListener(OnClick); } void OnClick() { EventManager.Instance.RaiseEvent(new DecreaseMoneyEvent(price)); tile.RemoveDebris(); transform.GetChild(0).gameObject.SetActive(false); } }