- Home /
how to hide this if button click
Hi all !
anyone help me, please
i'm new in unity
Display my Project :
what i can do this before click Button Profile "unity watermark-small" (SP) to hide
n button press show this
my source:
if (GUILayout.Button("Profil"))
{
if(CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_TRIGGERAUTO))
mFocusMode = CameraDevice.FocusMode.FOCUS_MODE_TRIGGERAUTO;
mMenuToShow = MenuMode.MENU_OFF;
mButtonPressed = true;
}
if (GUILayout.Button("Keluar"))
{
Application.Quit();
mMenuToShow = MenuMode.MENU_OFF;
mButtonPressed = true;
}
or what can change watermark-small so can show n hide "SP"
Answer by Montraydavis · Nov 23, 2012 at 06:29 PM
I have not a clue what your issue is. The image just shows the Unity Toolbar, and a completely white background . . . O.o
But in order to hide an object on click, use the following
Unity 3.x:
function OnMouseDown ( )
{
gameObject.active = false ;
}
Unity4.x:
function OnMouseDown ( )
{
gameObject.SetActive ( false ) ;
}
--Attach the script to the object you want to be hidden on_click .
if (GUILayout.Button("Profil"))
{
gameObject.active = false;
m$$anonymous$$enuToShow = $$anonymous$$enu$$anonymous$$ode.$$anonymous$$ENU_OFF;
mButtonPressed = true;
}
if (GUILayout.Button("$$anonymous$$eluar")) {
Application.Quit();
m$$anonymous$$enuToShow = $$anonymous$$enu$$anonymous$$ode.$$anonymous$$ENU_OFF;
mButtonPressed = true;
}
you mean like this
press "Profil" all object hide :(
i want just hide GUITexture = "Unity watermark-small"
You need to attach that script to the GUI object. Works the same way as any other gameobject.
Just drag the script to the component in the hierarchy.