using System.IO;
|
using ILRuntime.Mono.Cecil.Pdb;
|
using ILRuntime.Runtime.Enviorment;
|
|
class ILRuntimeUtility : SingletonMonobehaviour<ILRuntimeUtility>
|
{
|
private AppDomain appdomain;
|
|
public void Init()
|
{
|
LoadILRuntime();
|
}
|
|
void LoadILRuntime()
|
{
|
appdomain = new AppDomain();
|
var dllPath = string.Empty;
|
var pdbPath = string.Empty;
|
if (AssetSource.refdataFromEditor)
|
{
|
dllPath = ResourcesPath.ResourcesOutAssetPath + "logic/Logic.dll.bytes";
|
pdbPath = ResourcesPath.ResourcesOutAssetPath + "logic/Logic.pdb";
|
}
|
else
|
{
|
dllPath = AssetVersionUtility.GetAssetFilePath("logic/Logic.dll.bytes");
|
pdbPath = AssetVersionUtility.GetAssetFilePath("logic/Logic.pdb");
|
}
|
var fs = new FileStream(dllPath, FileMode.Open);
|
var p = new FileStream(pdbPath, FileMode.Open);
|
appdomain.LoadAssembly(fs, p, new PdbReaderProvider());
|
}
|
|
public void LaunchStart()
|
{
|
appdomain.Invoke("GameLogicMgr", "Init", null, null);
|
}
|
|
}
|