提交 2a0a7c14 编写于 作者: T tanghai

修复ILRuntime模式下,IMHandler编译的问题

上级 1d01430f
...@@ -54,7 +54,6 @@ namespace Model ...@@ -54,7 +54,6 @@ namespace Model
set set
{ {
this.hotfixAssembly = value; this.hotfixAssembly = value;
this.Load();
} }
} }
...@@ -78,6 +77,16 @@ namespace Model ...@@ -78,6 +77,16 @@ namespace Model
instance = null; instance = null;
} }
public void LoadHotfixDll()
{
#if ILRuntime
DllHelper.LoadHotfixAssembly();
#else
ObjectEvents.Instance.HotfixAssembly = DllHelper.LoadHotfixAssembly();
#endif
this.Load();
}
public void Add(string name, Assembly assembly) public void Add(string name, Assembly assembly)
{ {
this.assemblies[name] = assembly; this.assemblies[name] = assembly;
......
...@@ -41,7 +41,7 @@ namespace Model ...@@ -41,7 +41,7 @@ namespace Model
Log.Debug("run in ilruntime mode"); Log.Debug("run in ilruntime mode");
this.AppDomain = new ILRuntime.Runtime.Enviorment.AppDomain(); this.AppDomain = new ILRuntime.Runtime.Enviorment.AppDomain();
DllHelper.LoadHotfixAssembly(); ObjectEvents.Instance.LoadHotfixDll();
ILHelper.InitILRuntime(); ILHelper.InitILRuntime();
this.start = new ILStaticMethod("Hotfix.Init", "Start", 0); this.start = new ILStaticMethod("Hotfix.Init", "Start", 0);
...@@ -50,7 +50,7 @@ namespace Model ...@@ -50,7 +50,7 @@ namespace Model
this.onApplicationQuit = new ILStaticMethod("Hotfix.Init", "OnApplicationQuit", 0); this.onApplicationQuit = new ILStaticMethod("Hotfix.Init", "OnApplicationQuit", 0);
#else #else
Log.Debug("run in mono mode"); Log.Debug("run in mono mode");
ObjectEvents.Instance.HotfixAssembly = DllHelper.LoadHotfixAssembly(); ObjectEvents.Instance.LoadHotfixDll();
Type hotfixInit = ObjectEvents.Instance.HotfixAssembly.GetType("Hotfix.Init"); Type hotfixInit = ObjectEvents.Instance.HotfixAssembly.GetType("Hotfix.Init");
this.start = new MonoStaticMethod(hotfixInit, "Start"); this.start = new MonoStaticMethod(hotfixInit, "Start");
this.update = new MonoStaticMethod(hotfixInit, "Update"); this.update = new MonoStaticMethod(hotfixInit, "Update");
......
using System; using System;
using Model;
namespace Hotfix namespace Hotfix
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册