protected virtual void OnEnable() { aliasTracker = VRTK_DeviceFinder.GetScriptAliasTracker(gameObject); if (aliasTracker == null) { aliasTracker = gameObject; } index = VRTK_DeviceFinder.GetTrackerIndex(gameObject); OnTrackerEnabled(SetEventPayload()); }
protected virtual void Update() { uint checkIndex = VRTK_DeviceFinder.GetTrackerIndex(gameObject); if (checkIndex != index) { uint previousIndex = index; index = checkIndex; OnTrackerIndexChanged(SetEventPayload(previousIndex)); } VRTK_SDK_Bridge.TrackerProcessUpdate(VRTK_ControllerReference.GetControllerReference(index)); if (aliasTracker != null && gameObject.activeInHierarchy && !aliasTracker.activeSelf) { aliasTracker.SetActive(true); } }