Пример #1
0
        internal void DrawExtendedPropertiesGUI()
        {
            float leaderSpace = -1;

            string extendedPropertiesLabel = TileLang.ParticularText("Section", "Extended Properties");

            if (DisplayExtendedProperties)
            {
                // Display expanded "Extended Properties" panel.
                Rect hsplitPos = EditorGUILayout.BeginVertical(GUILayout.Width(ExtendedPropertiesPanelWidth));

                GUILayout.Space(leaderSpace);

                DisplayExtendedProperties = GUILayout.Toggle(true, extendedPropertiesLabel, RotorzEditorStyles.Instance.ExtendedProperties_TitleShown);

                this.scrollingExtendedProperties = EditorGUILayout.BeginScrollView(this.scrollingExtendedProperties, RotorzEditorStyles.Instance.ExtendedProperties_ScrollView);
                {
                    float restoreLabelWidth = EditorGUIUtility.labelWidth;
                    EditorGUIUtility.labelWidth = 105;

                    GUILayout.BeginVertical(RotorzEditorStyles.Instance.ExtendedPropertiesLeader);
                    {
                        this.BeginChangeCheck();
                        this.BeginExtendedProperties();
                        ExtraEditorGUI.SeparatorLight();
                        this.OnExtendedPropertiesGUI();
                    }
                    GUILayout.EndVertical();

                    this.EndExtendedProperties();
                    this.EndChangeCheck();

                    EditorGUIUtility.labelWidth = restoreLabelWidth;
                    GUILayout.FlexibleSpace();
                }
                EditorGUILayout.EndScrollView();

                EditorGUILayout.EndVertical();

                hsplitPos.y      += 15;
                hsplitPos.height -= 15;

                hsplitPos.width = 6;
                GUI.Box(hsplitPos, GUIContent.none, RotorzEditorStyles.Instance.ExtendedProperties_HSplit);
            }
            else
            {
                // Display collapsed "Extended Properties" panel.
                GUILayout.BeginVertical(GUILayout.Width(RotorzEditorStyles.Instance.ExtendedProperties_TitleHidden.fixedWidth));
                GUILayout.Space(leaderSpace);
                DisplayExtendedProperties = GUILayout.Button(GUIContent.none, RotorzEditorStyles.Instance.ExtendedProperties_TitleHidden);

                Rect position = GUILayoutUtility.GetLastRect();
                position.x      += RotorzEditorStyles.Instance.ExtendedProperties_TitleHidden.padding.left;
                position.y      += RotorzEditorStyles.Instance.ExtendedProperties_TitleHidden.padding.top;
                position.width  -= RotorzEditorStyles.Instance.ExtendedProperties_TitleHidden.padding.horizontal;
                position.height -= RotorzEditorStyles.Instance.ExtendedProperties_TitleHidden.padding.vertical;
                RotorzEditorGUI.VerticalLabel(position, extendedPropertiesLabel, EditorStyles.whiteLabel);

                GUILayout.Space(4);
                GUILayout.EndVertical();
            }
        }