natka Posted September 19, 2018 Posted September 19, 2018 Does the Wave SDK have some kind of built in fade controller like SteamVR does? Im converting a project from Vive to Vive Focus and looking for a simple solution to implement fade.
Tony PH Lin Posted September 26, 2018 Posted September 26, 2018 Hi , I receive the instruction from internal and please check if it's what you need. Listen to CONTROLLER_MODEL_LOADED broadcast to receive controller instance. Find all children of controller. Find GameObject with beam / pointer in children. private GameObject rightController = null, leftController = null;void OnEnable(){ WaveVR_Utils.Event.Listen (WaveVR_Utils.Event.CONTROLLER_MODEL_LOADED, OnControllerLoaded);}void OnControllerLoaded(params object[] args){ WVR_DeviceType _type = (WVR_DeviceType)args [0]; if (_type == WVR_DeviceType.WVR_DeviceType_Controller_Right) { this.rightController = (GameObject)args [1]; PrintDebugLog ("OnControllerLoaded() right controller: " + this.rightController.name); } if (_type == WVR_DeviceType.WVR_DeviceType_Controller_Left) { this.leftController = (GameObject)args [1]; PrintDebugLog ("OnControllerLoaded() left controller: " + this.leftController.name); }}void OnDisable(){ WaveVR_Utils.Event.Remove (WaveVR_Utils.Event.CONTROLLER_MODEL_LOADED, OnControllerLoaded);}private void listControllerObjects(GameObject ctrlr){ if (ctrlr == null) return; WaveVR_Beam _beam = null; WaveVR_ControllerPointer _pointer = null; // Get all children. GameObject[] _objects = new GameObject[ctrlr.transform.childCount]; for (int i = 0; i < ctrlr.transform.childCount; i++) _objects[i] = ctrlr.transform.GetChild (i).gameObject; // Find beam. for (int i = 0; i < _objects.Length; i++) { _beam = _objects [i].GetComponentInChildren<WaveVR_Beam> (); if (_beam != null) break; } Debug.Log ("Find beam: " + _beam.name); // Find pointer. for (int i = 0; i < _objects.Length; i++) { _pointer = _objects [i].GetComponentInChildren<WaveVR_ControllerPointer> (); if (_pointer != null) break; } Debug.Log ("Find pointer: " + _pointer.name);}
Recommended Posts
Archived
This topic is now archived and is closed to further replies.