public void SetItem(SkinShopItem skinShopItem) { _selectedItem = skinShopItem; _skinImage.sprite = skinShopItem.BallSkin.Icon; _skinCostField.text = skinShopItem.BallSkin.SkinInfo.Cost.ToString(); }
private void ShowButtonsAndPrice() { SkinShopItem skinShopItem = skinShopItems[selectedSkinIndex]; bool isOwned = playerSkinCollection.IsOwned(skinShopItem.skinType); string price = skinShopItem.price.ToString(); skinShopPanel.ShowCorrectButtonsAndPrice(isOwned, price); }
public void TrySelect() { if (_lastSelectedItem != null) { _lastSelectedItem.IsSelected = false; } if (IsPurchased == false) { MenuActiveState.GetInstance().ShowMenu("BuySkin"); OnTryBuy?.Invoke(this); return; } IsSelected = true; BallTexture.GetInstance().SetSkin(BallSkin); PlayerPresenter.SelectedBallSkin = BallSkin.SkinInfo; _lastSelectedItem = this; OnSelected?.Invoke(); }
private void Awake() { _skinShopItem = GetComponent <SkinShopItem>(); SkinShopItem.OnSelected += SetSelected; }