Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- namespace Soomla.Store.Example //Allows for access to Soomla API
- {
- public class ExampleAssets : IStoreAssets //Extend from IStoreAssets (required to define assets)
- {
- public int GetVersion() { // Get Current Version
- return 0;
- }
- public VirtualCurrency[] GetCurrencies() { // Get/Setup Virtual Currencies
- return new VirtualCurrency[]{};
- }
- public VirtualGood[] GetGoods() { // Get/Setup Virtual Goods
- return new VirtualGood[]{};
- }
- public VirtualCurrencyPack[] GetCurrencyPacks() { // Get/Setup Currency Packs
- return new VirtualCurrencyPack[]{};
- }
- public VirtualCategory[] GetCategories() { // Get/ Setup Categories (for In App Purchases)
- return new VirtualCategory[]{};
- }
- //****************************BOILERPLATE ABOVE(modify as you see fit/ if nessisary)***********************
- //SETUP AND CREATE AN IN APP PURCHASE ASSET
- public NonConsumableItem[] GetNonConsumableItems() { // Add "turn green" IAP to non-consumable items
- return new NonConsumableItem[]{TURN_GREEN_NONCOINS};
- }
- public const string TURN_GREEN_NONCOINS_PRODUCT_ID = "turn_green"; //create a string to store the "turn green" in app purchase
- /** Non-Consumables **/
- public static NonConsumableItem TURN_GREEN_NONCOINS = new NonConsumableItem( // Create the 'turn green' In-App Purchase
- "turn_green", // Name of IAP
- "This will turn the cube green.", // Description of IAP
- "turn_green_item_id", // Item ID (different from 'product id" used by itunes, this is used by soomla)
- // 1. assign the purchase type of the IAP (purchaseWithMarket == item cost real money),
- // 2. assign the IAP as a market item (using its ID)
- // 3. set the item to be a non-consumable purchase type
- // 4. set the item to cost .99 cents
- // 1. 2. 3. 4.
- new PurchaseWithMarket(new MarketItem(TURN_GREEN_NONCOINS_PRODUCT_ID,MarketItem.Consumable.NONCONSUMABLE, 0.99))
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement