Example #1
0
        protected virtual void DrawHeader(Rect rect)
        {
            var r = new Rect(rect.x, rect.y, 200, EditorGUIUtility.singleLineHeight);

            GUI.color = _group.Active
                            ? Color.green
                            : Color.yellow;
            if (GUI.Button(r, _group.Id)) // apply changes
            {
                _group.Active = !_group.Active;
            }

            r.x      += r.width;
            GUI.color = Color.white;

            r.width = 100;
            if (GUI.Button(r, "Apply"))                                         // apply changes
            {
                if (!string.IsNullOrEmpty(_group.Id) && _edited.list.Count > 0) //???
                {
                    DefineSymbolManager.Apply(_group);
                    DefineSymbolManager.Save(_group);
                }
            }

            r.x += r.width;
            if (GUI.Button(r, "Revert")) // apply changes
            {
                Debug.Log("create custom grop name");
            }
        }
        protected override void DrawHeader(Rect rect)
        {
            var r = new Rect(rect.x, rect.y, 200, EditorGUIUtility.singleLineHeight);

            EditorGUI.LabelField(r, "Create custom group: Input name:");
            r.x += r.width;
            _id  = EditorGUI.TextField(r, _id);

            r.x    += r.width;
            r.width = 100;
            if (GUI.Button(r, "Save")) // apply changes
            {
                if (!string.IsNullOrEmpty(_id) && _defines.Count > 0)
                {
                    Debug.Log("create custom grop name");
                    var group = WithCustomName.Create(_id, _defines);
                    DefineSymbolManager.Apply(group);
                    DefineSymbolManager.Save(group);
                }
            }

            r.x += r.width;
            if (GUI.Button(r, "Clear")) // apply changes
            {
                Debug.Log("clear");
                _defines.Clear();
            }
        }