Skip to content

Commit 007018f

Browse files
committed
notes on scene view
1 parent 180c0e3 commit 007018f

File tree

6 files changed

+21
-6
lines changed

6 files changed

+21
-6
lines changed

Assets/EditorNotes/Editor/EditorNoteInspector.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ private void OnEnable()
2323

2424
public override void OnInspectorGUI()
2525
{
26+
base.OnInspectorGUI();
27+
2628
InitializeGUIStyle();
2729
CheckNotes();
2830

29-
base.OnInspectorGUI();
30-
3131
if (_note != null)
3232
{
3333
DrawTextArea();
@@ -45,10 +45,20 @@ public override void OnInspectorGUI()
4545

4646
private void OnSceneGUI()
4747
{
48-
if (_note != null)
48+
if (_note == null)
4949
{
50-
Handles.Label(GetTargetGameObject().transform.position, _note?.content);
50+
return;
5151
}
52+
53+
string noteContent = _note.content;
54+
55+
Handles.Label(GetTargetGameObject().transform.position, noteContent);
56+
57+
Handles.BeginGUI();
58+
59+
GUILayout.Box(noteContent);
60+
61+
Handles.EndGUI();
5262
}
5363

5464
private void InitializeGUIStyle()
@@ -154,6 +164,7 @@ private void SaveNote()
154164
{
155165
return;
156166
}
167+
157168
_note?.Save();
158169
}
159170

Assets/EditorNotes/Editor/UniqueIdLinkerInspector.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public override void OnInspectorGUI()
2020

2121
if (string.IsNullOrEmpty(_id))
2222
{
23-
SerializedObject serializedObject = new SerializedObject(target);
2423
_id = serializedObject.FindProperty("_id").stringValue;
2524
}
2625

Assets/EditorNotes/EditorNotesFileHandler.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ internal static class EditorNotesFileHandler
1111

1212
public static void Write(string text, string objectUniqueId)
1313
{
14+
if (string.IsNullOrEmpty(objectUniqueId))
15+
{
16+
return;
17+
}
18+
1419
if (!Directory.Exists(DIRECTORY_PATH))
1520
{
1621
try

Assets/Scenes/SampleScene.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,4 @@ MonoBehaviour:
312312
m_Script: {fileID: 11500000, guid: 7f71c2be7e3c58249b46477188f5f010, type: 3}
313313
m_Name:
314314
m_EditorClassIdentifier:
315-
_id: 71d6d196fbce7a04ebb19eb0aa9a7baf
315+
_id: 9ae767009347b6149909599e4ef71715

EditorNotes/.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)