it was supposed to open Level1 when the start button was pressed but it says :
Level ‘Level1’ (-1) couldn’t be loaded because it has not been added to the build settings.
To add a level to the build settings use the menu File->Build Settings…
UnityEngine.Application:LoadLevel(String)
Mainmenu:OnGUI() (at Assets/Scripts/Mainmenu.cs:22)
my code:
using UnityEngine;
using System.Collections;
public class Mainmenu : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI(){
//menu box
GUI.Box(new Rect(10,10,100,200), "Menu");
//start buttton
if (GUI.Button (new Rect (30,30,50,20), "Start")) {
Debug.Log ("Loading....");
Application.LoadLevel("Level1");
}
}
}
thanks both of guys you really helped me.
– X_rploader_Boss