public void Start() { gameObject.AddComponent(typeof(LevelLoader)); levelLoader = GetComponent <LevelLoader>(); haptics = GetComponent <Haptics>(); haptics.SetInputSource(leftHandRay ? SteamVR_Input_Sources.LeftHand : SteamVR_Input_Sources.RightHand); }
private void SelectPointer(Transform activePointer, Transform inactivePointer, SteamVR_Input_Sources activeHand) { activePointer.GetComponent <LineRenderer>().enabled = true; inactivePointer.GetComponent <LineRenderer>().enabled = false; activePointer.transform.Find("Dot").GetComponent <MeshRenderer>().enabled = true; inactivePointer.transform.Find("Dot").GetComponent <MeshRenderer>().enabled = false; Camera camera = activePointer.GetComponent <Camera>(); foreach (GameObject elem in rayInputElements) { elem.GetComponent <Canvas>().worldCamera = camera; } inputModule.m_Camera = camera; inputModule.m_TargetSource = activeHand; haptics.SetInputSource(activeHand); }