void Awake() { input = GetComponentInChildren <PhysicalDataInput>(); Controller.SetController(this); GetComponent <VRTK_InteractableObject>().InteractableObjectUngrabbed += OnUngrabbed; deviceBrowserObject = FindObjectOfType <DeviceBrowserObject>(); oscEventDispatcher = FindObjectOfType <OSCEventDispatcher>(); }
void ISoundModule.PositionBrowser() { DeviceBrowserObject browser = deviceBrowserObject; //Position browser above module browser.transform.position = transform.position + Vector3.up * Controller.Config.browserYOffset; //Rotate browser towards user's headset Quaternion lookAtPlayer = Quaternion.LookRotation(browser.transform.position - GameObject.FindGameObjectWithTag("Headset").transform.position); browser.transform.rotation = Quaternion.Euler(browser.transform.rotation.eulerAngles.x, lookAtPlayer.eulerAngles.y, browser.transform.rotation.eulerAngles.z); }