示例#1
0
 private void SettingsGUI()
 {
     if (DIGUI.SettingsButton())
     {
         SettingsWindow.Open();
     }
 }
示例#2
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();
        }
示例#3
0
 protected override void SelfGUI()
 {
     if (ChildCount > 0)
     {
         EditorGUILayout.BeginHorizontal();
         ChildrenVisible = DIGUI.FoldoutToggle(ChildrenVisible, false);
         EditorGUILayout.LabelField(Name);
         EditorGUILayout.EndHorizontal();
     }
 }
示例#4
0
        protected virtual void ValueErrorGUI()
        {
            if (!ValueAccessResult.IsNullOrFailed(drawingValueGetResult) ||
                !ValueAccessResult.IsNullOrFailed(drawnValueSetResult))
            {
                return;
            }

            if (DIGUI.ErrorButton(GetErrorButtonTooltip()))
            {
                var window = ValueAccessResultWindow.Open();
                window.GetResult = drawingValueGetResult ?? default(ValueAccessResult);
                window.SetResult = drawnValueSetResult ?? default(ValueAccessResult);
            }
        }
示例#5
0
        protected virtual void ReferencedParentGUI()
        {
            if (ValueEntry.TypeOfValue.IsValueType)
            {
                return;
            }
            if (!IsReferenceOfParent)
            {
                return;
            }

            if (DIGUI.GoUpButton(FoldoutRect))
            {
                ReferenceEmphasis();
            }
        }
示例#6
0
        protected virtual void PageSelectGUI()
        {
            using (new EditorGUILayout.HorizontalScope())
            {
                EditorGUIEx.MinWidthLabelField(GetItemCountText());

                if (DIGUI.PageFlipButton(DIGUIContents.PrevButton))
                {
                    CurrentPageIndex--;
                }

                int pageCount = PageCount;
                int pageNo    = pageCount == 0 ? 0 : CurrentPageIndex + 1;
                pageNo           = EditorGUIEx.MinWidthDelayedIntField(pageNo);
                CurrentPageIndex = pageCount == 0 ? 0 : pageNo - 1;
                EditorGUIEx.MinWidthLabelField("/" + PageCount);

                if (DIGUI.PageFlipButton(DIGUIContents.NextButton) && ItemCountInCurrentPage == ItemCountPerPage)
                {
                    CurrentPageIndex++;
                }
            }
        }