예제 #1
0
        protected virtual void ToggleControllerVisibility(bool visible)
        {
            GameObject modelContainer = VRTK_DeviceFinder.GetModelAliasController(interactTouch.gameObject);

            if (grabbedObject != null)
            {
                VRTK_InteractControllerAppearance[] controllerAppearanceScript = grabbedObject.GetComponentsInParent <VRTK_InteractControllerAppearance>(true);
                if (controllerAppearanceScript.Length > 0)
                {
                    controllerAppearanceScript[0].ToggleControllerOnGrab(visible, modelContainer, grabbedObject);
                }
            }
            else if (visible)
            {
                VRTK_SharedMethods.SetRendererVisible(modelContainer, grabbedObject);
            }
        }