public void Touch(ContactData contact, int playerId) { upgrade.Apply(); // Hide the menu. App.Instance.Model.Players[playerId].ShowMenu(false); App.Instance.Model.Players[playerId].CanUpgrade = false; }
private void InitUIElements() { upgradeNameUI = transform.Find("Name").GetComponent <Text>(); descriptionUI = transform.Find("Description").GetComponent <Text>(); priceValueUI = transform.Find("PriceValue").GetComponent <Text>(); buttomApplyUI = transform.Find("Button - Buy").GetComponent <Button>(); productImageUI = transform.Find("ProductSprite").GetComponent <Image>(); buttomApplyUI.onClick.AddListener(delegate { upgrade.Apply(); }); }