public bool MakeCurrencyPurchase(RadioStoreItem item, int index) { int currency = PlayerPrefs.GetInt(CURRENCY_ID); int cost = item.COST[index]; if (currency >= cost) { PlayerPrefs.SetInt(CURRENCY_ID, currency - cost); item.UnlockIndex(index); return(true); } return(false); }
// Start is called before the first frame update void Start() { item = MyIAPManager.instance.RADIO_ITEMS[RADIO_ITEM_ID]; COST_FORMAT_STRING = COST_FORMAT_STRING.Replace("\\n", "\n"); }