Ejemplo n.º 1
0
    private void GUINullOption()
    {
        InterfaceableGUIHelper.HorizontalBlock(() =>
        {
            InterfaceableGUIHelper.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) ? InterfaceableGUIHelper.SelectWindowStyles.NullSelected : InterfaceableGUIHelper.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);
        });
    }
Ejemplo n.º 2
0
 public static void ObjectNodeGUI(ObjectNode objectNode, InterfaceableContainerPropertyDrawer.SerializedContainer serializedContainer, GUIStyle style, int indentLevel)
 {
     InterfaceableGUIHelper.HorizontalBlock(() =>
     {
         var helper = new GUIObjectNodeHelper(objectNode, serializedContainer);
         helper.DrawGUI(style, indentLevel);
     });
 }
Ejemplo n.º 3
0
    private void GUISelectObjectType()
    {
        InterfaceableGUIHelper.HorizontalBlock(() =>
        {
            InterfaceableGUIHelper.EnabledBlock(() =>
            {
                GUI.enabled = _sceneAssetsExist;
                if (GUILayout.Button("Scene Assets", _selectingProjectAssets ? GUI.skin.button : InterfaceableGUIHelper.SelectWindowStyles.SelectedButton))
                {
                    _selectingProjectAssets = false;
                }
            });

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