public static IHierarchyProNote Create(Transform transform) { HierarchyProNoteTransform existingNote = HierarchyProNotesLibrary.TransformNotes.FirstOrDefault(x => x.Transform == transform); if (existingNote != null) { return(existingNote); } HierarchyProNoteTransform note = new HierarchyProNoteTransform(transform); List <HierarchyProNoteTransform> notes = HierarchyProNotesLibrary.TransformNotes.ToList(); notes.Add(note); HierarchyProNotesLibrary.Instance.transformNotes = 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."); }