GameLootBox.cs

v4.0

GameLootBox is used at runtime, and should be added to any object that has a LootBox. It implements IHaveInventory and IHaveDictionaries. Unlike other Game[Object] scripts, this one is a Monobehaviour.

When you add GameLootBox, or a class that you created which inherits from GameLootBox, there are a few variables in the Inspector to pay attention to.

The Loot Box Uid is empty by default. You'll need to populate that.

The Game Id is automatically generated. This is a unique in-game identifier for this GameLootBox. No two Game Id values should be the same.

The "Generate On Awake" toggle determines whether the contents of the GameLootBox generate on Awake() or later, when you specifically tell it to generate. You may wish to delay generation if there are a lot of GameLootBoxes in your scene, or if in-game parameters, such as a players stats, may affect the content generated.

You will need to popualte the Loot Box Uid. To do this, bring up the LootBox object you'd like to use in the Inspector, and click the "Copy Uid" button by the Uid, at the top of the window.

The Uid on the LootBox scriptable object can be used in many GameLootBoxes.
Generating & Handling LootCustom Loot Generation Algorithm

Last updated

Was this helpful?