void OnSelectionChange() { //if (Selection.activeInstanceID != 0) if (UNotesHInventory.HasNote(currSelectedInstanceID)) // if we deselect a (previously selected) note, consolidate { UNotesHInventory.ConsolidateRequest(); } InitWithSelectedNote(); Refresh(); Refresh(); currSelectedInstanceID = Selection.activeInstanceID; // update currently selected instance id }
// UndoRedoItem undoredo; // Add menu item to show Unotes Window //[MenuItem("GameObject/UNotes/Open Note", false, 0)] public static void InitWithSelectedNote() { UNote note = UNotesHInventory.GetNote(Selection.activeInstanceID); currentNote = note; if (currentNote == null) { return; } style = CreateStyleForNote(currentNote); emptyWindowStyle = CreateEmptyWindowStyle(); UNoteEditWindow window = (UNoteEditWindow)EditorWindow.GetWindow(typeof(UNoteEditWindow), false, "UNote"); window.Show(); instance = window; }
void OnGUI() { if (GUILayout.Button("Consolidate")) { UNotesHInventory.SYNC_TEST(); } else if (GUILayout.Button("Restore")) { UNotesHInventory.RESTORE_TEST(); } else if (GUILayout.Button("Load")) { UNotesHInventory.LOAD_TEST(); } else if (GUILayout.Button("Save")) { UNotesHInventory.SAVE_TEST(); } else if (GUILayout.Button("Debug DB")) { UNotesHInventory.DEBUG_DB(); } else if (GUILayout.Button("Debug Current")) { UNotesHInventory.DEBUG_CURRENT(); } else if (GUILayout.Button("Debug Scene Hash")) { UNotesHInventory.DEBUG_SCENEHASH(); } else if (GUILayout.Button("Debug Hash Functions")) { UNotesHInventory.DEBUG_HASHFUCNTIONS(); } else if (GUILayout.Button("Repaint Hierarchy")) { EditorApplication.RepaintHierarchyWindow(); } else if (GUILayout.Button("Print Note's Hash")) { UNotesHInventory.PrintInfo(); } //else if (GUILayout.Button("Reattach to GameObjects")) //{ //} }