ItemObject.cs

v4.0

ItemObject is a Scriptable Object which holds references to all the data set up with the Items Module. It implements IAffectStats and IFitInInventory

ItemObject.cs
public string ObjectName
public string ObjectType

Setup

The objectType of an Item Object is the name of the folder the Scriptable Object is in. Create one named as you'd like, and right-click inside to select the menu option:

/Create/Game Modules/Items/Item Object

This will create an ItemObject Scriptable Object in your project. Select that and view the Inspector to begin setting up your data. The name of the Scriptable Object is saved as the objectName value.

Note that names of Item Objects must be unique. The console will provide a warning if there are multiple Item Objects with the same name.

Use ItemAttributes to differentiate between things like "Wooden Sword", "Sword", and "Master Sword". In this context, both "Wooden" and "Master" would be ItemAttributes.

Inspector

Select your new object and view it in the Inspector. Here is where you can manage all the details about this Item Object. Note there are multiple tabs, each of which provide access to specific, and optional, information.

The Quest Item bool is used to identify this ItemObject as something special, which may need special rules. For example, the drag-and-drop Inventory System will not let a player "drop" a quest item, as that may result in the quest item being lost. Your own systems may choose to make use of this value.

fdasfas

Last updated