示例#1
0
 // Token: 0x0600006D RID: 109 RVA: 0x00004FB7 File Offset: 0x000031B7
 public static void Start(global::UnityEngine.Color newColor, float duration, bool fadeOverlay = false)
 {
     global::SteamVR_Utils.Event.Send("fade", new object[]
     {
         newColor,
         duration,
         fadeOverlay
     });
 }
示例#2
0
    // Token: 0x0600006E RID: 110 RVA: 0x00004FE8 File Offset: 0x000031E8
    public static void View(global::UnityEngine.Color newColor, float duration)
    {
        global::Valve.VR.CVRCompositor compositor = global::Valve.VR.OpenVR.Compositor;
        bool flag = compositor != null;

        if (flag)
        {
            compositor.FadeToColor(duration, newColor.r, newColor.g, newColor.b, newColor.a, false);
        }
    }
示例#3
0
            // Token: 0x06000B55 RID: 2901 RVA: 0x000230A4 File Offset: 0x000212A4
            public static global::VRGIN.Helpers.UnityHelper.RayDrawer Create(global::UnityEngine.Color color, global::UnityEngine.Ray ray)
            {
                string text = "Ray Drawer (";

                global::UnityEngine.Color color2 = color;
                global::VRGIN.Helpers.UnityHelper.RayDrawer rayDrawer = new global::UnityEngine.GameObject(text + color2.ToString() + ")").AddComponent <global::VRGIN.Helpers.UnityHelper.RayDrawer>();
                rayDrawer.gameObject.AddComponent <global::UnityEngine.LineRenderer>();
                rayDrawer._Ray   = ray;
                rayDrawer._Color = color;
                return(rayDrawer);
            }
示例#4
0
        // Token: 0x060005CD RID: 1485 RVA: 0x0001C2FC File Offset: 0x0001A4FC
        public static void DrawRay(global::UnityEngine.Color color, global::UnityEngine.Ray ray)
        {
            global::VRGIN.Helpers.UnityHelper.RayDrawer rayDrawer;
            bool flag = !global::VRGIN.Helpers.UnityHelper._Rays.TryGetValue(color, ref rayDrawer) || !rayDrawer;

            if (flag)
            {
                rayDrawer = global::VRGIN.Helpers.UnityHelper.RayDrawer.Create(color, ray);
                global::VRGIN.Helpers.UnityHelper._Rays[color] = rayDrawer;
            }
            rayDrawer.Touch(ray);
        }
示例#5
0
    // Token: 0x0600006F RID: 111 RVA: 0x00005028 File Offset: 0x00003228
    public void OnStartFade(params object[] args)
    {
        global::UnityEngine.Color color = (global::UnityEngine.Color)args[0];
        float num = (float)args[1];

        this.fadeOverlay = (args.Length > 2 && (bool)args[2]);
        bool flag = num > 0f;

        if (flag)
        {
            this.targetColor = color;
            this.deltaColor  = (this.targetColor - this.currentColor) / num;
        }
        else
        {
            this.currentColor = color;
        }
    }
示例#6
0
    // Token: 0x06000067 RID: 103 RVA: 0x00004AC0 File Offset: 0x00002CC0
    public void RenderNear()
    {
        int  num  = global::UnityEngine.Screen.width / 2;
        int  num2 = global::UnityEngine.Screen.height / 2;
        bool flag = this.cam.targetTexture == null || this.cam.targetTexture.width != num || this.cam.targetTexture.height != num2;

        if (flag)
        {
            this.cam.targetTexture = new global::UnityEngine.RenderTexture(num, num2, 24, 0);
            this.cam.targetTexture.antiAliasing = ((global::UnityEngine.QualitySettings.antiAliasing == 0) ? 1 : global::UnityEngine.QualitySettings.antiAliasing);
        }
        this.cam.nearClipPlane = this.config.near;
        this.cam.farClipPlane  = this.config.far;
        global::UnityEngine.CameraClearFlags clearFlags      = this.cam.clearFlags;
        global::UnityEngine.Color            backgroundColor = this.cam.backgroundColor;
        this.cam.clearFlags      = 2;
        this.cam.backgroundColor = global::UnityEngine.Color.clear;
        float num3 = global::UnityEngine.Mathf.Clamp(this.GetTargetDistance() + this.config.nearOffset, this.config.near, this.config.far);

        global::UnityEngine.Transform parent = this.clipQuad.transform.parent;
        this.clipQuad.transform.position = parent.position + parent.forward * num3;
        global::UnityEngine.MonoBehaviour[] array = null;
        bool[] array2 = null;
        bool   disableStandardAssets = this.config.disableStandardAssets;

        if (disableStandardAssets)
        {
            array  = this.cam.gameObject.GetComponents <global::UnityEngine.MonoBehaviour>();
            array2 = new bool[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                global::UnityEngine.MonoBehaviour monoBehaviour = array[i];
                bool flag2 = monoBehaviour.enabled && monoBehaviour.GetType().ToString().StartsWith("UnityStandardAssets.");
                if (flag2)
                {
                    monoBehaviour.enabled = false;
                    array2[i]             = true;
                }
            }
        }
        this.clipQuad.SetActive(true);
        this.cam.Render();
        this.clipQuad.SetActive(false);
        bool flag3 = array != null;

        if (flag3)
        {
            for (int j = 0; j < array.Length; j++)
            {
                bool flag4 = array2[j];
                if (flag4)
                {
                    array[j].enabled = true;
                }
            }
        }
        this.cam.clearFlags      = clearFlags;
        this.cam.backgroundColor = backgroundColor;
        global::UnityEngine.Graphics.DrawTexture(new global::UnityEngine.Rect(0f, 0f, (float)num, (float)num2), this.cam.targetTexture, this.colorMat);
        global::UnityEngine.Graphics.DrawTexture(new global::UnityEngine.Rect((float)num, 0f, (float)num, (float)num2), this.cam.targetTexture, this.alphaMat);
    }
