public static IHierarchyProNote Create(HierarchyProGroup group) { HierarchyProNoteGroup existingNote = HierarchyProNotesLibrary.GroupNotes.FirstOrDefault(x => x.Group == group); if (existingNote != null) { return(existingNote); } HierarchyProNoteGroup note = new HierarchyProNoteGroup(group); List <HierarchyProNoteGroup> notes = HierarchyProNotesLibrary.GroupNotes.ToList(); notes.Add(note); HierarchyProNotesLibrary.Instance.groupNotes = notes.ToArray(); return(note); }
public static void Delete(IHierarchyProNote note) { HierarchyProNoteTransform transformNote = note as HierarchyProNoteTransform; if (transformNote != null) { List <HierarchyProNoteTransform> transformNotes = HierarchyProNotesLibrary.TransformNotes.ToList(); transformNotes.Remove(transformNote); HierarchyProNotesLibrary.Instance.transformNotes = transformNotes.ToArray(); return; } HierarchyProNoteGroup groupNote = note as HierarchyProNoteGroup; if (groupNote != null) { List <HierarchyProNoteGroup> groupNotes = HierarchyProNotesLibrary.GroupNotes.ToList(); groupNotes.Remove(groupNote); HierarchyProNotesLibrary.Instance.groupNotes = groupNotes.ToArray(); return; } Debug.Log("[HierarchyPro] Could not locate note in library."); }