下载资源MD5校验问题修正,支持断点续传

下载资源MD5校验问题修正,支持断点续传
This commit is contained in:
ALEXTANG
2023-02-10 12:11:20 +08:00
parent 1edbfcc086
commit bc5f12ed88
16 changed files with 688 additions and 489 deletions

View File

@@ -336,7 +336,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: bc449de9a177d854181ed6d829a72ada, type: 3} m_Script: {fileID: 11500000, guid: bc449de9a177d854181ed6d829a72ada, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
ResourceMode: 1 ResourceMode: 2
m_ResourceHelperTypeName: TEngine.Runtime.DefaultResourceHelper m_ResourceHelperTypeName: TEngine.Runtime.DefaultResourceHelper
m_CustomResourceHelper: {fileID: 0} m_CustomResourceHelper: {fileID: 0}
--- !u!1 &3463045026180535776 --- !u!1 &3463045026180535776
@@ -374,6 +374,7 @@ Transform:
- {fileID: 3463045025307533286} - {fileID: 3463045025307533286}
- {fileID: 1672025514} - {fileID: 1672025514}
- {fileID: 96376812} - {fileID: 96376812}
- {fileID: 5650366479353104569}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -427,6 +428,54 @@ MonoBehaviour:
- TEngine.Runtime.ProcedureResourcesInit - TEngine.Runtime.ProcedureResourcesInit
- TEngine.Runtime.ProcedureResourcesUpdate - TEngine.Runtime.ProcedureResourcesUpdate
- TEngine.Runtime.ProcedureResourcesVerify - TEngine.Runtime.ProcedureResourcesVerify
- TEngine.Runtime.ProcedureRunPuerts
- TEngine.Runtime.ProcedureSplash - TEngine.Runtime.ProcedureSplash
- TEngine.Runtime.ProcedureStartGame - TEngine.Runtime.ProcedureStartGame
m_EntranceProcedureTypeName: TEngine.Runtime.ProcedureLaunch m_EntranceProcedureTypeName: TEngine.Runtime.ProcedureLaunch
--- !u!1 &5455811614053608841
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5650366479353104569}
- component: {fileID: 9103295844223457350}
m_Layer: 0
m_Name: PuertsMgr
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5650366479353104569
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5455811614053608841}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3463045026180535779}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &9103295844223457350
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5455811614053608841}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7135f85bd7cf44f694f817356b03519e, type: 3}
m_Name:
m_EditorClassIdentifier:
WaitForDebugger: 0
RunOnAwake: 0
DebuggerRoot: G:/1_WorkSpace/TEngine_Custom/Assets/TResource/PuertsScripts
DebuggerPort: 5556

View File

