예제 #1
0
        void Awake()
        {
            instance = this;
            gameObject.SetActive(false);

            ItemList.Add(new ShopItemDef("shopitem0", 300000, 30, "99.99$"));
            ItemList.Add(new ShopItemDef("shopitem0", 120000, 20, "49.99$"));
            ItemList.Add(new ShopItemDef("shopitem0", 30000, 15, "19.99$"));
            ItemList.Add(new ShopItemDef("shopitem0", 12000, 10, "9.99$"));
            ItemList.Add(new ShopItemDef("shopitem0", 5000, 5, "4.99$"));
            ItemList.Add(new ShopItemDef("shopitem0", 1500, 2, "1.99$"));

            for (int i = 0; i < Toggles.Length; ++i)
            {
                Text textGold = Toggles[i].transform.Find("LabelGold").GetComponent <Text>();
                textGold.text = ItemList[i].coin.ToString("##0,0");
                Text textBonus = Toggles[i].transform.Find("LabelBonus").GetComponent <Text>();
                textBonus.text = ItemList[i].bonus.ToString() + " % Bonus";
                Text textTotal = Toggles[i].transform.Find("LabelTotal").GetComponent <Text>();
                textTotal.text = ItemList[i].total.ToString("##0,0");
                Text textPrice = Toggles[i].transform.Find("LabelPrice").GetComponent <Text>();
                textPrice.text = ItemList[i].price;
            }
        }
예제 #2
0
 //user clicked shop button, then show shop
 public void OnButtonShop()
 {
     BEAudioManager.SoundPlay(0);
     UISGShop.Show();
 }