Skip to content

Commit 844fe57

Browse files
committed
fixes
1 parent 0f06183 commit 844fe57

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

Editor/NoteEditor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ private void OnAuthorSelected(object obj)
4141
AuthorInfo author = (AuthorInfo)obj;
4242
serializedObject.FindProperty("_authorID").intValue = author._id;
4343
serializedObject.ApplyModifiedProperties();
44+
foreach (Note note in targets)
45+
note.UpdateRefs();
4446
}
4547
public GenericMenu GetTypesGenericMenu()
4648
{
@@ -58,6 +60,8 @@ private void OnTypeSelected(object obj)
5860
NoteTypeInfo type = (NoteTypeInfo)obj;
5961
serializedObject.FindProperty("_typeID").intValue = type._id;
6062
serializedObject.ApplyModifiedProperties();
63+
foreach (Note note in targets)
64+
note.UpdateRefs();
6165
}
6266

6367
private void Init()

Editor/NoteUtility.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static void CreateNote(MenuCommand menuCommand)
2929
}
3030

3131
[DrawGizmo(GizmoType.Selected | GizmoType.NonSelected | GizmoType.Pickable)]
32-
public static void DrawLazyNote(LazyNote note, GizmoType gizmoType)
32+
private static void DrawLazyNote(LazyNote note, GizmoType gizmoType)
3333
{
3434
if (note.DrawIcon)
3535
{
@@ -39,21 +39,20 @@ public static void DrawLazyNote(LazyNote note, GizmoType gizmoType)
3939
string sceneNote = GetSceneNote(note.Text, note.DrawIcon);
4040
Handles.Label(note.transform.position, sceneNote, EditorStyles.whiteBoldLabel);
4141
}
42-
4342
[DrawGizmo(GizmoType.Selected | GizmoType.NonSelected | GizmoType.Pickable)]
44-
public static void DrawNote(Note note, GizmoType gizmoType)
43+
private static void DrawNote(Note note, GizmoType gizmoType)
4544
{
4645
if (note.DrawIcon)
4746
{
48-
Gizmos.DrawIcon(note.transform.position, GetGizmosPath() + "/Runtime/Note Author Icon.png", false, note.Author.color);
49-
Gizmos.DrawIcon(note.transform.position, GetGizmosPath() + "/Runtime/Note Type Icon.png", false, note.Type.color);
47+
Gizmos.DrawIcon(note.transform.position, NoteUtility.GetGizmosPath() + "/Runtime/Note Author Icon.png", false, note.Author.color);
48+
Gizmos.DrawIcon(note.transform.position, NoteUtility.GetGizmosPath() + "/Runtime/Note Type Icon.png", false, note.Type.color);
5049
}
5150

52-
string sceneNote = GetSceneNote(note.Text, note.DrawIcon);
51+
string sceneNote = NoteUtility.GetSceneNote(note.Text, note.DrawIcon);
5352
Handles.Label(note.transform.position, sceneNote, EditorStyles.whiteBoldLabel);
5453
}
5554

56-
private static string GetGizmosPath()
55+
internal static string GetGizmosPath()
5756
{
5857
if (string.IsNullOrEmpty(_gizmosPath))
5958
{
@@ -68,7 +67,7 @@ private static string GetGizmosPath()
6867
}
6968
return _gizmosPath;
7069
}
71-
private static string GetSceneNote(string fullNote, bool isNeedSpacing)
70+
internal static string GetSceneNote(string fullNote, bool isNeedSpacing)
7271
{
7372
int index = fullNote.IndexOf(NOTE_SEPARATOR);
7473
if (index < 0) return string.Empty;

Runtime/Note.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal void UpdateRefs()
2828
{
2929
#if UNITY_EDITOR
3030
_author = NotesSettings.Instance.GetAuthorInfoOrDummy(_authorID);
31-
_type = NotesSettings.Instance.GetNoteTypeInfoOrDummy(_authorID);
31+
_type = NotesSettings.Instance.GetNoteTypeInfoOrDummy(_typeID);
3232
#endif
3333
}
3434

0 commit comments

Comments
 (0)