private void OnDestroy() { if (instance == this) { instance = null; } }
void Awake() { if (instance != null) { throw new System.Exception("You have more than 1 AvatarHandler in the scene."); } // Initialize the static class variables instance = this; }
private void Awake() { if (instance == null) { instance = this; } vrManager = GetComponent <WebVRManager>(); if (vrManager.vrState == WebVRState.ENABLED) { head = vrHead; } }
private void Update() { // Avatar if (!avatar && HPTKCore.core.model.avatars.Count > 0) { avatar = HPTKCore.core.model.avatars[0].handler; } // Camera rig if (!cameraRig) { searchResult = GameObject.FindObjectOfType <OVRCameraRig>(); if (searchResult != null) { cameraRig = searchResult; Apply(); } } }