v3.1.2
2020.3+

Class EconomyReference

A reference to another resource definition from within a purchase.

Inheritance
EconomyReference
Namespace: Unity.Services.Economy.Model
Syntax
[Preserve]
public class EconomyReference

Constructors

EconomyReference(ConfigurationItemDefinition)

Declaration
[Preserve]
public EconomyReference(ConfigurationItemDefinition configItem)
Parameters
TypeNameDescription
ConfigurationItemDefinitionconfigItem

Methods

GetReferencedConfigurationItem()

Gets the referenced configuration item, which will automatically be deserialized to its target type.

You can cast to this type by checking the Type parameter of the returned ConfigurationItemDefinition, and then casting to either InventoryItemDefinition or CurrencyDefinition as appropriate.

Declaration
[Preserve]
public ConfigurationItemDefinition GetReferencedConfigurationItem()
Returns
TypeDescription
ConfigurationItemDefinition

Either a CurrencyDefinition or an InventoryItemDefinition, depending on the underlying item Type.