public override VisualElement CreateInspectorGUI()
        {
            _note = target as StickyNote;
            var database       = StickyNoteManagementUtils.LoadOrCreateDatabase();
            var root           = new VisualElement();
            var noteStyleSheet = Resources.Load <StyleSheet>("StickyNotesStyle");

            root.styleSheets.Add(noteStyleSheet);
            root.name = "row";

            var headerLabel = new TextField()
            {
                name = "headerTextField"
            };

            headerLabel.SetValueWithoutNotify(_note.noteHeader);
            headerLabel.RegisterValueChangedCallback(evt =>
            {
                _note.noteHeader = evt.newValue;
                EditorUtility.SetDirty(_note);
            });
            var headerVisualElement = new VisualElement()
            {
                name = "header"
            };

            headerVisualElement.Add(headerLabel);
            root.Add(headerVisualElement);

            var noteLabel = new TextField()
            {
                name = "contentTextField"
            };

            noteLabel.SetValueWithoutNotify(_note.noteContext);
            noteLabel.RegisterValueChangedCallback(evt =>
            {
                _note.noteContext = evt.newValue;
                EditorUtility.SetDirty(_note);
            });
            root.Add(noteLabel);

//            foreach (var stickyNote in database.GameObjectHashMap)
//            {
//                var row = new VisualElement();
//                row.style.flexDirection = FlexDirection.Row;
//                var labelKey = new Label(stickyNote.Key);
//                var labelValue = new Label(stickyNote.Value.attachment.ToString());
//                row.Add(labelKey);
//                row.Add(labelValue);
//                root.Add(row);
//            }

            return(root);
        }
 public AssetDatabaseBinding(string guid, StickyNote note)
 {
     GUID = guid;
     Note = note;
 }
 public SceneNoteBinding(long localIdentifier, StickyNote note)
 {
     LocalIdentifier = localIdentifier;
     Note            = note;
 }
 public void RemoveStickyNote(StickyNote note)
 {
     AssetDatabaseBindings.RemoveAll(x => x.Note == note);
     SceneBindings.RemoveAll(x => x.Note == note);
 }
 public void NewStickyAssetNote(string guid, StickyNote noteInstance)
 {
     noteInstance.attachment = Attachment.Asset;
     AssetDatabaseBindings.Add(new AssetDatabaseBinding(guid, noteInstance));
 }
 public void NewStickySceneNote(long localId, StickyNote noteInstance)
 {
     noteInstance.attachment = Attachment.GameObject;
     SceneBindings.Add(new SceneNoteBinding(localId, noteInstance));
 }