Exemple #1
0
    private void AddInternal(SteamVR_Camera vrcam)
    {
        if (vrcam == null)
        {
            return;
        }
        Camera component = vrcam.GetComponent <Camera>();

        if (component == null)
        {
            return;
        }
        int num = this.cameras.Length;

        SteamVR_Camera[] array = new SteamVR_Camera[num + 1];
        int  num2 = 0;
        bool flag = false;

        for (int i = 0; i < num; i++)
        {
            SteamVR_Camera steamVR_Camera = this.cameras[i];
            if (!(steamVR_Camera == null))
            {
                if (!array.Contains(steamVR_Camera))
                {
                    Camera component2 = steamVR_Camera.GetComponent <Camera>();
                    if (!(component2 == null))
                    {
                        if (i == num2 && component2.depth > component.depth)
                        {
                            array[num2++] = vrcam;
                            flag          = true;
                        }
                        array[num2++] = steamVR_Camera;
                    }
                }
            }
        }
        if (!flag)
        {
            array[num2] = vrcam;
        }
        this.cameras = array;
    }