- Home /
Question by
keegan55001 · Sep 26, 2017 at 11:48 PM ·
strange ioc
UCE0001 ; Expected
// JavaScript function OnGUI () { // Make a background box GUI.Box (Rect (10,10,100,90), "Loader Menu");
// Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
if (GUI.Button (Rect (20,40,80,20), "Level 1")) {
Application.LoadLevel (1);
}
// Make the second button.
if (GUI.Button (Rect (20,70,80,20), "Level 2")) {
Application.LoadLevel (2);
}
}
//C# using UnityEngine; using System.Collections;
public class GUITest : MonoBehaviour {
void OnGUI () {
// Make a background box
GUI.Box(new Rect(10,10,100,90), "Loader Menu");
// Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
if(GUI.Button(new Rect(20,40,80,20), "Level 1")) {
Application.LoadLevel(1);
}
// Make the second button.
if(GUI.Button(new Rect(20,70,80,20), "Level 2")) {
Application.LoadLevel(2);
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Sprite Editor Error: NullReferenceException 1 Answer
My Build Platform won't change. 0 Answers
Spherical panorama texture with transparent sky 0 Answers
Jumpscare Need Help 2 Answers
Need help with script 1 Answer