Пример #1
0
    public void BuyOrEquip()
    {
        if (!viewer.Bought)
        {
            if (controlls.Score.Score >= hat.cost)
            {
                controlls.hatPurchaseManager = this;
                controlls.Subscribe();
                OnHatBoughtEv?.Invoke(hat.FormArray(), hat.cost, hat.sprite);
                viewer.Bought = true;

                controlls.shopPanel.PublishEvent(true);
            }
        }
        else
        {
            controlls.hatPurchaseManager = this;
            controlls.Subscribe();
            OnHatEquipedEv?.Invoke(hat.FormArray(), hat.sprite);
        }
    }