|
|
@@ -14,11 +14,9 @@ namespace ET
|
|
|
|
|
|
private Dictionary<string, TextAsset> dlls;
|
|
|
private Dictionary<string, TextAsset> aotDlls;
|
|
|
- private bool enableDll;
|
|
|
|
|
|
public void Awake()
|
|
|
{
|
|
|
- this.enableDll = Resources.Load<GlobalConfig>("GlobalConfig").EnableDll;
|
|
|
}
|
|
|
|
|
|
private async ETTask DownloadAsync()
|
|
|
@@ -62,36 +60,12 @@ namespace ET
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (this.enableDll)
|
|
|
- {
|
|
|
- byte[] modelAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Model.dll.bytes"));
|
|
|
- byte[] modelPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Model.pdb.bytes"));
|
|
|
- byte[] modelViewAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.ModelView.dll.bytes"));
|
|
|
- byte[] 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;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ byte[] modelAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Model.dll.bytes"));
|
|
|
+ byte[] modelPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.Model.pdb.bytes"));
|
|
|
+ byte[] modelViewAssBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.ModelView.dll.bytes"));
|
|
|
+ byte[] modelViewPdbBytes = File.ReadAllBytes(Path.Combine(Define.CodeDir, "Unity.ModelView.pdb.bytes"));
|
|
|
+ this.modelAssembly = Assembly.Load(modelAssBytes, modelPdbBytes);
|
|
|
+ this.modelViewAssembly = Assembly.Load(modelViewAssBytes, modelViewPdbBytes);
|
|
|
}
|
|
|
|
|
|
(Assembly hotfixAssembly, Assembly hotfixViewAssembly) = this.LoadHotfix();
|
|
|
@@ -130,36 +104,12 @@ namespace ET
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- 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;
|
|
|
- }
|
|
|
-
|
|
|
- if (hotfixAssembly != null && hotfixViewAssembly != null)
|
|
|
- {
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ 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);
|
|
|
}
|
|
|
|
|
|
return (hotfixAssembly, hotfixViewAssembly);
|