void SetOnClickListener() { GetComponent <Button>().onClick.AddListener(delegate { if (UpgradeInfos.EnoughCoinsForUpgrade(upgradeType)) { GameManager.refrence.coinsInfo.ReduceCoins(UpgradeSlotGUI.UpgradeInfos.GetUpgradeCost(upgradeType)); UpgradeInfos.Upgrade(upgradeType); AudioManager.refrence.PlaySound(AudioManager.E_AUDIO.CASH); //if max lvl reached disable button DisableSlot(); } }); }