Currencies Manager
Presented by ICurrenciesManager interface, this system operates with in-game currencies. You can add or withdraw them via this manager, as well as get information about specific currency.
To use this system, inject ICurrenciesManager interface into your class, as shown below:
Parameters in inspector
currencies – reference to serialized object which contains game currencies collection. By default, it refers to Assets/Scriptables/Economics/CurrenciesCollection.asset.
Available methods
This method adds a certain amount of currency of currencyType to player's in-game account. If amount is negative, currency will be withdrawn instead.
Examples:
This method withdraws amount of currency of currencyType from player's in-game account. If player doesn't have enough amount of this currency, it will be set to 0.
Example:
This method returns current amount of currencyType currency on player's in-game account.
Example:
This method writes information about currencyType currency into currencyInfo structure. In case of success (if it finds information about such currency), this method returns true, otherwise it returns false.
Example:
Last updated