Exemple #1
0
        private bool PaintTitle(string title, bool backButton)
        {
            bool goBack = false;

            EditorGUILayout.BeginHorizontal(this.headerBoxStyle);

            if (backButton && this.keyPressedBack)
            {
                UnityEngine.Event.current.Use();
            }

            if (backButton && (GUILayout.Button(title, this.headerTitleStyle) || this.keyPressedBack))
            {
                this.listIndex = 0;
                goBack         = true;
            }
            else if (!backButton)
            {
                EditorGUILayout.LabelField(title, this.headerTitleStyle);
            }

            if (UnityEngine.Event.current.type == EventType.Repaint && backButton)
            {
                Rect buttonRect = GUILayoutUtility.GetLastRect();
                CoreGUIStyles.GetButtonLeftArrow().Draw(
                    new Rect(
                        buttonRect.x,
                        buttonRect.y + buttonRect.height / 2.0f - ARROW_SIZE / 2.0f,
                        ARROW_SIZE, ARROW_SIZE
                        ),
                    false, false, false, false
                    );
            }

            EditorGUILayout.EndHorizontal();
            return(goBack);
        }