UnityEditor.FrameDebuggerWindow.DrawRenderTargetControls C# (CSharp) Method

DrawRenderTargetControls() private method

private DrawRenderTargetControls ( FrameDebuggerEvent cur ) : void
cur UnityEditorInternal.FrameDebuggerEvent
return void
        private void DrawRenderTargetControls(FrameDebuggerEvent cur)
        {
            if ((cur.rtWidth > 0) && (cur.rtHeight > 0))
            {
                bool disabled = (cur.rtFormat == 1) || (cur.rtFormat == 3);
                bool flag2 = cur.rtHasDepthTexture != 0;
                short rtCount = cur.rtCount;
                if (flag2)
                {
                    rtCount = (short) (rtCount + 1);
                }
                GUILayout.Label("RenderTarget: " + cur.rtName, EditorStyles.boldLabel, new GUILayoutOption[0]);
                GUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]);
                EditorGUI.BeginChangeCheck();
                EditorGUI.BeginDisabledGroup(rtCount <= 1);
                GUIContent[] displayedOptions = new GUIContent[rtCount];
                for (int i = 0; i < cur.rtCount; i++)
                {
                    displayedOptions[i] = Styles.mrtLabels[i];
                }
                if (flag2)
                {
                    displayedOptions[cur.rtCount] = Styles.depthLabel;
                }
                int num3 = Mathf.Clamp(this.m_RTIndex, 0, rtCount - 1);
                bool flag3 = num3 != this.m_RTIndex;
                this.m_RTIndex = num3;
                GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width(70f) };
                this.m_RTIndex = EditorGUILayout.Popup(this.m_RTIndex, displayedOptions, EditorStyles.toolbarPopup, options);
                EditorGUI.EndDisabledGroup();
                GUILayout.Space(10f);
                EditorGUI.BeginDisabledGroup(disabled);
                GUILayout.Label(Styles.channelHeader, EditorStyles.miniLabel, new GUILayoutOption[0]);
                this.m_RTChannel = GUILayout.Toolbar(this.m_RTChannel, Styles.channelLabels, EditorStyles.toolbarButton, new GUILayoutOption[0]);
                EditorGUI.EndDisabledGroup();
                GUILayout.Space(10f);
                GUILayout.Label(Styles.levelsHeader, EditorStyles.miniLabel, new GUILayoutOption[0]);
                GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.MaxWidth(200f) };
                EditorGUILayout.MinMaxSlider(ref this.m_RTBlackLevel, ref this.m_RTWhiteLevel, 0f, 1f, optionArray2);
                if (EditorGUI.EndChangeCheck() || flag3)
                {
                    Vector4 zero = Vector4.zero;
                    if (this.m_RTChannel == 1)
                    {
                        zero.x = 1f;
                    }
                    else if (this.m_RTChannel == 2)
                    {
                        zero.y = 1f;
                    }
                    else if (this.m_RTChannel == 3)
                    {
                        zero.z = 1f;
                    }
                    else if (this.m_RTChannel == 4)
                    {
                        zero.w = 1f;
                    }
                    else
                    {
                        zero = Vector4.one;
                    }
                    int rTIndex = this.m_RTIndex;
                    if (rTIndex >= cur.rtCount)
                    {
                        rTIndex = -1;
                    }
                    FrameDebuggerUtility.SetRenderTargetDisplayOptions(rTIndex, zero, this.m_RTBlackLevel, this.m_RTWhiteLevel);
                    this.RepaintAllNeededThings();
                }
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
                GUILayout.Label(string.Format("{0}x{1} {2}", cur.rtWidth, cur.rtHeight, (RenderTextureFormat) cur.rtFormat), new GUILayoutOption[0]);
                if (cur.rtDim == 4)
                {
                    GUILayout.Label("Rendering into cubemap", new GUILayoutOption[0]);
                }
                if ((cur.rtFormat == 3) && SystemInfo.graphicsDeviceVersion.StartsWith("Direct3D 9"))
                {
                    EditorGUILayout.HelpBox("Rendering into shadowmap on DX9, can't visualize it in the game view properly", MessageType.Info, true);
                }
            }
        }