Пример #1
0
    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);
    }
Пример #2
0
 // 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");
 }