Skip to content

Commit

Permalink
修复生成ILRT Binding报错的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
egametang committed Mar 1, 2019
1 parent 3650615 commit c600fd0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Unity/Assets/Editor/ILRuntimeEditor/ILRuntimeCLRBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using ILRuntime.Runtime.Enviorment;
using ETModel;
Expand Down Expand Up @@ -42,14 +43,14 @@ static void GenerateCLRBindingByAnalysis()
{
//用新的分析热更dll调用引用来生成绑定代码
ILRuntime.Runtime.Enviorment.AppDomain domain = new ILRuntime.Runtime.Enviorment.AppDomain();
using (System.IO.FileStream fs = new System.IO.FileStream("Assets/Res/Code/Hotfix.dll.bytes", System.IO.FileMode.Open, System.IO.FileAccess.Read))
using (FileStream fs = new FileStream("Assets/Res/Code/Hotfix.dll.bytes", FileMode.Open, FileAccess.Read))
{
domain.LoadAssembly(fs);
domain.LoadAssembly(fs);
//Crossbind Adapter is needed to generate the correct binding code
ILHelper.InitILRuntime(domain);
ILRuntime.Runtime.CLRBinding.BindingCodeGenerator.GenerateBindingCode(domain, "Assets/Model/ILBinding");
AssetDatabase.Refresh();
}
//Crossbind Adapter is needed to generate the correct binding code
ILHelper.InitILRuntime(domain);
ILRuntime.Runtime.CLRBinding.BindingCodeGenerator.GenerateBindingCode(domain, "Assets/Model/ILBinding");
AssetDatabase.Refresh();
}
}
}
#endif

0 comments on commit c600fd0

Please sign in to comment.