Editor tools

The Economy package comes with some Editor tools that provide more ways to interact with your game's Economy.

Scriptable objects

You can interact with your economy directly through the Unity Editor using the scriptable objects provided by the Economy package.

There are scriptable objects for balances, inventories and virtual purchases.

For these objects to work you need to follow the usual Economy setup flows, including configuring your Economy through the Unity Cloud Dashboard and signing in via Authentication.

To create the objects, right-click in your project window, then Create > Economy Tools, and select the desired helper.

Example workflow

  1. Create a button game object
  2. Create a new purchases helper in your project and configure the settings.
  3. Drag the purchases helper into the on click event of the button in the inspector.
  4. Select the InvokeAsync() method as the method to be triggered on click.

When you click the button, you will attempt to make that purchase.

Player balances helper

This helper allows you to set, increment and decrement a player's balance. When configuring your event, trigger the InvokeAsync() method on this object.

  • Action: The method of interaction (set, increment or decrement).
  • Currency ID: The ID of the currency you want to modify.
  • Amount: The amount by which you want to modify the currency.

Player inventories helper

This helper allows you to add and update player's inventory items. When configuring your event, trigger the InvokeAsync() method on this object.

  • Action: The method of interaction (add or update).
  • Players Inventory Item ID: The ID of the player's inventory item you want to add or update. If adding, you can leave this blank and an ID will be auto-generated for you.
  • Item ID: Only required for the Add action. The inventory item ID of the item you want to add to the player's inventory.
  • Instance Data JSON: Only required for the Update action. The instance data you want to add to the player's inventory item you are updating. This must be valid JSON.

Purchases helper

This helper allows you to make purchases. When configuring your event, trigger the InvokeAsync() method on this object.

This helper does not support real money purchases.

  • Purchase ID: The ID of the virtual purchase you want to make.