Skip to content

Commit d8343e1

Browse files
authored
Fix REPL failing to init in some games (#110)
1 parent 3ee8f52 commit d8343e1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

RuntimeUnityEditor.Core/Windows/REPL/MCS/ScriptEvaluator.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO;
44
using System.Reflection;
55
using Mono.CSharp;
6+
using RuntimeUnityEditor.Core.Utils.Abstractions;
67

78
namespace RuntimeUnityEditor.Core.REPL.MCS
89
{
@@ -56,10 +57,18 @@ private static void ImportAppdomainAssemblies(Action<Assembly> import)
5657
{
5758
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
5859
{
59-
string name = assembly.GetName().Name;
60-
if (StdLib.Contains(name))
60+
var assemblyName = assembly.GetName();
61+
var shortName = assemblyName.Name;
62+
if (StdLib.Contains(shortName))
6163
continue;
62-
import(assembly);
64+
try
65+
{
66+
import(assembly);
67+
}
68+
catch (Exception e)
69+
{
70+
RuntimeUnityEditorCore.Logger.Log(LogLevel.Warning, $"[REPL] Failed to import [{assemblyName.FullName}]: {e.Message}");
71+
}
6372
}
6473
}
6574
}

0 commit comments

Comments
 (0)