- Home /
How to make GUI pop up when you touch other gui
Hello, i want to make some c# script that causes some GUI to appear, i already have the script in place that will recognise the touch, i just need the couple of lines of code that can make a GUI pop up to appear.
Comment
Answer by D3ltaVyyb · May 05, 2014 at 07:36 PM
Hey, How I do it is by using booleans.
public class Display : MonoBehaviour
{
public bool guiUP;//false by default
void OnGUI()
{
if (GUI.Button(new Rect(0,0,100,50),"Toggle GUI"))
{
guiUP = true;
//OR guiUP = !guiUP for a real toggle//
}
if(guiUP)
{
///Display your stuff
}
}
}
Your answer
Follow this Question
Related Questions
Touch not working on guiTexture. 1 Answer
Hold Down GUIButton? 1 Answer
Adding Touch Controls to Car Game 1 Answer
Multiple Cars not working 1 Answer
Turning touch to rotation 1 Answer