Beispiel #1
0
    public void Uninstall(CatItem catItem)
    {
        CatSlot slot = catSlots[catItem.isInstalled];

        slot.Clear();
        catItem.isInstalled = -1;

        costCoinText.text = cost.ToString();
        iTween.PunchScale(costCoin.gameObject, new Vector3(-0.3f, -0.5f, 0), 1);

        ui.header.ShowCoinsIn(slot.itemViewParent.position, 8, missionList.transform, scale: 0.8f);

        AddToList(catItem);
    }
Beispiel #2
0
    public void SetCatList()
    {
        int    cnt  = 0;
        string data = PlayerPrefs.GetString("HaveCat");

        string[] list = data.Split(',');

        for (int j = 0; j < MaxLen.y; j++)
        {
            for (int i = 0; i < MaxLen.x; i++)
            {
                GameObject slotTmp = Instantiate(slot, slotZip.transform) as GameObject;
                slotTmp.transform.localPosition = new Vector3(BasicPos.x + Margin.x * i, BasicPos.y - Margin.y * j);
                CatSlot slotTarget = slotTmp.GetComponent <CatSlot>();
                slotTarget.slotNum = cnt;
                Slots.Add(slotTmp);
                ++cnt;
            }
        }

        if (data != "" && data != null)
        {
            print(data);
            for (int q = 0; q < list.Length; q++)
            {
                if (list[q] != "")
                {
                    AddCat(int.Parse(list[q]));
                }
            }


            for (int k = 0; k < Cats.Count; k++)
            {
                Slots[k].GetComponent <CatSlot>().cat = Cats[k];
            }
        }
        else
        {
            print("qwe?");
            PlayerPrefs.SetString("HaveCat", "");
            AddCat(0);
        }
    }
Beispiel #3
0
    public void Show(CatSlot slot)
    {
        if (!AddCat())
        {
            return;
        }

        rentCatNextSession = user.gameSessions + balance.rentCat.frequency +
                             rentCats[catItem.type] * (int)((float)balance.rentCat.frequency * 0.3f);

        descriptionText.text = Localization.Get("rentCat", catItem.type.localizedName, catItem.level);

        catView = Instantiate(catItem.type.itemViewPrefab);
        catView.transform.SetParent(catParent, false);
        catView.transform.localScale = 2 * Vector3.one;
        catView.footer.SetActive(false);

        gameObject.SetActive(true);

        Analytic.EventProperties("RentCat", catItem.type.name, "RENT");
    }