Je veux faire un menu de lancement comme dans ce tuto : http://openclassrooms.com/courses/unity ... rsonnalise
J'ai donc créé 3 textes (le Titre, Start et Exit) que j'ai mis dans un canvas. Pour les 2 derniers, je leur ai attribué le script suivant :
Code : Tout sélectionner
#pragma strict
var son : AudioClip;
var levelSuivant : String = "Exit";
function OnMouseDown() {
GetComponent.<AudioSource>().PlayOneShot(son, 0.7F);
if (levelSuivant == "Exit"){
Application.Quit();
Debug.Log("Exit clicked!");
}
else{
Application.LoadLevel(levelSuivant);
Debug.Log("Start clicked!");}
}
Quelqu'un pourrait-il m'aider ?
Merci