private void Awake() { if (GetComponent <VRTK_ControllerEvents>() == null) { VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "VRTK_ControllerEvents_ListenerExample", "VRTK_ControllerEvents", "the same")); return; } GetComponent <VRTK_ControllerEvents>().TriggerPressed += new ControllerInteractionEventHandler(SnapobjectToController); GetComponent <VRTK_ControllerEvents>().TriggerReleased += new ControllerInteractionEventHandler(UnSnapObject); GetComponent <VRTK_ControllerEvents>().TouchpadPressed += new ControllerInteractionEventHandler(UIPointerPressed); GetComponent <VRTK_ControllerEvents>().TouchpadReleased += new ControllerInteractionEventHandler(UIPointerReleased); GetComponent <VRTK_InteractTouch>().ControllerTouchInteractableObject += new ObjectInteractEventHandler(onGrabbedTouched); GetComponent <VRTK_InteractTouch>().ControllerUntouchInteractableObject += new ObjectInteractEventHandler(onGrabbedUntouched); GetComponent <VRTK_InteractGrab>().ControllerGrabInteractableObject += GrabThrowable_ControllerGrabInteractableObject; autoGrab = GetComponent <VRTK_ObjectAutoGrab>(); autoGrab.enabled = false; Menu = LeftController.GetComponent <ThrowableMenuController>(); if (Menu == null) { Debug.LogError("Error loading menu controller"); } formulaController = GetComponent <FormulaController>(); if (formulaController == null) { Debug.LogError("Error loading FormulaController controller"); } sliderHandler = LeftController.GetComponent <SliderHandler>(); if (sliderHandler == null) { Debug.LogWarning("Error fetching SliderHandler from left controller"); } if (GC == null) { throw new NotImplementedException("Please attach the garbage collector Object to the grab throwable Script in Right controller"); } }
// Use this for initialization void Start() { menu = Menu.GetComponent <ThrowableMenuController>(); }
// Use this for initialization void Start() { menuController = gameObject.GetComponent <ThrowableMenuController>(); this.eModul = 1.5f; changeEModul(1.5f); }