|
@@ -24,27 +24,20 @@ namespace GFGGame
|
|
IEnumerator StartLoadAssemblyHotfix()
|
|
IEnumerator StartLoadAssemblyHotfix()
|
|
{
|
|
{
|
|
LogServerHelperHttp.SendNodeLog((int)LogNode.StartLoadGameDll);
|
|
LogServerHelperHttp.SendNodeLog((int)LogNode.StartLoadGameDll);
|
|
- Debug.LogFormat("ILRuntimeLauncher StartLoadAssemblyHotfix");
|
|
|
|
|
|
+ //ET.Log.Debug("ILRuntimeLauncher StartLoadAssemblyHotfix");
|
|
yield return new WaitForSeconds(0.1f);
|
|
yield return new WaitForSeconds(0.1f);
|
|
var dllPath = "Assets/Res/Code/Game.HotUpdate.dll.bytes";
|
|
var dllPath = "Assets/Res/Code/Game.HotUpdate.dll.bytes";
|
|
var asset = GFGAsset.Load<TextAsset>(dllPath);
|
|
var asset = GFGAsset.Load<TextAsset>(dllPath);
|
|
byte[] assBytes = asset.bytes;
|
|
byte[] assBytes = asset.bytes;
|
|
- //Debug.LogFormat("assBytes != null {0}", assBytes != null);
|
|
|
|
- //Debug.LogFormat("assBytes.Length {0}", assBytes.Length);
|
|
|
|
- //yield return new WaitForSeconds(0.1f);
|
|
|
|
var pdbPath = "Assets/Res/Code/Game.HotUpdate.pdb.bytes";
|
|
var pdbPath = "Assets/Res/Code/Game.HotUpdate.pdb.bytes";
|
|
asset = GFGAsset.Load<TextAsset>(pdbPath);
|
|
asset = GFGAsset.Load<TextAsset>(pdbPath);
|
|
byte[] pdbBytes = asset.bytes;
|
|
byte[] pdbBytes = asset.bytes;
|
|
- //Debug.LogFormat("pdbBytes != null {0}", pdbBytes != null);
|
|
|
|
- //Debug.LogFormat("pdbBytes.Length {0}", pdbBytes.Length);
|
|
|
|
if (LauncherConfig.ILRuntimeMode)
|
|
if (LauncherConfig.ILRuntimeMode)
|
|
{
|
|
{
|
|
- Debug.LogFormat("Assembly Mode ILRuntime");
|
|
|
|
ILRuntimeLauncher.Instance.LoadAssembly(assBytes, pdbBytes);
|
|
ILRuntimeLauncher.Instance.LoadAssembly(assBytes, pdbBytes);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- Debug.LogFormat("Assembly Mode Jit");
|
|
|
|
StartCoroutine(LoadAssemblyJustInTime(assBytes, pdbBytes));
|
|
StartCoroutine(LoadAssemblyJustInTime(assBytes, pdbBytes));
|
|
}
|
|
}
|
|
GFGAsset.Release(dllPath);
|
|
GFGAsset.Release(dllPath);
|
|
@@ -53,15 +46,10 @@ namespace GFGGame
|
|
|
|
|
|
IEnumerator LoadAssemblyJustInTime(byte[] assBytes, byte[] pdbBytes)
|
|
IEnumerator LoadAssemblyJustInTime(byte[] assBytes, byte[] pdbBytes)
|
|
{
|
|
{
|
|
- //yield return new WaitForSeconds(0.1f);
|
|
|
|
//mono模式
|
|
//mono模式
|
|
var assembly = Assembly.Load(assBytes, pdbBytes);
|
|
var assembly = Assembly.Load(assBytes, pdbBytes);
|
|
this.allTypes = assembly.GetTypes();
|
|
this.allTypes = assembly.GetTypes();
|
|
- //Debug.LogFormat("assembly != null {0}", assembly != null);
|
|
|
|
- //yield return new WaitForSeconds(0.1f);
|
|
|
|
System.Type type = assembly.GetType("GFGGame.HotUpdate.HotUpdateEntry");
|
|
System.Type type = assembly.GetType("GFGGame.HotUpdate.HotUpdateEntry");
|
|
- //Debug.LogFormat("type != null {0}", type != null);
|
|
|
|
- //yield return new WaitForSeconds(0.1f);
|
|
|
|
type.GetMethod("Start").Invoke(type, null);
|
|
type.GetMethod("Start").Invoke(type, null);
|
|
yield break;
|
|
yield break;
|
|
}
|
|
}
|