Beispiel #1
0
        private void DrawInfos()
        {
            if (this.serializationInfoTree == null)
            {
                return;
            }

            if (this.noteStyle == null)
            {
                this.noteStyle = new GUIStyle(SirenixGUIStyles.MultiLineLabel);
                this.noteStyle.active.textColor    = this.noteStyle.normal.textColor;
                this.noteStyle.onActive.textColor  = this.noteStyle.normal.textColor;
                this.noteStyle.onFocused.textColor = this.noteStyle.normal.textColor;
                this.noteStyle.focused.textColor   = this.noteStyle.normal.textColor;
                this.noteStyle.margin  = new RectOffset(20, 4, 0, 4);
                this.noteStyle.padding = new RectOffset(0, 0, 0, 0);
            }

            if (this.serializationInfoTree.Selection.Count > 0)
            {
                var info = this.serializationInfoTree.Selection[0].Value as MemberSerializationInfo;

                GUILayout.Space(10);
                GUILayout.BeginHorizontal();
                {
                    var bgRect = GUIHelper.GetCurrentLayoutRect().Expand(0, 10);
                    SirenixEditorGUI.DrawSolidRect(bgRect, SirenixGUIStyles.DarkEditorBackground);
                    SirenixEditorGUI.DrawBorders(bgRect, 0, 0, 1, 0);

                    // Note text.
                    GUILayout.BeginVertical(GUILayoutOptions.MinHeight(80));
                    {
                        foreach (var note in info.Notes)
                        {
                            Rect noteRect = GUILayoutUtility.GetRect(GUIHelper.TempContent(note), this.noteStyle);
                            var  dot      = noteRect;
                            dot.x     -= 8;
                            dot.y     += 5;
                            dot.height = 4;
                            dot.width  = 4;
                            SirenixEditorGUI.DrawSolidRect(dot, EditorGUIUtility.isProSkin ? Color.white : Color.black);
                            EditorGUI.SelectableLabel(noteRect, note, this.noteStyle);
                            GUILayout.Space(4);
                        }
                    }
                    GUILayout.EndVertical();

                    var r = GUIHelper.GetCurrentLayoutRect();
                    SirenixEditorGUI.DrawVerticalLineSeperator(r.x, r.y, r.height);
                }
                GUILayout.EndHorizontal();
                GUILayout.Space(10);
            }
        }
Beispiel #2
0
        private void DrawGettingStartedHelp()
        {
            if (this.targetType == null)
            {
                GUIContent content = GUIHelper.TempContent("Select your script here to begin debugging the serialization.", EditorIcons.UnityInfoIcon);
                var        size    = new Vector2(Mathf.Max(this.position.width - 100, 200), 0);
                size.y = SirenixGUIStyles.MessageBox.CalcHeight(content, size.x);

                GUI.Label(new Rect(50, 40, size.x, size.y), content, SirenixGUIStyles.MessageBox);
                EditorIcons.ArrowUp.Draw(new Rect(95f, 25f, 20f, 20f), EditorIcons.ArrowUp.Raw);
            }
        }