Game Development Reference
In-Depth Information
CustomAssetUtility.CreateAsset<InventoryItem>();
}
}
With this in place, we can now create some inventory items. Create a new folder in
As-
sets\Resources
named
Inventory Items
, navigate to that folder, and create a
new
InventoryItem
class from the
Create
menu (right-click on
Create
or use the
Project
folder window's
Create
menu option).
With the new
InventoryItem
asset created, we can configure our first weapon. Re-
name the asset to
Lv0_Sword
and then configure its properties as shown in the follow-
ing screenshot:
You can configure the properties using the following settings:
• Set the
Sprite
property to a sword sprite image from the weapon icons spritesheet
(
Weapon Icons 1_11
)
• Scale the image up as by default it is quite small (
X 2
,
Y 2
,
Z 0
)
• Give it a name via the
Item Name
field
• Set
Cost
to
0
to denote it's a free item
• Set
Strength
to
5
and
Defense
to
0
so the weapon at least has some effect
Save the sword image and then create another weapon or two in the same manner. I also
created an axe with the same values.