Skip to content

Commit d697408

Browse files
committed
fix
1 parent 305ba5c commit d697408

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Editor/NotesSettings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ void ISerializationCallbackReceiver.OnBeforeSerialize()
123123
}
124124
public static class NotesSettingsExtensions
125125
{
126+
public static bool IsNullOrDummy(this AuthorInfo self) => self == null || self == DUMMY_AUTHOR;
127+
public static bool IsNullOrDummy(this NoteTypeInfo self) => self == null || self == DUMMY_NOTE_TYPE;
126128
public static bool IsDummy(this AuthorInfo self) => self == DUMMY_AUTHOR;
127129
public static bool IsDummy(this NoteTypeInfo self) => self == DUMMY_NOTE_TYPE;
128130
}

Runtime/Note.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public AuthorInfo Author
6868
get
6969
{
7070
#if UNITY_EDITOR
71-
if (_author == null) UpdateRefs();
71+
if (_author.IsNullOrDummy() == false) UpdateRefs();
7272
return _author;
7373
#else
7474
return null;
@@ -87,7 +87,7 @@ public NoteTypeInfo Type
8787
get
8888
{
8989
#if UNITY_EDITOR
90-
if (_type == null) UpdateRefs();
90+
if (_type.IsNullOrDummy() == false) UpdateRefs();
9191
return _type;
9292
#else
9393
return null;
@@ -118,7 +118,7 @@ public Color Color
118118
get
119119
{
120120
#if UNITY_EDITOR
121-
return _type.color;
121+
return Type.color;
122122
#else
123123
return default;
124124
#endif

0 commit comments

Comments
 (0)