|
@@ -14,9 +14,11 @@ namespace ET
|
|
|
|
|
|
|
|
private Dictionary<string, TextAsset> dlls;
|
|
private Dictionary<string, TextAsset> dlls;
|
|
|
private Dictionary<string, TextAsset> aotDlls;
|
|
private Dictionary<string, TextAsset> aotDlls;
|
|
|
|
|
+ private bool enableDll;
|
|
|
|
|
|
|
|
public void Awake()
|
|
public void Awake()
|
|
|
{
|
|
{
|
|
|
|
|
+ this.enableDll = Resources.Load<GlobalConfig>("GlobalConfig").EnableDll;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public async ETTask DownloadAsync()
|
|
public async ETTask DownloadAsync()
|
|
@@ -57,15 +59,38 @@ namespace ET
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- modelAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Model.dll.bytes"));
|
|
|
|
|
- modelPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Model.pdb.bytes"));
|
|
|
|
|
- modelViewAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.ModelView.dll.bytes"));
|
|
|
|
|
- modelViewPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.ModelView.pdb.bytes"));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- this.modelAssembly = Assembly.Load(modelAssBytes, modelPdbBytes);
|
|
|
|
|
- this.modelViewAssembly = Assembly.Load(modelViewAssBytes, modelViewPdbBytes);
|
|
|
|
|
|
|
+ if (this.enableDll)
|
|
|
|
|
+ {
|
|
|
|
|
+ modelAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Model.dll.bytes"));
|
|
|
|
|
+ modelPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Model.pdb.bytes"));
|
|
|
|
|
+ modelViewAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.ModelView.dll.bytes"));
|
|
|
|
|
+ modelViewPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.ModelView.pdb.bytes"));
|
|
|
|
|
+ this.modelAssembly = Assembly.Load(modelAssBytes, modelPdbBytes);
|
|
|
|
|
+ this.modelViewAssembly = Assembly.Load(modelViewAssBytes, modelViewPdbBytes);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
|
|
|
|
+ foreach (Assembly ass in assemblies)
|
|
|
|
|
+ {
|
|
|
|
|
+ string name = ass.GetName().Name;
|
|
|
|
|
+ if (name == "Unity.Model")
|
|
|
|
|
+ {
|
|
|
|
|
+ this.modelAssembly = ass;
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (name == "Unity.ModelView")
|
|
|
|
|
+ {
|
|
|
|
|
+ this.modelViewAssembly = ass;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ if (this.modelAssembly != null && this.modelViewAssembly != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
(Assembly hotfixAssembly, Assembly hotfixViewAssembly) = this.LoadHotfix();
|
|
(Assembly hotfixAssembly, Assembly hotfixViewAssembly) = this.LoadHotfix();
|
|
|
|
|
|
|
|
World.Instance.AddSingleton<CodeTypes, Assembly[]>(new[]
|
|
World.Instance.AddSingleton<CodeTypes, Assembly[]>(new[]
|
|
@@ -84,6 +109,8 @@ namespace ET
|
|
|
byte[] hotfixPdbBytes;
|
|
byte[] hotfixPdbBytes;
|
|
|
byte[] hotfixViewAssBytes;
|
|
byte[] hotfixViewAssBytes;
|
|
|
byte[] hotfixViewPdbBytes;
|
|
byte[] hotfixViewPdbBytes;
|
|
|
|
|
+ Assembly hotfixAssembly = null;
|
|
|
|
|
+ Assembly hotfixViewAssembly = null;
|
|
|
if (!Define.IsEditor)
|
|
if (!Define.IsEditor)
|
|
|
{
|
|
{
|
|
|
hotfixAssBytes = this.dlls["Unity.Hotfix.dll"].bytes;
|
|
hotfixAssBytes = this.dlls["Unity.Hotfix.dll"].bytes;
|
|
@@ -95,17 +122,43 @@ namespace ET
|
|
|
//hotfixPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Hotfix.pdb.bytes"));
|
|
//hotfixPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Hotfix.pdb.bytes"));
|
|
|
//hotfixViewAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.HotfixView.dll.bytes"));
|
|
//hotfixViewAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.HotfixView.dll.bytes"));
|
|
|
//hotfixViewPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.HotfixView.pdb.bytes"));
|
|
//hotfixViewPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.HotfixView.pdb.bytes"));
|
|
|
|
|
+ hotfixAssembly = Assembly.Load(hotfixAssBytes, hotfixPdbBytes);
|
|
|
|
|
+ hotfixViewAssembly = Assembly.Load(hotfixViewAssBytes, hotfixViewPdbBytes);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- hotfixAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Hotfix.dll.bytes"));
|
|
|
|
|
- hotfixPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Hotfix.pdb.bytes"));
|
|
|
|
|
- hotfixViewAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.HotfixView.dll.bytes"));
|
|
|
|
|
- hotfixViewPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.HotfixView.pdb.bytes"));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (this.enableDll)
|
|
|
|
|
+ {
|
|
|
|
|
+ hotfixAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Hotfix.dll.bytes"));
|
|
|
|
|
+ hotfixPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Hotfix.pdb.bytes"));
|
|
|
|
|
+ hotfixViewAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.HotfixView.dll.bytes"));
|
|
|
|
|
+ hotfixViewPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.HotfixView.pdb.bytes"));
|
|
|
|
|
+ hotfixAssembly = Assembly.Load(hotfixAssBytes, hotfixPdbBytes);
|
|
|
|
|
+ hotfixViewAssembly = Assembly.Load(hotfixViewAssBytes, hotfixViewPdbBytes);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
|
|
|
|
+ foreach (Assembly ass in assemblies)
|
|
|
|
|
+ {
|
|
|
|
|
+ string name = ass.GetName().Name;
|
|
|
|
|
+ if (name == "Unity.Hotfix")
|
|
|
|
|
+ {
|
|
|
|
|
+ hotfixAssembly = ass;
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (name == "Unity.HotfixView")
|
|
|
|
|
+ {
|
|
|
|
|
+ hotfixViewAssembly = ass;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- Assembly hotfixAssembly = Assembly.Load(hotfixAssBytes, hotfixPdbBytes);
|
|
|
|
|
- Assembly hotfixViewAssembly = Assembly.Load(hotfixViewAssBytes, hotfixViewPdbBytes);
|
|
|
|
|
|
|
+ if (hotfixAssembly != null && hotfixViewAssembly != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return (hotfixAssembly, hotfixViewAssembly);
|
|
return (hotfixAssembly, hotfixViewAssembly);
|
|
|
}
|
|
}
|
|
|
|
|
|