So, im creating a script for a project im working on.
And basically i have a script that shows some GUI when i click the “menu button” in game,
The gui shows some buttons. And when one of the GUI buttons is clicked, i want it to close down the GUI already up and load a new script which will show the GUI of my inventory for example…
// Inventory
if(GUI.Button(new Rect(Screen.width / 2 - 245,(Screen.height / 2) - 150,100,100), “Inventory”))
{
// Here is where i want it to load a new script / GUI from a different script
}
How would i go about doing this?
Thanks in advance
// edit, i already have a function to close the GUI from this script, so if i did the same on another script, would that work?
Or if i did that, how would i go about calling the function on the other script to load the new script when the button is pressed in this script…
Maybe that makes more sense?