public void ApplyInfo() { string[] priceList = GameData.Instance.allPirceStr.Split(';'); // Debug.LogError("@@priceList.Length: " + priceList.Length); //如果从appstore上没有拿到所有的商品价格信息,就直接隐藏价格显示 if (priceList.Length - 1 < 6) { HidePriceText(true); #if UNITY_IOS ChannelIOSAPI.RequstALLProductInfo(); #endif } else { HidePriceText(false); for (int i = 0; i < priceList.Length; i++) { if (priceList[i] != null) { //Debug.LogError("@@pirceList[i]: " + priceList[i]); ApplyPriceInfo(priceList[i]); } } } }
void Awake() { #if !UNITY_EDITOR && UNITY_IOS IOSIAPMgr.Instance.Init(); #endif if (PlayerPrefs.GetString("NewPlayer") != "false") { PlayerPrefs.SetInt("Diamonds", 20); PlayerPrefs.SetString("NewPlayer", "false"); GameData.Instance.diamonds = PlayerPrefs.GetInt("Diamonds"); diamondText.text = GameData.Instance.diamonds.ToString(); } else { GameData.Instance.diamonds = PlayerPrefs.GetInt("Diamonds"); if (GameData.Instance.diamonds >= 0) { diamondText.text = GameData.Instance.diamonds.ToString(); } else { PlayerPrefs.SetInt("Diamonds", 0); diamondText.text = "0"; } } Init(); ChannelIOSAPI.RequstALLProductInfo(); }
public void RechargeBtnClick() { PlayMusic("click"); ChannelIOSAPI.RequstALLProductInfo(); theRechargePanel.gameObject.SetActive(true); theRechargePanel.gameObject.GetComponent <RechargePanel>().ApplyInfo(); }
public void RechargeItem168Click() { PlayMusic("click"); #if UNITY_EDITOR || UNITY_ANDROID IOSIAPMgr.Instance.AddPurchaseDiamonds(4999); #else ChannelIOSAPI.BuyProductById(1006); #endif }
public void HidePriceText(bool hide) { #if UNITY_IOS ChannelIOSAPI.RequstALLProductInfo(); #endif if (hide) { price01Text.gameObject.SetActive(false); price02Text.gameObject.SetActive(false); price03Text.gameObject.SetActive(false); price04Text.gameObject.SetActive(false); price05Text.gameObject.SetActive(false); price06Text.gameObject.SetActive(false); loadingImg1.gameObject.SetActive(true); loadingImg2.gameObject.SetActive(true); loadingImg3.gameObject.SetActive(true); loadingImg4.gameObject.SetActive(true); loadingImg5.gameObject.SetActive(true); loadingImg6.gameObject.SetActive(true); } else { price01Text.gameObject.SetActive(true); price02Text.gameObject.SetActive(true); price03Text.gameObject.SetActive(true); price04Text.gameObject.SetActive(true); price05Text.gameObject.SetActive(true); price06Text.gameObject.SetActive(true); loadingImg1.gameObject.SetActive(false); loadingImg2.gameObject.SetActive(false); loadingImg3.gameObject.SetActive(false); loadingImg4.gameObject.SetActive(false); loadingImg5.gameObject.SetActive(false); loadingImg6.gameObject.SetActive(false); } }
void Awake() { instance = this; InitConfig(); ChannelIOSAPI.Init(); }