public static void Draw(Rect rect, Transform transform) { IHierarchyProNote note = HierarchyProNotesLibrary.Find(transform); bool clicked = HierarchyProEditorNotes.Draw(rect, note); if (clicked) { if (note == null) { note = HierarchyProNotesLibrary.Create(transform); note.Icon = HierarchyProEditorIcons.Note; } HierarchyProEditorNoteWindow content = new HierarchyProEditorNoteWindow(note); PopupWindow.Show(rect, content); } }
private static bool Draw(Rect rect, IHierarchyProNote note) { Texture icon = HierarchyProEditorIcons.Plus; Color color = EditorGUIUtility.isProSkin ? new Color(1, 1, 1, 0.1f) : new Color(1, 1, 1, 0.2f); if (note != null) { icon = note.Icon; color = note.ColorBackground; } if (icon != null) { GUI.color = color; GUI.DrawTexture(rect.GetCenteredIconRect(icon), icon); GUI.color = Color.white; } return(GUI.Button(rect, GUIContent.none, GUIStyle.none)); }
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."); }
public HierarchyProEditorNoteWindow(IHierarchyProNote note) { this.note = note; }