/// <summary> /// overwrite real money item properties with online data /// from Google or Apple, based on our IAPArticle wrapper /// Called by ShopManager /// </summary> public void Init(IAPArticle prod) { //cache string name = prod.title; string descr = prod.description.Replace("\\n", "\n"); //normally, the online item name received from Google or Apple //has the application name attached, so we exclude that here int cap = name.IndexOf("("); if (cap > 0) { name = name.Substring(0, cap - 1); } //when 'uppercase' has been checked, //convert title and description text to uppercase, //otherwise just keep and set them as they are if (uppercase) { name = name.ToUpper(); descr = descr.ToUpper(); } if (title) { title.text = name; } if (description) { description.text = descr; } //purchases for real money have only one price value, //so we just use the first entry of the price label array if (price.Length > 0) { price[0].text = prod.price; } }
/// <summary> /// overwrite real money item properties with online data /// from Google or Apple, based on our IAPArticle wrapper /// Called by ShopManager /// </summary> public void Init(IAPArticle prod) { //cache string name = prod.title; string descr = prod.description.Replace("\\n", "\n"); //normally, the online item name received from Google or Apple //has the application name attached, so we exclude that here int cap = name.IndexOf("("); if (cap > 0) name = name.Substring(0, cap - 1); //when 'uppercase' has been checked, //convert title and description text to uppercase, //otherwise just keep and set them as they are if (uppercase) { name = name.ToUpper(); descr = descr.ToUpper(); } if (title) title.text = name; if (description) description.text = descr; //purchases for real money have only one price value, //so we just use the first entry of the price label array if (price.Length > 0) price[0].text = prod.price; }