Esempio n. 1
0
 public void DrawAddButton()
 {
     using (new EditorGUI.DisabledScope(m_serializedProperty.hasMultipleDifferentValues))
     {
         if (ScriptableObjectCollectionGUIUtility.DrawAddButtonBig())
         {
             ScriptableObjectCollectionUtility.CreateScriptableObjectMenu(MenuAdd, m_elementType).ShowAsContext();
         }
     }
 }
Esempio n. 2
0
 public ScriptableObjectCollectionElementDraw(Object[] targets = null)
 {
     if (targets != null)
     {
         TargetEditor = UnityEditor.Editor.CreateEditor(targets);
         Content      = ScriptableObjectCollectionGUIUtility.GetTitlebarContent(targets[0]);
     }
     else
     {
         Content = ScriptableObjectCollectionGUIUtility.GetTitlebarContent();
     }
 }
Esempio n. 3
0
        public void OnGUILayout(Action onSettingsOpen)
        {
            var targets = TargetEditor != null ? TargetEditor.targets : null;

            Foldout = ScriptableObjectCollectionGUIUtility.DrawTitlebar(Content, Foldout, onSettingsOpen, targets);

            if (Foldout)
            {
                if (TargetEditor != null)
                {
                    TargetEditor.OnInspectorGUI();
                }
                else
                {
                    EditorGUILayout.HelpBox("Missing reference, remove this element.", MessageType.Warning);
                }
            }
        }
Esempio n. 4
0
        public void DrawElements()
        {
            for (int i = 0; i < m_draws.Count; i++)
            {
                int index = i;

                m_draws[i].OnGUILayout(() => ShowMenu(index));
            }

            if (HasElementsWhichCannotBeMultiEdited())
            {
                ScriptableObjectCollectionGUIUtility.DrawLine();

                GUILayout.Space(4F);
                GUILayout.Label("ScriptableObjects that are only on some of the selected objects cannot be multi-edited.", EditorStyles.helpBox);
                GUILayout.Space(2F);
            }

            ScriptableObjectCollectionGUIUtility.DrawLine();
        }