Ejemplo n.º 1
0
    // Token: 0x060000EC RID: 236 RVA: 0x0000A5D4 File Offset: 0x000087D4
    private void OnEnable()
    {
        global::SteamVR_Render instance = global::SteamVR_Render.instance;
        bool flag = instance == null;

        if (flag)
        {
            base.enabled = false;
        }
        else
        {
            global::SteamVR_Utils.Event.Listen("new_poses", new global::SteamVR_Utils.Event.Handler(this.OnNewPoses));
        }
    }
Ejemplo n.º 2
0
    // Token: 0x060000F1 RID: 241 RVA: 0x0000A6AC File Offset: 0x000088AC
    private void OnPreCull()
    {
        global::Valve.VR.CVRCompositor compositor = global::Valve.VR.OpenVR.Compositor;
        bool flag = compositor != null;

        if (flag)
        {
            global::SteamVR_Render instance = global::SteamVR_Render.instance;
            compositor.GetLastPoses(instance.poses, instance.gamePoses);
            global::SteamVR_Utils.Event.Send("new_poses", new object[]
            {
                instance.poses
            });
            global::SteamVR_Utils.Event.Send("new_poses_applied", global::System.Array.Empty <object>());
        }
    }
Ejemplo n.º 3
0
    // Token: 0x06000090 RID: 144 RVA: 0x000068FC File Offset: 0x00004AFC
    private void OnGUI()
    {
        bool flag = this.overlay == null;

        if (!flag)
        {
            global::UnityEngine.RenderTexture renderTexture = this.overlay.texture as global::UnityEngine.RenderTexture;
            global::UnityEngine.RenderTexture active        = global::UnityEngine.RenderTexture.active;
            global::UnityEngine.RenderTexture.active = renderTexture;
            bool flag2 = global::UnityEngine.Event.current.type == 7;
            if (flag2)
            {
                global::UnityEngine.GL.Clear(false, true, global::UnityEngine.Color.clear);
            }
            global::UnityEngine.Rect rect;
            rect..ctor(0f, 0f, (float)renderTexture.width, (float)renderTexture.height);
            bool flag3 = global::UnityEngine.Screen.width < renderTexture.width;
            if (flag3)
            {
                rect.width = (float)global::UnityEngine.Screen.width;
                this.overlay.uvOffset.x = -(float)(renderTexture.width - global::UnityEngine.Screen.width) / (float)(2 * renderTexture.width);
            }
            bool flag4 = global::UnityEngine.Screen.height < renderTexture.height;
            if (flag4)
            {
                rect.height             = (float)global::UnityEngine.Screen.height;
                this.overlay.uvOffset.y = (float)(renderTexture.height - global::UnityEngine.Screen.height) / (float)(2 * renderTexture.height);
            }
            global::UnityEngine.GUILayout.BeginArea(rect);
            bool flag5 = this.background != null;
            if (flag5)
            {
                global::UnityEngine.GUI.DrawTexture(new global::UnityEngine.Rect((rect.width - (float)this.background.width) / 2f, (rect.height - (float)this.background.height) / 2f, (float)this.background.width, (float)this.background.height), this.background);
            }
            global::UnityEngine.GUILayout.BeginHorizontal(global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            global::UnityEngine.GUILayout.FlexibleSpace();
            global::UnityEngine.GUILayout.BeginVertical(global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            bool flag6 = this.logo != null;
            if (flag6)
            {
                global::UnityEngine.GUILayout.Space(rect.height / 2f - this.logoHeight);
                global::UnityEngine.GUILayout.Box(this.logo, global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            }
            global::UnityEngine.GUILayout.Space(this.menuOffset);
            bool flag7 = global::UnityEngine.GUILayout.Button("[Esc] - Close menu", global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            global::UnityEngine.GUILayout.BeginHorizontal(global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            global::UnityEngine.GUILayout.Label(string.Format("Scale: {0:N4}", this.scale), global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            float num   = global::UnityEngine.GUILayout.HorizontalSlider(this.scale, this.scaleLimits.x, this.scaleLimits.y, global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            bool  flag8 = num != this.scale;
            if (flag8)
            {
                this.SetScale(num);
            }
            global::UnityEngine.GUILayout.EndHorizontal();
            global::UnityEngine.GUILayout.BeginHorizontal(global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            global::UnityEngine.GUILayout.Label(string.Format("Scale limits:", global::System.Array.Empty <object>()), global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            string text  = global::UnityEngine.GUILayout.TextField(this.scaleLimitX, global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            bool   flag9 = text != this.scaleLimitX;
            if (flag9)
            {
                bool flag10 = float.TryParse(text, ref this.scaleLimits.x);
                if (flag10)
                {
                    this.scaleLimitX = text;
                }
            }
            string text2  = global::UnityEngine.GUILayout.TextField(this.scaleLimitY, global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            bool   flag11 = text2 != this.scaleLimitY;
            if (flag11)
            {
                bool flag12 = float.TryParse(text2, ref this.scaleLimits.y);
                if (flag12)
                {
                    this.scaleLimitY = text2;
                }
            }
            global::UnityEngine.GUILayout.EndHorizontal();
            global::UnityEngine.GUILayout.BeginHorizontal(global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            global::UnityEngine.GUILayout.Label(string.Format("Scale rate:", global::System.Array.Empty <object>()), global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            string text3  = global::UnityEngine.GUILayout.TextField(this.scaleRateText, global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            bool   flag13 = text3 != this.scaleRateText;
            if (flag13)
            {
                bool flag14 = float.TryParse(text3, ref this.scaleRate);
                if (flag14)
                {
                    this.scaleRateText = text3;
                }
            }
            global::UnityEngine.GUILayout.EndHorizontal();
            bool active2 = global::SteamVR.active;
            if (active2)
            {
                global::SteamVR instance = global::SteamVR.instance;
                global::UnityEngine.GUILayout.BeginHorizontal(global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
                float sceneResolutionScale = global::SteamVR_Camera.sceneResolutionScale;
                int   num2 = (int)(instance.sceneWidth * sceneResolutionScale);
                int   num3 = (int)(instance.sceneHeight * sceneResolutionScale);
                int   num4 = (int)(100f * sceneResolutionScale);
                global::UnityEngine.GUILayout.Label(string.Format("Scene quality: {0}x{1} ({2}%)", num2, num3, num4), global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
                int  num5   = global::UnityEngine.Mathf.RoundToInt(global::UnityEngine.GUILayout.HorizontalSlider((float)num4, 50f, 200f, global::System.Array.Empty <global::UnityEngine.GUILayoutOption>()));
                bool flag15 = num5 != num4;
                if (flag15)
                {
                    global::SteamVR_Camera.sceneResolutionScale = (float)num5 / 100f;
                }
                global::UnityEngine.GUILayout.EndHorizontal();
            }
            this.overlay.highquality = global::UnityEngine.GUILayout.Toggle(this.overlay.highquality, "High quality", global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            bool highquality = this.overlay.highquality;
            if (highquality)
            {
                this.overlay.curved    = global::UnityEngine.GUILayout.Toggle(this.overlay.curved, "Curved overlay", global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
                this.overlay.antialias = global::UnityEngine.GUILayout.Toggle(this.overlay.antialias, "Overlay RGSS(2x2)", global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            }
            else
            {
                this.overlay.curved    = false;
                this.overlay.antialias = false;
            }
            global::SteamVR_Camera steamVR_Camera = global::SteamVR_Render.Top();
            bool flag16 = steamVR_Camera != null;
            if (flag16)
            {
                steamVR_Camera.wireframe = global::UnityEngine.GUILayout.Toggle(steamVR_Camera.wireframe, "Wireframe", global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
                global::SteamVR_Render instance2 = global::SteamVR_Render.instance;
                bool flag17 = instance2.trackingSpace == global::Valve.VR.ETrackingUniverseOrigin.TrackingUniverseSeated;
                if (flag17)
                {
                    bool flag18 = global::UnityEngine.GUILayout.Button("Switch to Standing", global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
                    if (flag18)
                    {
                        instance2.trackingSpace = global::Valve.VR.ETrackingUniverseOrigin.TrackingUniverseStanding;
                    }
                    bool flag19 = global::UnityEngine.GUILayout.Button("Center View", global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
                    if (flag19)
                    {
                        global::Valve.VR.CVRSystem system = global::Valve.VR.OpenVR.System;
                        bool flag20 = system != null;
                        if (flag20)
                        {
                            system.ResetSeatedZeroPose();
                        }
                    }
                }
                else
                {
                    bool flag21 = global::UnityEngine.GUILayout.Button("Switch to Seated", global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
                    if (flag21)
                    {
                        instance2.trackingSpace = global::Valve.VR.ETrackingUniverseOrigin.TrackingUniverseSeated;
                    }
                }
            }
            bool flag22 = global::UnityEngine.GUILayout.Button("Exit", global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            if (flag22)
            {
                global::UnityEngine.Application.Quit();
            }
            global::UnityEngine.GUILayout.Space(this.menuOffset);
            string environmentVariable = global::System.Environment.GetEnvironmentVariable("VR_OVERRIDE");
            bool   flag23 = environmentVariable != null;
            if (flag23)
            {
                global::UnityEngine.GUILayout.Label("VR_OVERRIDE=" + environmentVariable, global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            }
            global::UnityEngine.GUILayout.Label("Graphics device: " + global::UnityEngine.SystemInfo.graphicsDeviceVersion, global::System.Array.Empty <global::UnityEngine.GUILayoutOption>());
            global::UnityEngine.GUILayout.EndVertical();
            global::UnityEngine.GUILayout.FlexibleSpace();
            global::UnityEngine.GUILayout.EndHorizontal();
            global::UnityEngine.GUILayout.EndArea();
            bool flag24 = this.cursor != null;
            if (flag24)
            {
                float x    = global::UnityEngine.Input.mousePosition.x;
                float num6 = (float)global::UnityEngine.Screen.height - global::UnityEngine.Input.mousePosition.y;
                float num7 = (float)this.cursor.width;
                float num8 = (float)this.cursor.height;
                global::UnityEngine.GUI.DrawTexture(new global::UnityEngine.Rect(x, num6, num7, num8), this.cursor);
            }
            global::UnityEngine.RenderTexture.active = active;
            bool flag25 = flag7;
            if (flag25)
            {
                this.HideMenu();
            }
        }
    }