Beispiel #1
0
    private void GUINullOption()
    {
        IUnifiedGUIHelper.HorizontalBlock(() =>
        {
            IUnifiedGUIHelper.EnabledBlock(() =>
            {
                GUI.enabled = _allObjects.Any();

                if (GUILayout.Button(new GUIContent("▼", "Expand All"), GUILayout.ExpandWidth(false)))
                {
                    FoldoutAll(_allObjects, true);
                }

                if (GUILayout.Button(new GUIContent("▲", "Collapse All"), GUILayout.ExpandWidth(false)))
                {
                    FoldoutAll(_allObjects, false);
                }
            });

            var style = _serializedContainer.ObjectField == null && string.IsNullOrEmpty(_serializedContainer.ResultType) ? IUnifiedGUIHelper.SelectWindowStyles.NullSelected : IUnifiedGUIHelper.SelectWindowStyles.NullOption;
            if (GUILayout.Button("NULL", style, GUILayout.ExpandWidth(true)))
            {
                _serializedContainer.ObjectField = null;
                _serializedContainer.ApplyModifiedProperties();
            }
            EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), MouseCursor.Link);

            GUILayout.Space(5.0f);
        });
    }
Beispiel #2
0
 public static void ObjectNodeGUI(ObjectNode objectNode, IUnifiedContainerPropertyDrawer.SerializedContainer serializedContainer, GUIStyle style, int indentLevel)
 {
     IUnifiedGUIHelper.HorizontalBlock(() =>
     {
         var helper = new GUIObjectNodeHelper(objectNode, serializedContainer);
         helper.DrawGUI(style, indentLevel);
     });
 }
Beispiel #3
0
    private void GUISelectObjectType()
    {
        IUnifiedGUIHelper.HorizontalBlock(() =>
        {
            IUnifiedGUIHelper.EnabledBlock(() =>
            {
                GUI.enabled = _sceneAssetsExist;
                if (GUILayout.Button("Scene Assets", _selectingProjectAssets ? GUI.skin.button : IUnifiedGUIHelper.SelectWindowStyles.SelectedButton))
                {
                    _selectingProjectAssets = false;
                }
            });

            IUnifiedGUIHelper.EnabledBlock(() =>
            {
                GUI.enabled = _projectAssetsExist;
                if (GUILayout.Button("Project Assets", _selectingProjectAssets ? IUnifiedGUIHelper.SelectWindowStyles.SelectedButton : GUI.skin.button))
                {
                    _selectingProjectAssets = true;
                }
            });
        });
    }