Hello everybody please i want to display a Gui after another but it didn’t work does Unity don’t allow this ??
Here’s my code
void OnGUI()
{
DisplayProfils()
}
void DisplayProfils()
{
GUI.BeginGroup(new Rect(Screen.width*0.3f,Screen.height*0.2f,Screen.width*0.5f,Screen.height*0.5f));
GUI.Box(new Rect(0,0,Screen.width*0.5f,Screen.height*0.5f),"Choix du profil");
if(GUI.Button(new Rect(Screen.width*0.2f,70,150,50),"profil1") )
{
CreateNewProfil();
}
GUI.EndGroup();
}
void CreateNewProfil()
{
GUI.BeginGroup(new Rect(Screen.width*0.3f,Screen.height*0.4f,Screen.width*0.3f,Screen.height*0.5f));
GUI.Box(new Rect(0,0,Screen.width*0.3f,Screen.height*0.3f),"Crer votre profil");
GUI.Button(new Rect(Screen.width*0.2f,70,150,50),"profil1");
print("POP");
GUI.EndGroup();
}
the CreateNewProfil() don’t display when i click the button , can i make something to fix it?
Thank you