Comment on page
LootItemsare simple Scriptable Objects which group
ItemObjectobjects together in preparation for use with
LootBoxes. The aim is to make it eaiser to allow randomized
ItemObjectsto appear in
LootBoxeswith a fair amount of control. You may wish to create
LootItemscalled something like:
- Level 1 Items
- Legendary Rewards Lvl 50+
- Goblin Drops
LootItemscan be utilized in
LootBoxesby themselves or with other
LootItemsto add even more variety.
Decide where you'd like to store your
LootItemobject, and right-click inside to select the menu option:
/Create/Game Modules/Create/Loot Item
This will create a
LootItemScriptable Object in your project. Select that and view the Inspector to begin setting up your data.
There is an optional "internal description" text area. This is included so you can describe the goals of the
LootItemobject. It will be visible later when you populate your
All of your
ItemObjectswill be displayed in the yellow drop downs, with the
objectTypeson the left. Click "Add" to add a single
ItemObject, or "Add All" to add all of the selected type. You can remove individual
ItemObjectsafter, if you'd like.
Once you have added all the ItemObjects, you're done!
If you set up
LootBoxobjects using this
LootItemsobject with "random" selected, anything you add to this
LootItemsobject will automatically be included in the potential
LootBoxesare spawned in your game.
This way you can always add new items without having to go back to add them to all the various
LootBoxesthey may show up in.
Feel free to look at
LootItems.cs, but the script is not meant to be used outside of the flow outlined above. Of course if you think of clever ways to use it, that's great!