Hi, I got a script that I want it to show another GUI script after the button is clicked.
Code below is the code that after the button is click to show the another script GUI
var windowRect : Rect = Rect (100,100, 100, 50);
function OnGUI () {
windowRect = GUI.Window (1, windowRect, WindowFunction, "Instruction");
}
function WindowFunction (windowID : int) {
var textFieldString = "text field";
GUI.Label (Rect (25, 15, 300, 30), "Input the keyword to");
GUI.Label (Rect (25, 30, 300, 30), "to search for the book.");
textFieldString = GUI.TextField (Rect (25, 50, 100, 30), textFieldString);
if (GUI.Button (Rect (160, 100, 100, 50), "Search")){
\\This is the location i want to change
\\guiEnable var to true
}
}
=========================================================================================
This script is the code that after the value is change the GUI will be shown
static var guiEnable = false;
function OnGUI(){
if (guiEnable==true){ \If true then show the GUI below
GUI.Label (Rect (25, 15, 300, 20), "*~Information~*");
GUI.Label (Rect (25, 30, 300, 20), "This is the Newspaper");
if(GUI.Button (Rect (160, 100, 100, 50), "Close")){
guiEnable = false
}
}
}
Please anyone can help me with my code? Thanks in advance.
Im sorry, that I did not put the code in proper format. I’m still new here and i try use the format but I don’t get it to work.