- Home /
This question was
closed Aug 29, 2016 at 04:19 PM by
Iluxa147 for the following reason:
Question is off-topic or not relevant
how can I disapear a button after push?
I use Unity 3.5 . My code
public class Scr_button : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
private void OnGUI()
{
if (GUI.Button(new Rect(15, 15, 100, 50), "Start"))
{
}
}
}
Comment
if (!startClicked && GUI.Button(new Rect(15, 15, 100, 50), "Start")){
startClicked = true;
}
$$anonymous$$y new code
if (!startClicked && GUI.Button(new Rect(15, 15, 100, 50), "Start")) { startClicked = true;
}
And I have an error error CS0103: The name `startClicked' does not exist in the current context
you just need to declare startClicked boolean in class.
bool startClicked;
Follow this Question
Related Questions
Destroying a Button when you click it. 1 Answer
How to Detect if a Button is Not Being Pressed 0 Answers
Jump when you press on-screen button 1 Answer