Encore 2-3 trucs à régler, et le menu est bon (PS, le script du GUI est vraiment basique : )
Code (cpp):
using UnityEngine;
using System.Collections;
public class LevelMenu : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI(){
if(GUI.Button(new Rect(Screen.width/2-80, Screen.height/2-120, 100, 30), "Plaines")){
Application.LoadLevel("Lvl1");
}
if(GUI.Button(new Rect(Screen.width/2+25, Screen.height/2-120, 100, 30), "Montagnes")){
Application.LoadLevel("Lvl2");
}
if(GUI.Button(new Rect(Screen.width/2-80, Screen.height/2-80, 100, 30), "Plage")){
Application.LoadLevel("Lvl3");
}
if (GUI.Button (new Rect (Screen.width / 2 + 25, Screen.height / 2 -80, 100, 30), "Foret")) {
Application.LoadLevel ("Lvl4");
}
if(GUI.Button(new Rect(Screen.width/2-80, Screen.height/2-40, 100, 30), "Nether")){
Application.LoadLevel("Lvl5");
}
if (GUI.Button (new Rect (Screen.width / 2 + 25, Screen.height / 2 -40, 100, 30), "End")) {
Application.LoadLevel ("Lvl6");
}
if(GUI.Button(new Rect(Screen.width/2-50, Screen.height/2-80+90, 150, 30), "Retour au menu")){
Application.LoadLevel("Menu");
}
}
}