Пример #1
0
    public void WearPers()
    {
        ClothLoader cloth = characters[StatePoint - 1].GetComponentInChildren <ClothLoader>();

        cloth.TakeOff();
        for (int i = 0; i < clothData[StatePoint - 1].Length; i++)
        {
            cloth.Wear(clothData[StatePoint - 1][i]);
        }
        PriceLabel.alpha  = 0;
        PriceLabel1.alpha = 0;
    }
Пример #2
0
    void Buy()
    {
        ClothLoader cloth = characters[StatePoint - 1].GetComponentInChildren <ClothLoader>();

        if (openedCloth[StatePoint - 1][cloth.getIndex(clothName)] || clothName == "none")
        {
            BuyLabel.text = "Применено";
            clothData[StatePoint - 1][cloth.DetermineTypeIndex(clothName)] = clothName;

            if (clothName == "none")
            {
                cloth.TakeOff();
                for (int i = 0; i < 4; i++)
                {
                    clothData[StatePoint - 1][i] = "none";
                }
            }
            else
            {
                cloth.Wear(clothName);
            }
        }
        else
        {
            int price = cloth.getPrice(clothName);
            if (getMoney() >= price)
            {
                changeMoney(-price, true);

                clothData[StatePoint - 1][cloth.DetermineTypeIndex(clothName)] = clothName;

                BuyLabel.text = "Применено";
                openedCloth[StatePoint - 1][cloth.getIndex(clothName)] = true;
            }
            else
            {
                BuyLabel.text = "Не хватает бабосов!!!";
            }
        }
    }