Exemple #1
0
    public void SetItem(SkinShopItem skinShopItem)
    {
        _selectedItem = skinShopItem;

        _skinImage.sprite   = skinShopItem.BallSkin.Icon;
        _skinCostField.text = skinShopItem.BallSkin.SkinInfo.Cost.ToString();
    }
Exemple #2
0
        private void ShowButtonsAndPrice()
        {
            SkinShopItem skinShopItem = skinShopItems[selectedSkinIndex];
            bool         isOwned      = playerSkinCollection.IsOwned(skinShopItem.skinType);
            string       price        = skinShopItem.price.ToString();

            skinShopPanel.ShowCorrectButtonsAndPrice(isOwned, price);
        }
Exemple #3
0
    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;
    }