//Load Store Items to list public IEnumerator LoadVirtualCurrencies(Applicasa.VirtualCurrency[] virtualCurrencies) { Debug.Log ("LiLog_Unity " + System.DateTime.Now.ToShortTimeString() + ": Loading " + virtualCurrencies.Length + " virtual currencies"); m_VirtualCurrencyItems.Clear(); int count = 0; foreach (Applicasa.VirtualCurrency virtualCurrency in virtualCurrencies) { ButtonVC tempButtonVC = new ButtonVC(); tempButtonVC.price=virtualCurrency.VirtualCurrencyPrice.ToString(); tempButtonVC.virtualCurrency=virtualCurrency; Applicasa.FileCache.GetCachedImage(virtualCurrency.VirtualCurrencyImageA, HandleImageData); while (imageData == null) yield return new WaitForSeconds(0.2f); tempButtonVC.texture = new Texture2D(100,100); tempButtonVC.texture.LoadImage(imageData); tempButtonVC.rect=new Rect((itemWidth*count)+(Screen.width*0.02f*(count+1)),Screen.height*0.25f,itemWidth,itemHeight); m_VirtualCurrencyItems.Add(tempButtonVC); imageData = null; count++; } Debug.Log ("LiLog_Unity " + System.DateTime.Now.ToShortTimeString() + ": Loaded " + count + " vitrual Currencies"); yield return null; }
//Load Store Items to list public IEnumerator LoadVirtualCurrencies(Applicasa.VirtualCurrency[] virtualCurrencies) { Debug.Log("LiLog_Unity " + System.DateTime.Now.ToShortTimeString() + ": Loading " + virtualCurrencies.Length + " virtual currencies"); m_VirtualCurrencyItems.Clear(); foreach (Applicasa.VirtualCurrency virtualCurrency in virtualCurrencies) { ButtonVC tempButtonVC = new ButtonVC(); tempButtonVC.price = virtualCurrency.LocalPrice; tempButtonVC.virtualCurrency = virtualCurrency; Applicasa.FileCache.GetCachedImage(virtualCurrency.VirtualCurrencyImageA, HandleImageData); while (imageData == null) { yield return(new WaitForSeconds(0.2f)); } tempButtonVC.texture = new Texture2D(100, 100); tempButtonVC.texture.LoadImage(imageData); tempButtonVC.rect = new Rect((itemWidth * itemsCount) + (Screen.width * 0.02f * (itemsCount + 1)), Screen.height * 0.25f, itemWidth, itemHeight); m_VirtualCurrencyItems.Add(tempButtonVC); imageData = null; itemsCount++; } Debug.Log("LiLog_Unity " + System.DateTime.Now.ToShortTimeString() + ": Loaded " + itemsCount.ToString() + " vitrual Currencies and m_VirtualCurrencyItems.Count= " + m_VirtualCurrencyItems.Count.ToString()); yield return(null); }
//For EDITOR Only void DisplayExampleItems() { for (int count = 0; count < 10; count++) { ButtonVC tempButtonVC = new ButtonVC(); tempButtonVC.price = "0.99"; tempButtonVC.texture = m_ExampleItem; tempButtonVC.rect = new Rect((itemWidth * count) + (Screen.width * 0.02f * (count + 1)), Screen.height * 0.25f, itemWidth, itemHeight); m_VirtualCurrencyItems.Add(tempButtonVC); itemsCount++; } }
//For EDITOR Only void DisplayExampleItems() { for(int count=0;count<3;count++) { ButtonVC tempButtonVC = new ButtonVC(); tempButtonVC.price="0.99"; tempButtonVC.texture=m_ExampleItem; tempButtonVC.rect=new Rect((itemWidth*count)+(Screen.width*0.02f*(count+1)),Screen.height*0.25f,itemWidth,itemHeight); m_VirtualCurrencyItems.Add(tempButtonVC); } }