Dataset Setup

Instructions for setting up a dataset.

A dataset is used to assign custom static data to the item. It's good for referencing Unity objects such as the item prefab that should be applied to the player character when the item is equipped, VFX assets to apply to the item, or anything else related to the item.

Setup Steps

Step 1: Create Your Dataset

Create a class that inherits from Dataset and add your custom fields.

using Esper.Inventool.Items;
using UnityEngine;

[CreateAssetMenu(fileName = "Custom Dataset", menuName = "Inventool/Custom Dataset")]
public class CustomDataset : Dataset
{
    public GameObject itemPrefab;
}

Step 2: Create An Instance

Create an instance of the dataset by right-clicking in the project section and navigating to the menu option created in Step 1: Create Your Dataset.

Step 3: Assign Dataset In Settings

circle-info

Editing a dataset does not require reassignment.

Open settings from Window > Inventool > Settings and drag and drop the dataset instance into the Dataset field. A prompt will open asking you to confirm the action. Click "confirm," but remember, all previous dataset data will be lost for all items.

Step 4: Final Notes

The dataset should be set up. Open the object manager and select an item. You will see new options in the Dataset section. You may now freely use the new fields.

You can set methods you add to your dataset on the On Equip, On Unequip, and On Consume fields.

At runtime, you can access a dataset from an ItemStack like this:

Last updated