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, VIP, Diam, Coin, Halo, Skin, } public enum ItemState { Sell, Bought, Equiped, } public static void Bought(string code) { ShopData data = ShopManager.GetInstance().GetDataByCode(code); if(data.type == ItemType.Coin.GetHashCode()) { AlertPanel.Show (null, string.Format(Language.GetStr("BuyCoinPanel", "coinBought"), data.value)); } else if(data.type == ItemType.Diam.GetHashCode()) { AlertPanel.Show (null, string.Format(Language.GetStr("BuyCoinPanel", "diamondBought"), data.value)); } else if(data.type == ItemType.VIP.GetHashCode()) { AlertPanel.Show (null, Language.GetStr("BuyCoinPanel", "vipBought")); } } }