private void Awake() { deviceConnectedAction = SteamVR_Events.DeviceConnectedAction(OnDeviceConnected); hideRenderModelsAction = SteamVR_Events.HideRenderModelsAction(OnHideRenderModels); modelSkinSettingsHaveChangedAction = SteamVR_Events.SystemAction(EVREventType.VREvent_ModelSkinSettingsHaveChanged, OnModelSkinSettingsHaveChanged); }
void Awake() { UpdateTargets(); inputFocusAction = SteamVR_Events.InputFocusAction(OnInputFocus); deviceConnectedAction = SteamVR_Events.DeviceConnectedAction(OnDeviceConnected); trackedDeviceRoleChangedAction = SteamVR_Events.SystemAction(EVREventType.VREvent_TrackedDeviceRoleChanged, OnTrackedDeviceRoleChanged); }
// Constructor: Attach callback function to Vive Tracker data UpdateFoveFromViveTracker() { newPosesAction = SteamVR_Events.NewPosesAction(onNewPose); deviceConnectedAction = SteamVR_Events.DeviceConnectedAction(onNewDeviceConnection); lastDriftCorrectionTimeMs = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; FoveViveToWorldSpace = Quaternion.Euler(0.0f, 0.0f, 0.0f); rotateSetupDegree = 0; isHeadsetCalibrated = false; }
static ViveRole() { for (int i = roleIndice.Length - 1; i >= 0; --i) { roleIndice[i] = OpenVR.k_unTrackedDeviceIndexInvalid; } RefreshControllerIndex(default(VREvent_t)); for (int i = SteamVR.connected.Length - 1; i >= 0; --i) { if (SteamVR.connected[i]) { OnDeviceConnected(i, true); } } SteamVR_Events.DeviceConnectedAction(OnDeviceConnected).Enable(true); SteamVR_Events.SystemAction("TrackedDeviceRoleChanged", RefreshControllerIndex).Enable(true); }
static ViveRole() { for (uint i = 0; i < MAX_DEVICE_COUNT; ++i) { s_class[i] = ETrackedDeviceClass.Invalid; s_modelNum[i] = string.Empty; s_serialNum[i] = string.Empty; } // update the ViveRole system with initial connecting state var system = OpenVR.System; if (system == null) { for (int index = 0; index < MAX_DEVICE_COUNT; ++index) { OnDeviceConnected(index, false); } } else { for (int index = 0; index < MAX_DEVICE_COUNT; ++index) { OnDeviceConnected(index, system.IsTrackedDeviceConnected((uint)index)); } } SteamVR_Events.DeviceConnectedAction(OnDeviceConnected).Enable(true); SteamVR_Events.SystemAction(EVREventType.VREvent_TrackedDeviceRoleChanged, OnTrackedDeviceRoleChanged).Enable(true); // assign default role map handlers AssignMapHandler(DefaultDeviceRoleHandler); AssignMapHandler(DefaultHandRoleHandler); AssignMapHandler(DefaultTrackerRoleHandler); AssignMapHandler(DefaultBodyRoleHandler); }
SteamVR_ControllerManager() { inputFocusAction = SteamVR_Events.InputFocusAction(OnInputFocus); deviceConnectedAction = SteamVR_Events.DeviceConnectedAction(OnDeviceConnected); trackedDeviceRoleChangedAction = SteamVR_Events.SystemAction(EVREventType.VREvent_TrackedDeviceRoleChanged, OnTrackedDeviceRoleChanged); }
// Token: 0x06000DE4 RID: 3556 RVA: 0x0005874C File Offset: 0x0005694C private SteamVR_RenderModel() { this.deviceConnectedAction = SteamVR_Events.DeviceConnectedAction(new UnityAction <int, bool>(this.OnDeviceConnected)); this.hideRenderModelsAction = SteamVR_Events.HideRenderModelsAction(new UnityAction <bool>(this.OnHideRenderModels)); this.modelSkinSettingsHaveChangedAction = SteamVR_Events.SystemAction(EVREventType.VREvent_ModelSkinSettingsHaveChanged, new UnityAction <VREvent_t>(this.OnModelSkinSettingsHaveChanged)); }
// Token: 0x06005EC9 RID: 24265 RVA: 0x00212BD8 File Offset: 0x00210FD8 private SteamVR_ControllerManager() { this.inputFocusAction = SteamVR_Events.InputFocusAction(new UnityAction <bool>(this.OnInputFocus)); this.deviceConnectedAction = SteamVR_Events.DeviceConnectedAction(new UnityAction <int, bool>(this.OnDeviceConnected)); this.trackedDeviceRoleChangedAction = SteamVR_Events.SystemAction(EVREventType.VREvent_TrackedDeviceRoleChanged, new UnityAction <VREvent_t>(this.OnTrackedDeviceRoleChanged)); }