Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
7 changes: 7 additions & 0 deletions Packages/com.vrchat.UdonSharp/Editor/UdonSharpUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,13 @@ public static void LogError(object message, UnityEngine.Object context)
Debug.LogError($"[<color=#FF00FF>UdonSharp</color>] {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($"[<color=#FF00FF>UdonSharp</color>] {message}", AssetDatabase.LoadAssetAtPath<UdonSharpProgramAsset>(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");

Expand Down