@@ -67,12 +67,12 @@ namespace TEngineCore.Editor
TLogger.LogError("未设置BuilderData请先调用接口SetBuilderConfig"); TLogger.LogError("未设置BuilderData请先调用接口SetBuilderConfig");
return; return;
} }
CurBuilderData.platform = platform; CurBuilderData.platform = platform;
switch (CurBuilderData.platform) switch (CurBuilderData.platform)
{ {
case BuilderUtility.PlatformType.Windows: case BuilderUtility.PlatformType.Windows:
{ {
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Standalone, EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Standalone,
BuildTarget.StandaloneWindows64); BuildTarget.StandaloneWindows64);
@@ -97,7 +97,6 @@ namespace TEngineCore.Editor
break; break;
case BuilderUtility.PlatformType.iOS: case BuilderUtility.PlatformType.iOS:
{ {
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.iOS, BuildTarget.iOS); EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.iOS, BuildTarget.iOS);
PlayerSettings.iOS.appleEnableAutomaticSigning = false; PlayerSettings.iOS.appleEnableAutomaticSigning = false;
@@ -115,7 +114,6 @@ namespace TEngineCore.Editor
} }
/// <summary> /// <summary>
/// 构建包体 /// 构建包体
/// </summary> /// </summary>
@@ -199,6 +197,106 @@ namespace TEngineCore.Editor
return true; return true;
} }
public void BuildActive(bool isDirectBuild,BuildOptions options = BuildOptions.None)
{
var platform = CurBuilderData.platform;
var buildStart = DateTime.Now;
if (!isDirectBuild)
{
BuildAssetsCommand.BuildAndCopyABAOTHotUpdateDlls();
if (!BuildAssetBundle())
return;
}
else
{
Instance.AssetbundleBuilder.CopyAssetBundles();
}
if (CurBuilderData == null)
{
TLogger.LogError("未设置BuilderData请先调用接口SetBuilderConfig");
return;
}
CurBuilderData.ApplyArgs("");
PlayerSettings.productName = CurBuilderData.productName;
PlayerSettings.bundleVersion = CurBuilderData.bundleVersion + "." + CurBuilderData._bBaseVersion;
if (EditorUserBuildSettings.development)
options |= BuildOptions.Development;
if (EditorUserBuildSettings.connectProfiler)
options |= BuildOptions.ConnectWithProfiler;
if (EditorUserBuildSettings.buildWithDeepProfilingSupport)
options |= BuildOptions.EnableDeepProfilingSupport;
string applicationName = string.Empty;
BuildTarget target = BuildTarget.NoTarget;
switch (CurBuilderData.platform)
{
case BuilderUtility.PlatformType.Android:
applicationName = CurBuilderData.bExportAndroidProject ? $"{CurBuilderData.productName}" : $"{CurBuilderData.productName}.apk";
target = BuildTarget.Android;
break;
case BuilderUtility.PlatformType.iOS:
applicationName = $"{CurBuilderData.productName}.ipa";
target = BuildTarget.iOS;
break;
case BuilderUtility.PlatformType.Windows:
applicationName = $"{CurBuilderData.productName}.exe";
target = BuildTarget.StandaloneWindows64;
break;
default:
UnityEngine.Debug.LogError("Not supported target platform");
return;
}
SetAppStoreUrl();
LoaderUtilities.DeleteFolder(FileSystem.ResourceRoot);
BuilderInjectorHandler(BuilderInjectorMoment.BeforeBuild_Apk);
BuilderInjectorHandler(BuilderInjectorMoment.BeforeBuild_FirstZip);
string export = CurBuilderData.ProjectExportPath;
if (string.IsNullOrEmpty(export))
export = $"{FileSystem.BuildPath}/{(CurBuilderData.platform).ToString()}/{applicationName}";
BuildReport result = BuildPipeline.BuildPlayer(new string[] { EditorBuildSettings.scenes[0].path },
export, target, options);
switch (result.summary.result)
{
case BuildResult.Unknown:
TLogger.LogInfo("Build Package FAIL! 未知错误!");
break;
case BuildResult.Succeeded:
TLogger.LogInfo("Build Package OK!");
break;
case BuildResult.Failed:
TLogger.LogInfo("Build Package FAIL!");
break;
case BuildResult.Cancelled:
TLogger.LogInfo("Build Package Cancelled!");
break;
default:
throw new ArgumentOutOfRangeException();
}
if (Application.isBatchMode && result.summary.result != BuildResult.Succeeded)
{
Process.GetCurrentProcess().Kill();
}
BuilderInjectorHandler(BuilderInjectorMoment.AfterBuild_Apk);
Debug.Log("一键打包总耗时:" + (DateTime.Now - buildStart).TotalMinutes.ToString("F2") + " 分钟");
}
/// <summary> /// <summary>
/// 输出apk或安卓工程 /// 输出apk或安卓工程
/// </summary> /// </summary>
@@ -211,6 +309,7 @@ namespace TEngineCore.Editor
TLogger.LogError("未设置BuilderData请先调用接口SetBuilderConfig"); TLogger.LogError("未设置BuilderData请先调用接口SetBuilderConfig");
return; return;
} }
CurBuilderData.ApplyArgs(""); CurBuilderData.ApplyArgs("");
PlayerSettings.productName = CurBuilderData.productName; PlayerSettings.productName = CurBuilderData.productName;
@@ -289,7 +388,6 @@ namespace TEngineCore.Editor
} }
BuilderInjectorHandler(BuilderInjectorMoment.AfterBuild_Apk); BuilderInjectorHandler(BuilderInjectorMoment.AfterBuild_Apk);
} }
@@ -307,6 +405,7 @@ namespace TEngineCore.Editor
{ {
assemblies.Add(Assembly.LoadFrom(assembly.outputPath)); assemblies.Add(Assembly.LoadFrom(assembly.outputPath));
} }
foreach (var assembly in assemblies) foreach (var assembly in assemblies)
{ {
var types = assembly.GetTypes(); var types = assembly.GetTypes();
@@ -345,6 +444,7 @@ namespace TEngineCore.Editor
var obj = Activator.CreateInstance(type); var obj = Activator.CreateInstance(type);
method.Invoke(obj, null); method.Invoke(obj, null);
} }
Debug.Log($"已完成执行插入方法:{method.Name}"); Debug.Log($"已完成执行插入方法:{method.Name}");
} }
} }
@@ -455,7 +555,10 @@ namespace TEngineCore.Editor
} }
} }
string[] dirList = { $"{Environment.CurrentDirectory}/Library/il2cpp_android_armeabi-v7a/il2cpp_cache", $"{Environment.CurrentDirectory}/Library/il2cpp_android_arm64-v8a/il2cpp_cache" }; string[] dirList =
{
$"{Environment.CurrentDirectory}/Library/il2cpp_android_armeabi-v7a/il2cpp_cache", $"{Environment.CurrentDirectory}/Library/il2cpp_android_arm64-v8a/il2cpp_cache"
};
foreach (var dir in dirList) foreach (var dir in dirList)
{ {
if (Directory.Exists(dir)) if (Directory.Exists(dir))

View File

@@ -1,6 +1,8 @@
using System; using System;
using System.IO;
using TEngine.Runtime; using TEngine.Runtime;
using UnityEditor; using UnityEditor;
using UnityEngine;
namespace TEngine.Editor namespace TEngine.Editor
{ {
@@ -74,8 +76,27 @@ namespace TEngine.Editor
public static class CusInjectorDemoEditor public static class CusInjectorDemoEditor
{ {
[TEngineBuilderInjector(BuilderInjectorMoment.BeforeCollect_AssetBundle)]
public static void CopyVersion()
{
var innerVersionFile = UnityEngine.Application.streamingAssetsPath + "/TEngine/version.json";
string path = FileSystem.ResourceRoot + "/" + GameConfig.CONFIG;
if (System.IO.File.Exists(innerVersionFile))
{
FileUtil.DeleteFileOrDirectory(innerVersionFile);
FileUtil.CopyFileOrDirectory(path, innerVersionFile);
}
else
{
FileUtil.CopyFileOrDirectory(path, innerVersionFile);
}
Log.Debug("复制版本信息成功");
}
[TEngineBuilderInjector(BuilderInjectorMoment.AfterBuild_AssetBundle)] [TEngineBuilderInjector(BuilderInjectorMoment.AfterBuild_AssetBundle)]
public static void TestInjector() public static void GenMd5List()
{ {
UnityEngine.Debug.Log($"productName: {PlayerSettings.productName}"); UnityEngine.Debug.Log($"productName: {PlayerSettings.productName}");
UnityEngine.Debug.Log($"version:{GameConfig.Instance.GameBundleVersion}"); UnityEngine.Debug.Log($"version:{GameConfig.Instance.GameBundleVersion}");
@@ -83,6 +104,7 @@ namespace TEngine.Editor
long versionLong = long.Parse(versionStr); long versionLong = long.Parse(versionStr);
UnityEngine.Debug.Log($"versionStr:{versionStr}"); UnityEngine.Debug.Log($"versionStr:{versionStr}");
UnityEngine.Debug.LogError("BuilderInjectorMoment.AfterBuild_AssetBundle"); UnityEngine.Debug.LogError("BuilderInjectorMoment.AfterBuild_AssetBundle");
TEngineCore.Editor.TEngineEditorUtil.GenMd5List();
} }
} }
} }

View File

@@ -1,11 +1,14 @@
using System; using System;
using System.Diagnostics;
using System.IO; using System.IO;
using TEngine; using TEngine;
using TEngine.Editor; using TEngine.Editor;
using TEngine.Runtime; using TEngine.Runtime;
using UnityEditor; using UnityEditor;
using UnityEditor.Build.Reporting;
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization; using UnityEngine.Serialization;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object; using Object = UnityEngine.Object;
using Type = System.Type; using Type = System.Type;
@@ -110,7 +113,7 @@ namespace TEngineCore.Editor
[FormerlySerializedAs("_scriptingBackend")] [FormerlySerializedAs("_scriptingBackend")]
[SerializeField] [SerializeField]
[BuilderEditor("编译类型", ContentType.Enum, "FlowA:disPlayType:1&platform:0r1r2,CB:SwitchScriptingBackend")] [BuilderEditor("编译类型", ContentType.Enum, "FlowA:disPlayType:1&platform:0r1r2,CB:SwitchScriptingBackend")]
internal BuilderUtility.ScriptBackend scriptingBackend = BuilderUtility.ScriptBackend.Mono; internal BuilderUtility.ScriptBackend scriptingBackend = BuilderUtility.ScriptBackend.IL2CPP;
#endregion #endregion
@@ -215,7 +218,7 @@ namespace TEngineCore.Editor
[FormerlySerializedAs("_ABVersion")] [FormerlySerializedAs("_ABVersion")]
[SerializeField] [SerializeField]
[BuilderEditor("资源版本号", ContentType.TextField, "FlowA:disPlayType:1,CB:ChangeABVersion")] [BuilderEditor("内部资源版本号", ContentType.TextField, "FlowA:disPlayType:1,CB:ChangeABVersion")]
internal string ABVersion = "0"; internal string ABVersion = "0";
[BuilderEditor("15", ContentType.Space)] [BuilderEditor("15", ContentType.Space)]
@@ -233,10 +236,10 @@ namespace TEngineCore.Editor
[BuilderEditor("Gen Md5(生成MD5)", ContentType.Button, ",CB:GenMd5,FlowA:disPlayType:1")] [BuilderEditor("Gen Md5(生成MD5)", ContentType.Button, ",CB:GenMd5,FlowA:disPlayType:1")]
private int genMd5; private int genMd5;
[BuilderEditor("Build", ContentType.Button, "CB:BuildApk")] [BuilderEditor("Build", ContentType.Button, "CB:BuildActive")]
private int build; private int build;
[BuilderEditor("直接出包跳过ab环节", ContentType.Button, "CB:DirectBuildApk,FlowA:disPlayType:1")] [BuilderEditor("直接出包跳过ab环节", ContentType.Button, "CB:DirectBuild,FlowA:disPlayType:1")]
private int directBuild; private int directBuild;
#endregion #endregion
@@ -462,6 +465,7 @@ namespace TEngineCore.Editor
if (!autoUdate) if (!autoUdate)
return; return;
PlayerSettings.bundleVersion = args; PlayerSettings.bundleVersion = args;
GameConfig.Instance.WriteAppVersion(args);
} }
/// <summary> /// <summary>
@@ -472,6 +476,7 @@ namespace TEngineCore.Editor
{ {
if (!autoUdate) if (!autoUdate)
return; return;
GameConfig.Instance.WriteBaseResVersion(args);
GameConfig.Instance.WriteResVersion(args); GameConfig.Instance.WriteResVersion(args);
} }
@@ -702,28 +707,21 @@ namespace TEngineCore.Editor
GUIUtility.ExitGUI(); GUIUtility.ExitGUI();
} }
private void BuildApk(string args) private void BuildActive(string args)
{ {
if (EditorApplication.isCompiling) if (EditorApplication.isCompiling)
{ {
EditorUtility.DisplayDialog("Build Apk", "请等待编译完成", "ok"); EditorUtility.DisplayDialog("Build Active", "请等待编译完成", "ok");
return; return;
} }
Save(); Save();
if (bundleVersion.Split('.').Length != 2)
{
Debug.LogError("版本号需要两位(*.*");
return;
}
if (buildType == (BuilderUtility.BuildType)BuilderUtility.BuildType.Editor) if (buildType == (BuilderUtility.BuildType)BuilderUtility.BuildType.Editor)
{ {
Debug.LogError("编辑器模式不支持打包,请看描述"); Debug.LogError("编辑器模式不支持打包,请看描述");
} }
else else
{ {
if (!BuilderUtility.PolicyEasyCheck(builderBundlePolicy, bundleConfig)) if (!BuilderUtility.PolicyEasyCheck(builderBundlePolicy, bundleConfig))
{ {
if (!EditorUtility.DisplayDialog("资源检查警告", "发现策略未覆盖到的资源,是否继续", "继续", "退出打包")) if (!EditorUtility.DisplayDialog("资源检查警告", "发现策略未覆盖到的资源,是否继续", "继续", "退出打包"))
@@ -734,7 +732,8 @@ namespace TEngineCore.Editor
ApplyArgs(""); ApplyArgs("");
Builder.Instance.SetBuilderConfig(this); Builder.Instance.SetBuilderConfig(this);
Builder.Instance.Build(false); Builder.Instance.BuildActive(false);
} }
@@ -742,25 +741,19 @@ namespace TEngineCore.Editor
} }
/// <summary> /// <summary>
/// 直接打APK /// 直接打包
/// </summary> /// </summary>
/// <param name="args"></param> /// <param name="args"></param>
private void DirectBuildApk(string args) private void DirectBuild(string args)
{ {
if (EditorApplication.isCompiling) if (EditorApplication.isCompiling)
{ {
EditorUtility.DisplayDialog("Direct Build Apk", "请等待编译完成", "ok"); EditorUtility.DisplayDialog("Direct Build", "请等待编译完成", "ok");
return; return;
} }
Save(); Save();
if (bundleVersion.Split('.').Length != 2)
{
Debug.LogError("版本号需要两位(*.*");
return;
}
if (buildType == (BuilderUtility.BuildType)BuilderUtility.BuildType.Editor) if (buildType == (BuilderUtility.BuildType)BuilderUtility.BuildType.Editor)
{ {
Debug.LogError("编辑器模式不支持打包,请看描述"); Debug.LogError("编辑器模式不支持打包,请看描述");
@@ -775,7 +768,7 @@ namespace TEngineCore.Editor
ApplyArgs(""); ApplyArgs("");
Builder.Instance.SetBuilderConfig(this); Builder.Instance.SetBuilderConfig(this);
Builder.Instance.Build(true); Builder.Instance.BuildActive(true);
} }
GUIUtility.ExitGUI(); GUIUtility.ExitGUI();

View File

@@ -35,6 +35,7 @@ namespace TEngine.Runtime
public void Load() public void Load()
{ {
#if ASSETBUNDLE_ENABLE #if ASSETBUNDLE_ENABLE
Log.Debug("AssetBundleData ASSETBUNDLE_ENABLE Mode");
Stream stream = FileSystem.OpenRead(FileSystem.GetAssetBundlePathInVersion(AssetBundleMeta)); Stream stream = FileSystem.OpenRead(FileSystem.GetAssetBundlePathInVersion(AssetBundleMeta));
BinaryReader reader = new BinaryReader(stream); BinaryReader reader = new BinaryReader(stream);
uint resVersion = reader.ReadUInt32(); uint resVersion = reader.ReadUInt32();
@@ -56,7 +57,6 @@ namespace TEngine.Runtime
{ {
assetPaths[j] = reader.ReadString(); assetPaths[j] = reader.ReadString();
_assetPath2BundleDatas.Add(assetPaths[j], bundleName); _assetPath2BundleDatas.Add(assetPaths[j], bundleName);
Log.Error($"Init Ab {assetPaths[j]} bundleName {bundleName}");
} }
depCount = reader.ReadInt32(); depCount = reader.ReadInt32();
if (!_bundleDatas.TryGetValue(bundleName, out assetBundleData)) if (!_bundleDatas.TryGetValue(bundleName, out assetBundleData))
@@ -85,6 +85,8 @@ namespace TEngine.Runtime
} }
} }
stream.Close(); stream.Close();
#else
Log.Debug("AssetBundleData Editor Mode");
#endif #endif
} }

