123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using UnityEngine;
- using System.Collections;
- public class BuyUtil
- {
- public enum Currency
- {
- Diamond = 0,
- Coin = 1,
- Money = 2,
- }
- private static System.Array currencyArr = System.Enum.GetValues(typeof(Currency));
- public static Currency GetCurrencyByCode(int code)
- {
- return (Currency)currencyArr.GetValue(code);
- }
- public enum ItemType
- {
- None = 0,
- VIP = 1,
- Coin = 2,
- Diam = 3,
- Halo = 4,
- Skin = 5,
- }
- public enum ItemState
- {
- Sell,
- Bought,
- Equiped,
- }
- public static void Bought(string name)
- {
- ShopData data = ShopManager.GetInstance().GetDataByCode(name);
- if(data.sort == ItemType.Coin.GetHashCode())
- {
- AlertPanel.Show (null, string.Format(Language.GetStr("BuyCoinPanel", "coinBought"), data.value));
- }
- else if(data.sort == ItemType.Diam.GetHashCode())
- {
- AlertPanel.Show (null, string.Format(Language.GetStr("BuyCoinPanel", "diamondBought"), data.value));
- }
- else if(data.sort == ItemType.VIP.GetHashCode())
- {
- AlertPanel.Show (null, Language.GetStr("BuyCoinPanel", "vipBought"));
- }
- }
- }
|