Skip to content

Commit 3d50551

Browse files
committed
fixed build compile error because of editor refs in sample scripts
1 parent 1a6b594 commit 3d50551

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

Assets/NikosAssets/U3DHelperTools/Samples/Scripts/EditorUtilitiesSample.cs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Collections.Generic;
22
using NaughtyAttributes;
3-
using NikosAssets.Helpers.Editor;
43
using UnityEngine;
54
using Object = UnityEngine.Object;
65

@@ -10,35 +9,39 @@ public class EditorUtilitiesSample : BaseNotesMono
109
{
1110
[BoxGroup(HelperConstants.ATTRIBUTE_FIELD_BOXGROUP_SETTINGS)]
1211
public string fileNameToReplace = "_RENAME_TEST_1";
13-
12+
1413
[BoxGroup(HelperConstants.ATTRIBUTE_FIELD_BOXGROUP_SETTINGS)]
1514
public string desiredFileName = "_RENAME_TEST_2";
1615

1716
[BoxGroup(HelperConstants.ATTRIBUTE_FIELD_BOXGROUP_SETTINGS)]
1817
public bool regenGuidsRecursive = true;
19-
18+
19+
#if UNITY_EDITOR
2020
[BoxGroup(HelperConstants.ATTRIBUTE_FIELD_BOXGROUP_SETTINGS)]
21-
public GUIDHelper.AcceptedMetaFiles acceptedMetaFilesForGuidRegen = GUIDHelper.AcceptedMetaFiles.Any;
22-
21+
public Editor.GUIDHelper.AcceptedMetaFiles acceptedMetaFilesForGuidRegen =
22+
Editor.GUIDHelper.AcceptedMetaFiles.Any;
23+
#endif
24+
2325
[BoxGroup(HelperConstants.ATTRIBUTE_FIELD_BOXGROUP_DESCRIPTIONS)]
2426
public string pathChosen = "Assets/";
2527

2628
[BoxGroup(HelperConstants.ATTRIBUTE_FIELD_BOXGROUP_DESCRIPTIONS)]
2729
public string scriptClassAndFileName = "GeneratedScriptTest";
28-
30+
2931
[BoxGroup(HelperConstants.ATTRIBUTE_FIELD_BOXGROUP_DESCRIPTIONS)]
3032
public string scriptMethodName = "CallMe";
3133

3234
[BoxGroup(HelperConstants.ATTRIBUTE_FIELD_BOXGROUP_DESCRIPTIONS)]
3335
public Object referenceForGUIDRegen;
34-
35-
#if UNITY_EDITOR
36-
36+
37+
#if UNITY_EDITOR
38+
3739
private void OnDestroy()
3840
{
3941
Debug.Log(this.name + " Mono Destroy: ");
4042
Debug.Log("Application.isPlaying: " + Application.isPlaying);
41-
Debug.Log("EditorUtilitiesHelper.ApplicationIsPlayingAccurate: " + Editor.EditorUtilitiesHelper.ApplicationIsPlayingAccurate);
43+
Debug.Log("EditorUtilitiesHelper.ApplicationIsPlayingAccurate: " +
44+
Editor.EditorUtilitiesHelper.ApplicationIsPlayingAccurate);
4245
}
4346

4447
[Button("Pick and save Folder path inside this project")]
@@ -69,7 +72,7 @@ public void LogFilesFromChosenPathRecursive()
6972
[Button("Rename Files at chosen path")]
7073
public void RenameFilesAtChosenPath()
7174
{
72-
Editor.EditorUtilitiesHelper.RenameFiles(pathChosen,
75+
Editor.EditorUtilitiesHelper.RenameFiles(pathChosen,
7376
fileNameToReplace, desiredFileName);
7477
}
7578

@@ -78,7 +81,6 @@ public void RegenerateGUIDsAtChosenPathRecursive()
7881
{
7982
Editor.GUIDHelper.RegenerateGuids(pathChosen, regenGuidsRecursive, acceptedMetaFilesForGuidRegen);
8083
}
81-
82-
#endif
84+
#endif
8385
}
8486
}

Assets/NikosAssets/U3DHelperTools/Samples/Scripts/GUIDRegenScriptableObjectSample.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Collections.Generic;
22
using NaughtyAttributes;
3-
using NikosAssets.Helpers.Editor;
43
using UnityEngine;
54

65
namespace NikosAssets.Helpers.Samples
@@ -17,7 +16,7 @@ public void RegenerateOnlyScriptableObjectsRecursive()
1716
#if UNITY_EDITOR
1817
Editor.GUIDHelper.RegenerateGuids(Editor.EditorUtilitiesHelper.PickFolderInsideProject("Regen GUIDS",
1918
"Assets/", "Assets/"), true,
20-
GUIDHelper.AcceptedMetaFiles.Any, true, new []{".asset"});
19+
Editor.GUIDHelper.AcceptedMetaFiles.Any, true, new []{".asset"});
2120
#endif
2221
}
2322
}

0 commit comments

Comments
 (0)