how can I destroy (permanantly in game…but not in the Hieriachy) my GUI after pressed?
my button script is
var apple : GameObject;
function OnGUI() {
if ( GUILayout.Button( “Destroy Cube”) ) {
Destroy( apple );
}
}
how can I destroy (permanantly in game…but not in the Hieriachy) my GUI after pressed?
my button script is
var apple : GameObject;
function OnGUI() {
if ( GUILayout.Button( “Destroy Cube”) ) {
Destroy( apple );
}
}
var apple : GameObject;
var showGUI = true;
function OnGUI()
{
if (showGUI)
{
if ( GUILayout.Button( "Destroy Cube") )
{
showGUI = false;
Destroy( apple );
}
}
}
thank you so much:)