示例#1
0
 // Token: 0x06000176 RID: 374 RVA: 0x0000C1CC File Offset: 0x0000A3CC
 public bool GetFrameTiming(ref global::Valve.VR.Compositor_FrameTiming pTiming, uint unFramesAgo)
 {
     return(this.FnTable.GetFrameTiming(ref pTiming, unFramesAgo));
 }
示例#2
0
    // Token: 0x060000BF RID: 191 RVA: 0x00008760 File Offset: 0x00006960
    private void Update()
    {
        bool flag = this.cameras.Length == 0;

        if (flag)
        {
            base.enabled = false;
        }
        else
        {
            global::SteamVR_Utils.QueueEventOnRenderThread(201510024);
            global::SteamVR_Controller.Update();
            global::Valve.VR.CVRSystem system = global::Valve.VR.OpenVR.System;
            bool flag2 = system != null;
            if (flag2)
            {
                global::Valve.VR.VREvent_t vrevent_t = default(global::Valve.VR.VREvent_t);
                uint uncbVREvent = (uint)global::System.Runtime.InteropServices.Marshal.SizeOf(typeof(global::Valve.VR.VREvent_t));
                int  i           = 0;
                while (i < 64)
                {
                    bool flag3 = !system.PollNextEvent(ref vrevent_t, uncbVREvent);
                    if (flag3)
                    {
                        break;
                    }
                    global::Valve.VR.EVREventType eventType    = (global::Valve.VR.EVREventType)vrevent_t.eventType;
                    global::Valve.VR.EVREventType evreventType = eventType;
                    if (evreventType <= global::Valve.VR.EVREventType.VREvent_InputFocusReleased)
                    {
                        if (evreventType != global::Valve.VR.EVREventType.VREvent_InputFocusCaptured)
                        {
                            if (evreventType != global::Valve.VR.EVREventType.VREvent_InputFocusReleased)
                            {
                                goto IL_16D;
                            }
                            bool flag4 = vrevent_t.data.process.pid == 0U;
                            if (flag4)
                            {
                                global::SteamVR_Utils.Event.Send("input_focus", new object[]
                                {
                                    true
                                });
                            }
                        }
                        else
                        {
                            bool flag5 = vrevent_t.data.process.oldPid == 0U;
                            if (flag5)
                            {
                                global::SteamVR_Utils.Event.Send("input_focus", new object[]
                                {
                                    false
                                });
                            }
                        }
                    }
                    else if (evreventType != global::Valve.VR.EVREventType.VREvent_HideRenderModels)
                    {
                        if (evreventType != global::Valve.VR.EVREventType.VREvent_ShowRenderModels)
                        {
                            goto IL_16D;
                        }
                        global::SteamVR_Utils.Event.Send("hide_render_models", new object[]
                        {
                            false
                        });
                    }
                    else
                    {
                        global::SteamVR_Utils.Event.Send("hide_render_models", new object[]
                        {
                            true
                        });
                    }
IL_1B3:
                    i++;
                    continue;
IL_16D:
                    string name = global::System.Enum.GetName(typeof(global::Valve.VR.EVREventType), vrevent_t.eventType);
                    bool flag6 = name != null;
                    if (flag6)
                    {
                        global::SteamVR_Utils.Event.Send(name.Substring(8), new object[]
                        {
                            vrevent_t
                        });
                    }
                    goto IL_1B3;
                }
            }
            global::UnityEngine.Application.targetFrameRate     = -1;
            global::UnityEngine.Application.runInBackground     = true;
            global::UnityEngine.QualitySettings.maxQueuedFrames = -1;
            global::UnityEngine.QualitySettings.vSyncCount      = 0;
            bool flag7 = this.lockPhysicsUpdateRateToRenderFrequency && global::UnityEngine.Time.timeScale > 0f;
            if (flag7)
            {
                global::SteamVR instance = global::SteamVR.instance;
                bool            flag8    = instance != null;
                if (flag8)
                {
                    global::Valve.VR.Compositor_FrameTiming compositor_FrameTiming = default(global::Valve.VR.Compositor_FrameTiming);
                    compositor_FrameTiming.m_nSize = (uint)global::System.Runtime.InteropServices.Marshal.SizeOf(typeof(global::Valve.VR.Compositor_FrameTiming));
                    instance.compositor.GetFrameTiming(ref compositor_FrameTiming, 0U);
                    global::UnityEngine.Time.fixedDeltaTime   = global::UnityEngine.Time.timeScale / instance.hmd_DisplayFrequency;
                    global::UnityEngine.Time.maximumDeltaTime = global::UnityEngine.Time.fixedDeltaTime * compositor_FrameTiming.m_nNumFramePresents;
                }
            }
        }
    }