mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
更新优化启用UpdateData时UILoadUpdate时序的问题
更新优化启用UpdateData时UILoadUpdate时序的问题
This commit is contained in:
@@ -38,10 +38,15 @@ namespace GameMain
|
||||
m_btnClear.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public override void RegisterEvent()
|
||||
{
|
||||
base.RegisterEvent();
|
||||
AddUIEvent(RuntimeId.ToRuntimeId("RefreshVersion"),RefreshVersion);
|
||||
}
|
||||
|
||||
public override void OnRefresh()
|
||||
{
|
||||
base.OnRefresh();
|
||||
RefreshVersion();
|
||||
}
|
||||
|
||||
#region 事件
|
||||
|
@@ -60,8 +60,8 @@ namespace GameMain
|
||||
{
|
||||
//热更新阶段文本初始化
|
||||
LoadText.Instance.InitConfigData(null);
|
||||
//热更新UI初始化
|
||||
UILoadMgr.Initialize();
|
||||
|
||||
GameEvent.Send(RuntimeId.ToRuntimeId("RefreshVersion"));
|
||||
|
||||
EPlayMode playMode = GameModule.Resource.PlayMode;
|
||||
|
||||
|
@@ -15,6 +15,9 @@ namespace GameMain
|
||||
{
|
||||
base.OnEnter(procedureOwner);
|
||||
|
||||
//热更新UI初始化
|
||||
UILoadMgr.Initialize();
|
||||
|
||||
// 语言配置:设置当前使用的语言,如果不设置,则默认使用操作系统语言
|
||||
InitLanguageSettings();
|
||||
|
||||
|
@@ -22,7 +22,7 @@ namespace GameMain
|
||||
|
||||
base.OnEnter(procedureOwner);
|
||||
|
||||
UILoadMgr.Show(UIDefine.UILoadUpdate,$"更新静态版本文件...");
|
||||
UILoadMgr.Show(UIDefine.UILoadUpdate, $"更新静态版本文件...");
|
||||
|
||||
//检查设备是否能够访问互联网
|
||||
if (Application.internetReachability == NetworkReachability.NotReachable)
|
||||
@@ -34,6 +34,7 @@ namespace GameMain
|
||||
GetStaticVersion().Forget,
|
||||
() => { ChangeState<ProcedureInitResources>(procedureOwner); });
|
||||
}
|
||||
|
||||
UILoadMgr.Show(UIDefine.UILoadUpdate, LoadText.Instance.Label_RequestVersionIng);
|
||||
|
||||
// 用户尝试更新静态版本。
|
||||
@@ -49,6 +50,8 @@ namespace GameMain
|
||||
|
||||
var operation = GameModule.Resource.UpdatePackageVersionAsync();
|
||||
|
||||
try
|
||||
{
|
||||
await operation.ToUniTask();
|
||||
|
||||
if (operation.Status == EOperationStatus.Succeed)
|
||||
@@ -60,12 +63,22 @@ namespace GameMain
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error(operation.Error);
|
||||
OnGetStaticVersionError(operation.Error);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
OnGetStaticVersionError(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
UILoadTip.ShowMessageBox($"用户尝试更新静态版本失败!点击确认重试 \n \n <color=#FF0000>原因{operation.Error}</color>", MessageShowType.TwoButton,
|
||||
private void OnGetStaticVersionError(string error)
|
||||
{
|
||||
Log.Error(error);
|
||||
|
||||
UILoadTip.ShowMessageBox($"用户尝试更新静态版本失败!点击确认重试 \n \n <color=#FF0000>原因{error}</color>", MessageShowType.TwoButton,
|
||||
LoadStyle.StyleEnum.Style_Retry
|
||||
, () => { ChangeState<ProcedureUpdateVersion>(_procedureOwner); }, UnityEngine.Application.Quit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -232,20 +232,10 @@ namespace TEngine
|
||||
return;
|
||||
}
|
||||
|
||||
_entity = new GameObject("[Unity.Utility]")
|
||||
{
|
||||
// hideFlags = HideFlags.HideAndDontSave
|
||||
};
|
||||
_entity = new GameObject("[Unity.Utility]");
|
||||
_entity.SetActive(true);
|
||||
_entity.transform.SetParent(GameModule.Base.transform);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (Application.isPlaying)
|
||||
#endif
|
||||
{
|
||||
Object.DontDestroyOnLoad(_entity);
|
||||
}
|
||||
|
||||
UnityEngine.Assertions.Assert.IsFalse(_behaviour);
|
||||
_behaviour = _entity.AddComponent<MainBehaviour>();
|
||||
}
|
||||
|
Reference in New Issue
Block a user