示例#7
0
    // Token: 0x060000A2 RID: 162 RVA: 0x00007B2C File Offset: 0x00005D2C
    public void BuildMesh()
    {
        global::Valve.VR.HmdQuad_t hmdQuad_t = default(global::Valve.VR.HmdQuad_t);
        bool flag = !global::SteamVR_PlayArea.GetBounds(this.size, ref hmdQuad_t);

        if (!flag)
        {
            global::Valve.VR.HmdVector3_t[] array = new global::Valve.VR.HmdVector3_t[]
            {
                hmdQuad_t.vCorners0,
                hmdQuad_t.vCorners1,
                hmdQuad_t.vCorners2,
                hmdQuad_t.vCorners3
            };
            this.vertices = new global::UnityEngine.Vector3[array.Length * 2];
            for (int i = 0; i < array.Length; i++)
            {
                global::Valve.VR.HmdVector3_t hmdVector3_t = array[i];
                this.vertices[i] = new global::UnityEngine.Vector3(hmdVector3_t.v0, 0.01f, hmdVector3_t.v2);
            }
            bool flag2 = this.borderThickness == 0f;
            if (flag2)
            {
                base.GetComponent <global::UnityEngine.MeshFilter>().mesh = null;
            }
            else
            {
                for (int j = 0; j < array.Length; j++)
                {
                    int num  = (j + 1) % array.Length;
                    int num2 = (j + array.Length - 1) % array.Length;
                    global::UnityEngine.Vector3 normalized  = (this.vertices[num] - this.vertices[j]).normalized;
                    global::UnityEngine.Vector3 normalized2 = (this.vertices[num2] - this.vertices[j]).normalized;
                    global::UnityEngine.Vector3 vector      = this.vertices[j];
                    vector += global::UnityEngine.Vector3.Cross(normalized, global::UnityEngine.Vector3.up) * this.borderThickness;
                    vector += global::UnityEngine.Vector3.Cross(normalized2, global::UnityEngine.Vector3.down) * this.borderThickness;
                    this.vertices[array.Length + j] = vector;
                }
                int[] triangles = new int[]
                {
                    0,
                    1,
                    4,
                    1,
                    5,
                    4,
                    1,
                    2,
                    5,
                    2,
                    6,
                    5,
                    2,
                    3,
                    6,
                    3,
                    7,
                    6,
                    3,
                    0,
                    7,
                    0,
                    4,
                    7
                };
                global::UnityEngine.Vector2[] uv = new global::UnityEngine.Vector2[]
                {
                    new global::UnityEngine.Vector2(0f, 0f),
                    new global::UnityEngine.Vector2(1f, 0f),
                    new global::UnityEngine.Vector2(0f, 0f),
                    new global::UnityEngine.Vector2(1f, 0f),
                    new global::UnityEngine.Vector2(0f, 1f),
                    new global::UnityEngine.Vector2(1f, 1f),
                    new global::UnityEngine.Vector2(0f, 1f),
                    new global::UnityEngine.Vector2(1f, 1f)
                };
                global::UnityEngine.Color[] colors = new global::UnityEngine.Color[]
                {
                    this.color,
                    this.color,
                    this.color,
                    this.color,
                    new global::UnityEngine.Color(this.color.r, this.color.g, this.color.b, 0f),
                    new global::UnityEngine.Color(this.color.r, this.color.g, this.color.b, 0f),
                    new global::UnityEngine.Color(this.color.r, this.color.g, this.color.b, 0f),
                    new global::UnityEngine.Color(this.color.r, this.color.g, this.color.b, 0f)
                };
                global::UnityEngine.Mesh mesh = new global::UnityEngine.Mesh();
                base.GetComponent <global::UnityEngine.MeshFilter>().mesh = mesh;
                mesh.vertices  = this.vertices;
                mesh.uv        = uv;
                mesh.colors    = colors;
                mesh.triangles = triangles;
                global::UnityEngine.MeshRenderer component = base.GetComponent <global::UnityEngine.MeshRenderer>();
                component.material             = global::UnityEngine.Resources.GetBuiltinResource <global::UnityEngine.Material>("Sprites-Default.mat");
                component.reflectionProbeUsage = 0;
                component.shadowCastingMode    = 0;
                component.receiveShadows       = false;
                component.useLightProbes       = false;
            }
        }
    }
示例#8
0
 // Token: 0x060005CC RID: 1484 RVA: 0x0001C2E5 File Offset: 0x0001A4E5
 public static void DrawRay(global::UnityEngine.Color color, global::UnityEngine.Vector3 origin, global::UnityEngine.Vector3 direction)
 {
     global::VRGIN.Helpers.UnityHelper.DrawRay(color, new global::UnityEngine.Ray(origin, direction.normalized));
 }