Beginning of dialog window. Escape will cancel and close the window.
End of dialog window.
Player
using UnityEngine;
using System.Collections;
publicclassPlayer
{
//Member variables can be referred to as//fields.privateint experience;
//Experience is a basic propertypublicint Experience
{
get
{
//Some other codereturn experience;
}
set
{
//Some other code
experience = value;
}
}
//Level is a property that converts experience//points into the leve of a player automaticallypublicint Level
{
get
{
return experience / 1000;
}
set
{
experience = value * 1000;
}
}
//This is an example of an auto-implemented//propertypublicint Health{ get; set;}
}
Game
using UnityEngine;
using System.Collections;
publicclassGame : MonoBehaviour
{
voidStart(){
Player myPlayer = new Player();
//Properties can be used just like variables
myPlayer.Experience = 5;
int x = myPlayer.Experience;
}
}