diff --git a/Packages/com.vrchat.UdonSharp/Editor/Compiler/UdonSharpCompilerV1.cs b/Packages/com.vrchat.UdonSharp/Editor/Compiler/UdonSharpCompilerV1.cs
index 0b9bccf4..2cda9a82 100644
--- a/Packages/com.vrchat.UdonSharp/Editor/Compiler/UdonSharpCompilerV1.cs
+++ b/Packages/com.vrchat.UdonSharp/Editor/Compiler/UdonSharpCompilerV1.cs
@@ -282,7 +282,7 @@ public static void Compile(UdonSharpCompileOptions options = null)
{
if (udonSharpProgram.sourceCsScript == null)
{
- UdonSharpUtils.LogError($"Source C# script on {udonSharpProgram} is null", udonSharpProgram);
+ UdonSharpUtils.LogError($"Source C# script on {udonSharpProgram} is null. Add the source C# script, or delete {udonSharpProgram}.", udonSharpProgram);
hasError = true;
continue;
}
@@ -291,7 +291,7 @@ public static void Compile(UdonSharpCompileOptions options = null)
if (string.IsNullOrEmpty(assetPath))
{
- UdonSharpUtils.LogError($"Source C# script on {udonSharpProgram} is null", udonSharpProgram);
+ UdonSharpUtils.LogError($"Source C# script on {udonSharpProgram} is null. Add the source C# script, or delete {udonSharpProgram}.", udonSharpProgram);
hasError = true;
continue;
}
diff --git a/Packages/com.vrchat.UdonSharp/Editor/UdonSharpUtils.cs b/Packages/com.vrchat.UdonSharp/Editor/UdonSharpUtils.cs
index 9ad2a3cc..3bdad86b 100644
--- a/Packages/com.vrchat.UdonSharp/Editor/UdonSharpUtils.cs
+++ b/Packages/com.vrchat.UdonSharp/Editor/UdonSharpUtils.cs
@@ -329,6 +329,13 @@ public static void LogError(object message, UnityEngine.Object context)
Debug.LogError($"[UdonSharp] {message}", context);
}
+ public static void LogError(object message, UdonSharpProgramAsset context)
+ {
+ var asset = AssetDatabase.FindAssets($"t:{nameof(UdonSharpProgramAsset)} {context.name}");
+ if (asset == null || asset[0] == null) LogError(message, context);
+ else Debug.LogError($"[UdonSharp] {message}", AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(asset[0])));
+ }
+
private static readonly MethodInfo _displayProgressBar = typeof(Editor).Assembly.GetTypes().FirstOrDefault(e => e.Name == "AsyncProgressBar")?.GetMethod("Display");
private static readonly MethodInfo _clearProgressBar = typeof(Editor).Assembly.GetTypes().FirstOrDefault(e => e.Name == "AsyncProgressBar")?.GetMethod("Clear");