Game Development Reference
In-Depth Information
using UnityEngine;
public class Player : Entity
{
public string[] Inventory;
public string[] Skills;
public int Money;
}
Note
Preferably, all the attributes of any class should be of the read-only type outside of the
class itself (unless there is a very good reason for it). This is to ensure that you don't mis-
takenly change a class's value without knowing why. It might sound easier to just keep up-
dating everything, but at some point, while you are debugging, you will want to know
why things are changing. If any code updates these values, then you will literally spend
hours trying to find why. If you need to change values, then you need to implement beha-
viors (see the following sections).
More later
To show you how to build the architecture progressively in this project, we will add more
classes to each section; we'll keep things simple and build the project with a strong found-
ation.
We already have our base entity in place from which all the game entities as well as our
player are driven, so let's look at implementing them further.
Search WWH ::




Custom Search