View File

@@ -5,6 +5,11 @@ namespace TEngine.Runtime
{ {
public class DefaultResourceHelper : ResourceHelperBase public class DefaultResourceHelper : ResourceHelperBase
{ {
private void Start()
{
ResMgr.Instance.Active();
}
public override GameObject Load(string path) public override GameObject Load(string path)
{ {
return ResMgr.Instance.Load(path); return ResMgr.Instance.Load(path);

View File

@@ -9,6 +9,7 @@ namespace TEngine.Runtime
public class TResources public class TResources
{ {
private static IResourceHelper m_ResourceHelper; private static IResourceHelper m_ResourceHelper;
public static bool Initalize => m_ResourceHelper != null;
/// <summary> /// <summary>
/// 设置游戏资源加载辅助器。 /// 设置游戏资源加载辅助器。

View File

@@ -236,6 +236,24 @@ namespace TEngine.Runtime
return InitAppVersionInfo(); return InitAppVersionInfo();
} }
/// <summary>
/// 写入App版本号
/// </summary>
/// <param name="appVersion"></param>
public void WriteAppVersion(string appVersion)
{
if (string.IsNullOrEmpty(appVersion))
{
TLogger.LogWarning("ResVersion is null or empty,please check!");
return;
}
_versionConfig.AppVersion = appVersion;
UpdateConfig();
SetLoadFilePath(FileSystem.ResourceRoot, ResId);
TLogger.LogInfo("GameConfig,WriteVersion to sdk:" + GameConfig.Instance.GameBundleVersion);
}
/// <summary> /// <summary>
/// 写入App内部资源版本号 /// 写入App内部资源版本号
/// </summary> /// </summary>

View File

@@ -73,8 +73,6 @@ namespace TEngine.Runtime
{ {
base.OnEnter(procedureOwner); base.OnEnter(procedureOwner);
LoadJobManager.Instance.LoadSceneAsync("L2Scene");
m_procedureOwner = procedureOwner; m_procedureOwner = procedureOwner;
if (!NeedLoadDll) if (!NeedLoadDll)

View File

@@ -13,7 +13,7 @@ namespace TEngine.Runtime
protected internal override void OnEnter(IFsm<IProcedureManager> procedureOwner) protected internal override void OnEnter(IFsm<IProcedureManager> procedureOwner)
{ {
ResMgr.Instance.Active();
base.OnEnter(procedureOwner); base.OnEnter(procedureOwner);
GameEvent.AddEventListener(OnInitResourceCompleteEvent, OnInitResourceComplete); GameEvent.AddEventListener(OnInitResourceCompleteEvent, OnInitResourceComplete);
m_initResourceComplete = false; m_initResourceComplete = false;

View File

@@ -1,7 +1,7 @@
{ {
"GameVersion": "0.1.0", "GameVersion": "0.1.0",
"InternalGameVersion": 0, "InternalGameVersion": 0,
"CheckVersionUrl": "http://1.12.241.46:8081/TEngine/Demo/{0}Version.txt", "CheckVersionUrl": "http://127.0.0.1:8081/TEngine/Demo/{0}Version.txt",
"WindowsAppUrl": "https://www.game.com", "WindowsAppUrl": "https://www.game.com",
"MacOSAppUrl": "https://www.game.com", "MacOSAppUrl": "https://www.game.com",
"IOSAppUrl": "https://www.game.com", "IOSAppUrl": "https://www.game.com",

View File

@@ -31,6 +31,8 @@ namespace TEngine.Runtime.HotUpdate
_path = path; _path = path;
_md5 = md5; _md5 = md5;
_path = path + "_md5_" + md5;
var dirPath = Path.GetDirectoryName(_path); var dirPath = Path.GetDirectoryName(_path);
if (dirPath != null) if (dirPath != null)
{ {

View File

@@ -119,7 +119,7 @@ namespace TEngine.Runtime.HotUpdate
bool _DealWithDownLoadOk(DownLoadResult downloadType, BackgroundDownloadStatus status, LoadResource data) bool _DealWithDownLoadOk(DownLoadResult downloadType, BackgroundDownloadStatus status, LoadResource data)
{ {
string fileLocalPath = _path + data.Url; string fileLocalPath = _path + data.Url + "_md5_" + data.Md5;
if (status == BackgroundDownloadStatus.NetworkError) if (status == BackgroundDownloadStatus.NetworkError)
{ {

View File

@@ -81,6 +81,11 @@ namespace TEngine.Runtime.HotUpdate
_uiMap.Add(uiinfo, compenent); _uiMap.Add(uiinfo, compenent);
} }
} }
if (_uiMap[uiinfo] == null || _uiMap[uiinfo].gameObject == null)
{
return;
}
_uiMap[uiinfo].gameObject.SetActive(true); _uiMap[uiinfo].gameObject.SetActive(true);
if (param != null) if (param != null)
{ {

View File

@@ -2,7 +2,8 @@
"name": "TEngine.Runtime", "name": "TEngine.Runtime",
"rootNamespace": "", "rootNamespace": "",
"references": [ "references": [
"GUID:13ba8ce62aa80c74598530029cb2d649" "GUID:13ba8ce62aa80c74598530029cb2d649",
"GUID:88d491a7059d6f24393c76d9a4cbf684"
], ],
"includePlatforms": [], "includePlatforms": [],
"excludePlatforms": [], "excludePlatforms": [],