Graphics Reference
In-Depth Information
public void SetScore(int num)
{
score=num;
}
public int GetHealth()
{
return health;
}
public void AddHealth(int num)
{
health+=num;
}
public void ReduceHealth(int num)
{
health-=num;
}
public void SetHealth(int num)
{
health=num;
}
public bool GetIsFinished()
{
return isFinished;
}
public void SetIsFinished(bool aVal)
{
isFinished=aVal;
}
}
3.4.1 Script Breakdown
After the variable declarations, the first thing BaseUserManager.cs contains is a function
to populate the player stats with some default values, just to avoid any trouble when trying
to access them.
public virtual void GetDefaultData()
{
playerName="Anon";
score=0;
level=1;
health=3;
highScore=0;
isFinished=false;
}
The rest of the class deals with getting and setting the player data. The logic is literally
just getting or setting variables, so if you need to look at it in detail, refer back to the full
script at the start of this section. For clarity, here is a list of the rest of the functions:
Search WWH ::




Custom Search