private void TriggerExit(Collider other, VRSensor sensor) { ControllerInformation info = controllerManager.GetControllerInfo(sensor.GetComponent <SteamVR_TrackedObject>()); GrabObjectInformation grabObjInfo = (GrabObjectInformation)info.GetFunctionalityInfoByType(typeof(GrabObjectInformation)); if (!grabObjInfo.collidingObject) { return; } grabObjInfo.collidingObject = null; }
private void TriggerStay(Collider other, VRSensor sensor) { ControllerInformation controller = controllerManager.GetControllerInfo(sensor.GetComponent <SteamVR_TrackedObject>()); ButtonInteractInformation grabObjInfo = (ButtonInteractInformation)controller.GetFunctionalityInfoByType(typeof(ButtonInteractInformation)); if (grabObjInfo.buttonInRange == null) { VRButton button = other.GetComponent <VRButton>(); if (button != null) { grabObjInfo.buttonInRange = button; button.OnControllerEnter(); } } }
private void TriggerExit(Collider other, VRSensor sensor) { ControllerInformation controller = controllerManager.GetControllerInfo(sensor.GetComponent <SteamVR_TrackedObject>()); ButtonInteractInformation grabObjInfo = (ButtonInteractInformation)controller.GetFunctionalityInfoByType(typeof(ButtonInteractInformation)); VRButton button = other.GetComponent <VRButton>(); //we check if it was a button and if it was the one in range if (button != null && button == grabObjInfo.buttonInRange) { grabObjInfo.buttonInRange = null; //we get rid of the color again button.OnControllerLeave(); } }
private void TriggerEnter(Collider other, VRSensor sensor) { ControllerInformation controller = controllerManager.GetControllerInfo(sensor.GetComponent <SteamVR_TrackedObject>()); ButtonInteractInformation grabObjInfo = (ButtonInteractInformation)controller.GetFunctionalityInfoByType(typeof(ButtonInteractInformation)); VRButton button = other.GetComponent <VRButton>(); //we check if it is a button and we are not already interacting with one if (button != null && grabObjInfo.buttonInRange == null) { grabObjInfo.buttonInRange = button; //And then we apply color to the button.. button.OnControllerEnter(); } }
private void TriggerStay(Collider other, VRSensor sensor) { ControllerInformation info = controllerManager.GetControllerInfo(sensor.GetComponent <SteamVR_TrackedObject>()); SetCollidingObject(other, info); }