File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
DemoProject/Assets/Scripts/TestEntry Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,18 @@ public static void Main()
20
20
21
21
static void TestLoadAssembly ( )
22
22
{
23
- var dllPath = Application . persistentDataPath + $ "/Managed/{ StartInfo . ReloadDllName } ";
24
- if ( File . Exists ( dllPath ) )
23
+ var dllName = StartInfo . ReloadDllName ;
24
+ var dllPath = Application . persistentDataPath + $ "/Managed/{ dllName } ";
25
+
26
+ Assembly assembly = null ;
27
+
28
+ if ( File . Exists ( dllPath ) )
29
+ assembly = Assembly . LoadFrom ( dllPath ) ;
30
+ else
31
+ assembly = Assembly . Load ( dllName ) ;
32
+
33
+ if ( assembly != null )
25
34
{
26
- Assembly assembly = Assembly . LoadFrom ( dllPath ) ;
27
35
Type type = assembly . GetType ( StartInfo . ReloadClassName ) ;
28
36
MethodInfo mi = type . GetMethod ( StartInfo . TestMethodName ) ;
29
37
var res = mi . Invoke ( null , new object [ ] { "hello" } ) ;
You can’t perform that action at this time.
0 commit comments