Graphics Reference
In-Depth Information
The scripting for this class is straightforward and contains mostly variable declarations:
public class ExtendedCustomMonoBehavior : MonoBehavior
{
// This class is used to add some common variables to
// MonoBehavior, rather than constantly repeating
// the same declarations in every class.
public Transform myTransform;
public GameObject myGO;
public Rigidbody myBody;
public bool didInit;
public bool canControl;
public int id;
[System.NonSerialized]
public Vector3 tempVEC;
[System.NonSerialized]
public Transform tempTR;
public virtual void SetID( int anID )
{
id= anID;
}
}
2.2.4 BaseUserManager.cs
The user manager is a script object made by the player manager to store player properties
such as
Player name
Current score
Highest score
Level
Health
Whether or not this player has finished the game
The user manager also contains functions to manipulate its data
Below is the BaseUserManager.cs script in full:
public class BaseUserManager : MonoBehavior
{
// gameplay specific data
// we keep these private and provide methods to modify them
// instead, just to prevent any accidental corruption
// or invalid data coming in
Search WWH ::




Custom Search