Game Development Reference
In-Depth Information
Here, we just created the necessary variables for our Menu window, as shown in the
following screenshot:
The result of t_statusBox1 , t_statusBox2 , and t_
skillBox will be shown in the Creaing the Status tab secion.
4. Next, we will set b_openMenu to false in the Start funcion, because we
don't want our menu to show unil the player presses the M key, so type the
code as follows:
public function Start () : void {
b_openMenu = false; //Set our menu disabled at the first run
}
5. Then, we go to the Update funcion and set it as follows:
// Update is called once per frame
public function Update () : void {
//When the user press M key show the menu window
if (Input.GetKey(KeyCode.M)) {
if (b_openMenu == false) {
b_openMenu = true;
}
}
}
 
Search WWH ::




Custom Search