示例#1
0
 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/HotfixDLL/Hotfix.dll.bytes", System.IO.FileMode.Open, System.IO.FileAccess.Read))
     {
         domain.LoadAssembly(fs);
         //Crossbind Adapter is needed to generate the correct binding code
         ILRuntimeHelper.InitILRuntime(domain);
         ILRuntime.Runtime.CLRBinding.BindingCodeGenerator.GenerateBindingCode(domain, "Assets/Scripts/GameMain/Customs/CustomComponents/ILRuntime/Generated");
         AssetDatabase.Refresh();
     }
 }