Log in or register to post comments

When I touch cancel button my model isn't hide

October 21, 2013 - 11:47pm #1

Hello,

When I tracker image target my model is show.And when I touch cancel button my model  not hide.

Why my model not hide ?

This code ;

private void hide(){
	Renderer[] rendererComponents = GetComponentsInChildren<Renderer>(true);
        Collider[] colliderComponents = GetComponentsInChildren<Collider>(true);
 
        // Disable rendering:
        foreach (Renderer component in rendererComponents)
        {
            component.enabled = false;
        }
 
        // Disable colliders:
        foreach (Collider component in colliderComponents)
        {
            component.enabled = false;
        }
	
}
public void OnGUI()
{
if (mCloudRecoBehaviour.CloudRecoInitialized && !mCloudRecoBehaviour.CloudRecoEnabled)
        {
            GUIStyle cancelButtonStyle;
            if (mButtonGUIStyles.TryGetValue("CancelButton", out cancelButtonStyle))
            {
                float buttonWidth = cancelButtonStyle.normal.background.width * DeviceDependentScale;
                float buttonHeight = cancelButtonStyle.normal.background.height * DeviceDependentScale;
                
                if (GUI.Button(new Rect(Screen.width - buttonWidth, 0, buttonWidth, buttonHeight),string.Empty,cancelButtonStyle))
                {
					hide();
                    mCloudRecoBehaviour.CloudRecoEnabled = true;
                    mButtonPressed = true;					
					
                    //mContentManager.TargetDeleted();
                }
            }
        }
}
 

When I touch cancel button my model isn't hide

October 22, 2013 - 12:22am #2
Log in or register to post comments