Beispiel #1
0
        protected override void SelfGUI()
        {
            if (ValueEntry == null)
            {
                return;
            }

            using (new EditorGUILayout.HorizontalScope())
            {
                // Reserve area for foldout triangle.
                // Foldout is going to draw after value of this instance is drawn since its' visibility depends on
                // child count of this drawer, that is, depends on value drawn by this drawer and DrawSelf must be called
                // before drawing foldout triangle.
                FoldoutRect = DIGUI.GetFoldoutToggleRect();

                FieldGUI();

                if (ChildCount > 0 && !IsReferenceOfParent)
                {
                    ChildrenVisible = DIGUI.FoldoutToggle(FoldoutRect, ChildrenVisible);
                }
            }
            if (Event.current.type == EventType.Repaint)
            {
                FieldRect = GUILayoutUtility.GetLastRect();
            }

            ReferenceEmphasisGUI();
        }
Beispiel #2
0
 protected override void SelfGUI()
 {
     if (ChildCount > 0)
     {
         EditorGUILayout.BeginHorizontal();
         ChildrenVisible = DIGUI.FoldoutToggle(ChildrenVisible, false);
         EditorGUILayout.LabelField(Name);
         EditorGUILayout.EndHorizontal();
     }
 }