Update HotUpdate

Update HotUpdate
This commit is contained in:
ALEXTANG
2022-08-05 11:16:15 +08:00
parent 7b57738b70
commit b5acd02c0c
4 changed files with 23 additions and 7 deletions

View File

@@ -170,7 +170,7 @@ MonoBehaviour:
m_SelectOnRight: {fileID: 0} m_SelectOnRight: {fileID: 0}
m_Transition: 1 m_Transition: 1
m_Colors: m_Colors:
m_NormalColor: {r: 1, g: 0.90310204, b: 0, a: 1} m_NormalColor: {r: 0.9716981, g: 0, b: 0.12772757, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}

View File

@@ -9,9 +9,11 @@ namespace TEngine
{ {
public class Launcher:MonoBehaviour public class Launcher:MonoBehaviour
{ {
void Start() void Start()
{ {
TLogger.Instance.Active(); TLogger.Instance.Active();
LoadMgr.Instance.InitParam("http://1.12.241.46:8081/TXYXGame/",isTestUpdate:true);
LoadMgr.Instance.StartLoadInit(LaunchSuccess); LoadMgr.Instance.StartLoadInit(LaunchSuccess);
} }

View File

@@ -30,6 +30,8 @@ namespace TEngine
public class LoadMgr : TSingleton<LoadMgr> public class LoadMgr : TSingleton<LoadMgr>
{ {
private bool _isTestUpdate = false;
/// <summary> /// <summary>
/// 资源版本号 /// 资源版本号
/// </summary> /// </summary>
@@ -63,6 +65,12 @@ namespace TEngine
return _instance._loaderUpdateLaunched; return _instance._loaderUpdateLaunched;
} }
public void InitParam(string url,bool isTestUpdate = false)
{
Url = url;
_isTestUpdate = isTestUpdate;
}
public void StartLoadInit(Action onUpdateComplete) public void StartLoadInit(Action onUpdateComplete)
{ {
//热更新阶段文本初始化 //热更新阶段文本初始化
@@ -81,6 +89,11 @@ namespace TEngine
#if RELEASE_BUILD || _DEVELOPMENT_BUILD_ #if RELEASE_BUILD || _DEVELOPMENT_BUILD_
StartLoad(() => { FinishCallBack(onUpdateComplete); }); StartLoad(() => { FinishCallBack(onUpdateComplete); });
#else #else
if (_isTestUpdate)
{
StartLoad(() => { FinishCallBack(onUpdateComplete); });
return;
}
onUpdateComplete?.Invoke(); onUpdateComplete?.Invoke();
#endif #endif
} }
@@ -139,7 +152,7 @@ namespace TEngine
} }
UILoadMgr.Show(UIDefine.UILoadUpdate, string.Format(LoadText.Instance.Label_Load_Checking, _curTryCount)); UILoadMgr.Show(UIDefine.UILoadUpdate, string.Format(LoadText.Instance.Label_Load_Checking, _curTryCount));
if (string.IsNullOrEmpty(OnlineParamUrl)) if (string.IsNullOrEmpty(Url) || string.IsNullOrEmpty(OnlineParamUrl))
{ {
TLogger.LogError("LoadMgr.RequestVersion, remote url is empty or null"); TLogger.LogError("LoadMgr.RequestVersion, remote url is empty or null");
LoaderUtilities.ShowMessageBox(LoadText.Instance.Label_RemoteUrlisNull, MessageShowType.OneButton, LoaderUtilities.ShowMessageBox(LoadText.Instance.Label_RemoteUrlisNull, MessageShowType.OneButton,
@@ -511,7 +524,7 @@ namespace TEngine
private string _resListUrl = string.Empty; private string _resListUrl = string.Empty;
private string _onlineParamUrl = string.Empty; private string _onlineParamUrl = string.Empty;
internal const string Url = "http://1.12.241.46:8081/TXYXGame/"; internal string Url = string.Empty;
internal string ResListUrl internal string ResListUrl
{ {

View File

@@ -39,7 +39,7 @@ namespace TEngine.UI
public string Label_DownLoadFailed = "网络太慢,是否继续下载"; public string Label_DownLoadFailed = "网络太慢,是否继续下载";
public string Label_ClearConfig = "清除环境配置,需要重启应用"; public string Label_ClearConfig = "清除环境配置,需要重启应用";
public string Label_RegionInfoIllegal = "区服信息为空"; public string Label_RegionInfoIllegal = "区服信息为空";
public string Label_RemoteUrlisNull = "热更新服地址为空"; public string Label_RemoteUrlisNull = "热更地址为空";
public string Label_FirstPackageNotFound = "首包资源加载失败"; public string Label_FirstPackageNotFound = "首包资源加载失败";
public string Label_RequestReginInfo = "正在请求区服信息{0}次"; public string Label_RequestReginInfo = "正在请求区服信息{0}次";
public string Label_RequestTimeOut = "请求区服信息超时,是否重试?"; public string Label_RequestTimeOut = "请求区服信息超时,是否重试?";
@@ -68,7 +68,8 @@ namespace TEngine.UI
{ {
private static LoadText _instance; private static LoadText _instance;
public static LoadText Instance { public static LoadText Instance
{
get { return _instance ?? (_instance = new LoadText()); } get { return _instance ?? (_instance = new LoadText()); }
} }