C# Class Soomla.Store.UpgradeVG

An upgrade virtual good is one VG in a series of VGs that define an upgrade scale of an associated VirtualGood. This type of virtual good is best explained with an example: Let's say there's a strength attribute to one of the characters in your game and that strength is on a scale of 1-5. You want to provide your users with the ability to upgrade that strength. This is what you'll need to create: 1. SingleUseVG for 'strength' 2. UpgradeVG for strength 'level 1' 3. UpgradeVG for strength 'level 2' 4. UpgradeVG for strength 'level 3' 5. UpgradeVG for strength 'level 4' 6. UpgradeVG for strength 'level 5' When the user buys this UpgradeVG, we check and make sure the appropriate conditions are met and buy it for you (which actually means we upgrade the associated VirtualGood). NOTE: In case you want this item to be available for purchase with real money you will need to define the item in the market (App Store, Google Play...). Inheritance: UpgradeVG > com.soomla.store.domain.virtualGoods.VirtualGood > com.soomla.store.domain.PurchasableVirtualItem > com.soomla.store.domain.VirtualItem
Inheritance: Soomla.Store.LifetimeVG
Mostrar archivo Open project: fi-content2-games-platform/FIcontent.Gaming.Enabler.phenomobilecharactermanager Class Usage Examples

Public Properties

Property Type Description
GoodItemId string
NextItemId string
PrevItemId string

Public Methods

Method Description
Give ( int amount, bool notify ) : int

Assigns the current upgrade to the associated VirtualGood (mGood).

Take ( int amount, bool notify ) : int

Takes upgrade from the user, or in other words DOWNGRADES the associated VirtualGood (mGood). Checks if the current Upgrade is really associated with the VirtualGood and:

UpgradeVG ( JSONObject jsonItem ) : UnityEngine

see parent.

UpgradeVG ( string goodItemId, string nextItemId, string prevItemId, string name, string description, string itemId, Soomla.Store.PurchaseType purchaseType ) : UnityEngine

Constructor.

toJSONObject ( ) : JSONObject

see parent.

Protected Methods

Method Description
canBuy ( ) : bool

Determines if the user is in a state that allows him/her to buy an UpgradeVG This method enforces allowing/rejecting of upgrades here so users won't buy them when they are not supposed to. If you want to give your users free upgrades, use the give function.

Method Details

Give() public method

Assigns the current upgrade to the associated VirtualGood (mGood).
public Give ( int amount, bool notify ) : int
amount int NOT USED HERE!
notify bool notify of change in user's balance of current virtual item.
return int

Take() public method

Takes upgrade from the user, or in other words DOWNGRADES the associated VirtualGood (mGood). Checks if the current Upgrade is really associated with the VirtualGood and:
public Take ( int amount, bool notify ) : int
amount int NOT USED HERE!.
notify bool see parent.
return int

UpgradeVG() public method

see parent.
public UpgradeVG ( JSONObject jsonItem ) : UnityEngine
jsonItem JSONObject
return UnityEngine

UpgradeVG() public method

Constructor.
public UpgradeVG ( string goodItemId, string nextItemId, string prevItemId, string name, string description, string itemId, Soomla.Store.PurchaseType purchaseType ) : UnityEngine
goodItemId string The itemId of the VirtualGood associated with this upgrade.
nextItemId string The itemId of the UpgradeVG before, or if this is the first /// UpgradeVG in the scale then the value is null.
prevItemId string The itemId of the UpgradeVG after, or if this is the last /// UpgradeVG in the scale then the value is null.
name string nName.
description string Description.
itemId string Item id.
purchaseType Soomla.Store.PurchaseType Purchase type.
return UnityEngine

canBuy() protected method

Determines if the user is in a state that allows him/her to buy an UpgradeVG This method enforces allowing/rejecting of upgrades here so users won't buy them when they are not supposed to. If you want to give your users free upgrades, use the give function.
protected canBuy ( ) : bool
return bool

toJSONObject() public method

see parent.
public toJSONObject ( ) : JSONObject
return JSONObject

Property Details

GoodItemId public_oe property

The itemId of the associated VirtualGood.
public string GoodItemId
return string

NextItemId public_oe property

The itemId of the UpgradeVG that comes after this one (or null this is the last one)
public string NextItemId
return string

PrevItemId public_oe property

The itemId of the UpgradeVG that comes before this one (or null this is the first one)
public string PrevItemId
return string