Currency Pouch
💼 CurrencyPouch Class
An object that stores currency. This can be used to bind to an item so that the item acts as a currency.
Namespace:
Esper.Inventool.Currencies
Access:public
Type:class
Inherits:ScriptableObject
📦 Fields
public
currencyIdentity
CurrencyIdentity
The currency type.
public
amount
Currency
The currency amount. Relevant when random range is disabled.
public
amountMin
Currency
The minimum currency amount. Relevant when random range is enabled.
public
amountMax
Currency
The maximum currency amount. Relevant when random range is enabled.
public
randomRange
bool
If the currency gained should be randomized.
🧰 Methods
public
GetCurrency()
Currency
Gets the currency based on the set values. Returns the set amount if random range is disabled, otherwise returns a randomized value within the min/max range.
public
Save()
void
Saves the object (editor only).
Get Currency
It's recommended to use the GetCurrency
method to get the currency. This method will return a Currency based on the set properties. If randomRange
is set to true, a random amount between the min and max values will be returned.
Currency currency = currencyPouch.GetCurrency();
Last updated