Game Development Reference
In-Depth Information
Updating the player inventory definition
Now that we have a definition for
InventoryItem
folders, we can update the
Player
class so that the player can carry the correct item. So, open the
Player
class under
As-
sets\Scripts\Classes
and update the following line to use the new
Invent-
oryItem
class instead of a string:
using System.Collections.Generic;
public class Player : Entity
{
public List<InventoryItem> Inventory = new
System.Collections.Generic.List<InventoryItem>();
public string[] Skills;
public int Money;
}