Skip to content

Commit 001beb3

Browse files
committed
add auto EditorOnly tag
1 parent 1f11c35 commit 001beb3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Editor/NoteUtility.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ private static GameObject FindRoot(string name)
1313
{
1414
GameObject root = GameObject.Find(name);
1515
if (root == null)
16+
{
1617
root = new GameObject(name);
18+
root.tag = EDITOR_NAME_TAG;
19+
}
1720
return root;
1821
}
1922

2023
#region CreateLazyNote
21-
[MenuItem("GameObject/" + ASSET_SHORT_NAME + "/Create " + nameof(LazyNote) + "with arrow")]
24+
[MenuItem("GameObject/" + ASSET_SHORT_NAME + "/Create " + nameof(LazyNote) + " with arrow")]
2225
public static void CreateLazyNoteWithArrow(MenuCommand menuCommand)
2326
{
2427
GameObject go = CreateLazyNoteInternal(menuCommand);
@@ -34,6 +37,7 @@ public static void CreateLazyNote(MenuCommand menuCommand)
3437
private static GameObject CreateLazyNoteInternal(MenuCommand menuCommand)
3538
{
3639
GameObject go = new GameObject(nameof(LazyNote));
40+
go.tag = EDITOR_NAME_TAG;
3741
go.AddComponent<LazyNote>();
3842
GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
3943
if (go.transform.parent == null)
@@ -44,7 +48,7 @@ private static GameObject CreateLazyNoteInternal(MenuCommand menuCommand)
4448
#endregion
4549

4650
#region CreateNote
47-
[MenuItem("GameObject/" + ASSET_SHORT_NAME + "/Create " + nameof(Note) + "with arrow")]
51+
[MenuItem("GameObject/" + ASSET_SHORT_NAME + "/Create " + nameof(Note) + " with arrow")]
4852
public static void CreateNoteWithArrow(MenuCommand menuCommand)
4953
{
5054
GameObject go = CreateNoteInternal(menuCommand);
@@ -60,6 +64,7 @@ public static void CreateNote(MenuCommand menuCommand)
6064
private static GameObject CreateNoteInternal(MenuCommand menuCommand)
6165
{
6266
GameObject go = new GameObject(nameof(Note));
67+
go.tag = EDITOR_NAME_TAG;
6368
go.AddComponent<Note>();
6469
GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
6570
if (go.transform.parent == null)

Runtime/Consts.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ namespace DCFApixels.Notes
44
{
55
internal class NotesConsts
66
{
7-
public const string NOTES_ROOT_NAME = "NOTES";
7+
public const string EDITOR_NAME_TAG = "EditorOnly";
8+
public const string NOTES_ROOT_NAME = "NOTES (" + EDITOR_NAME_TAG + ")";
89

910
public const string ASSET_SHORT_NAME = "Notes";
1011
public const string AUTHOR = "DCFApixels";

0 commit comments

Comments
 (0)