TEngine 6

This commit is contained in:
Alex-Rachel
2025-03-07 23:09:46 +08:00
parent aad8ff3ee5
commit 551727687f
1988 changed files with 46223 additions and 94880 deletions

View File

@@ -0,0 +1,224 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Launcher
{
/// <summary>
/// 热更界面加载管理器。
/// </summary>
public static class LauncherMgr
{
private static Transform _uiRoot;
private static readonly Dictionary<string, string> _uiList = new Dictionary<string, string>();
private static readonly Dictionary<string, UIBase> _uiMap = new Dictionary<string, UIBase>();
/// <summary>
/// 初始化根节点。
/// </summary>
public static void Initialize()
{
_uiRoot = GameObject.Find("UIRoot/UICanvas")?.transform;
if (_uiRoot == null)
{
Debug.LogError("Failed to Find UIRoot. Please check the resource path");
return;
}
RegisterUI();
}
public static void RegisterUI()
{
UIDefine.RegisterUI(_uiList);
}
/// <summary>
/// show ui
/// </summary>
/// <param name="uiInfo">对应的ui的名称。</param>
/// <param name="param">参数。</param>
public static void Show(string uiInfo, object param = null)
{
if (string.IsNullOrEmpty(uiInfo))
{
return;
}
if (!_uiList.ContainsKey(uiInfo))
{
Debug.LogError($"not define ui:{uiInfo}");
return;
}
GameObject ui = null;
if (!_uiMap.ContainsKey(uiInfo))
{
Object obj = Resources.Load(_uiList[uiInfo]);
if (obj != null)
{
ui = Object.Instantiate(obj) as GameObject;
if (ui != null)
{
ui.transform.SetParent(_uiRoot.transform);
ui.transform.localScale = Vector3.one;
ui.transform.localPosition = Vector3.zero;
RectTransform rect = ui.GetComponent<RectTransform>();
rect.sizeDelta = Vector2.zero;
}
}
UIBase component = ui.GetComponent<UIBase>();
if (component != null)
{
_uiMap.Add(uiInfo, component);
}
}
_uiMap[uiInfo].gameObject.SetActive(true);
if (param != null)
{
UIBase component = _uiMap[uiInfo].GetComponent<UIBase>();
if (component != null)
{
component.OnEnter(param);
}
}
}
/// <summary>
/// 隐藏ui对象。
/// </summary>
/// <param name="uiName">对应的ui的名称。</param>
public static void Hide(string uiName)
{
if (string.IsNullOrEmpty(uiName))
{
return;
}
if (!_uiMap.TryGetValue(uiName, out var ui))
{
return;
}
ui.gameObject.SetActive(false);
Object.DestroyImmediate(_uiMap[uiName].gameObject);
_uiMap.Remove(uiName);
}
/// <summary>
/// 获取显示的ui对象。
/// </summary>
/// <param name="uiName">对应的ui的名称。</param>
/// <returns></returns>
public static UIBase GetActiveUI(string uiName)
{
return _uiMap.GetValueOrDefault(uiName);
}
/// <summary>
/// 隐藏所有热更相关UI。
/// </summary>
public static void HideAll()
{
foreach (var item in _uiMap)
{
if (item.Value && item.Value.gameObject)
{
Object.Destroy(item.Value.gameObject);
}
}
_uiMap.Clear();
}
#region
/// <summary>
/// 显示提示框,目前最多支持三个按钮
/// </summary>
/// <param name="desc">描述</param>
/// <param name="showtype">类型MessageShowType</param>
/// <param name="style">StyleEnum</param>
/// <param name="onOk">点击事件</param>
/// <param name="onCancel">取消事件</param>
/// <param name="onPackage">更新事件</param>
public static void ShowMessageBox(string desc, MessageShowType showtype = MessageShowType.OneButton,
LoadStyle.StyleEnum style = LoadStyle.StyleEnum.Style_Default,
Action onOk = null,
Action onCancel = null,
Action onPackage = null)
{
LauncherMgr.Show(UIDefine.UILoadTip, desc);
var ui = LauncherMgr.GetActiveUI(UIDefine.UILoadTip) as UILoadTip;
if (ui == null)
{
return;
}
ui.OnOk = onOk;
ui.OnCancel = onCancel;
ui.Showtype = showtype;
ui.OnEnter(desc);
var loadStyleUI = ui.GetComponent<LoadStyle>();
if (loadStyleUI)
{
loadStyleUI.SetStyle(style);
}
}
/// <summary>
/// 刷新UI版本号。
/// </summary>
/// <param name="appId">AppID。</param>
/// <param name="resId">资源ID。</param>
public static void RefreshVersion(string appId, string resId)
{
LauncherMgr.Show(UIDefine.UILoadUpdate);
var ui = LauncherMgr.GetActiveUI(UIDefine.UILoadUpdate) as UILoadUpdate;
if (ui == null)
{
return;
}
ui.OnRefreshVersion(appId, resId);
}
/// <summary>
/// 更新UI文本。
/// </summary>
/// <param name="label">文本ID。</param>
public static void UpdateUILabel(string label)
{
LauncherMgr.Show(UIDefine.UILoadUpdate);
var ui = LauncherMgr.GetActiveUI(UIDefine.UILoadUpdate) as UILoadUpdate;
if (ui == null)
{
return;
}
ui.OnEnter(label);
}
/// <summary>
/// 更新UI进度。
/// </summary>
/// <param name="progress">当前进度。</param>
public static void UpdateUIProgress(float progress)
{
LauncherMgr.Show(UIDefine.UILoadUpdate);
var ui = LauncherMgr.GetActiveUI(UIDefine.UILoadUpdate) as UILoadUpdate;
if (ui == null)
{
return;
}
ui.OnUpdateUIProgress(progress);
}
#endregion
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6381a0f5db6b61948a8fcb8176d8019b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,187 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
namespace Launcher
{
#pragma warning disable CS0649
public class LoadStyle : MonoBehaviour
{
public Button _btn_ignore;
public Button _btn_update;
public Button _btn_package;
public Text _label_ignore;
public Text _label_update;
public Text _label_package;
private Dictionary<StyleEnum, Dictionary<BtnEnum, StyleItem>> loadConfig;
private const string ConfigPath = "RawBytes/UIStyle/Style.json";
public enum StyleEnum
{
Style_Default = 0, //默认
Style_QuitApp = 1, //退出应用
Style_RestartApp = 2, //重启应用
Style_Retry = 3, //重试
Style_StartUpdate_Notice = 4, //提示更新
Style_DownLoadApk = 5, //下载底包
Style_Clear = 6, //修复客户端
Style_DownZip = 7, //继续下载压缩包
}
public enum BtnEnum
{
BtnOK = 0, //确定按钮
BtnIgnore = 1, //取消按钮
BtnOther = 2, //其他按钮
}
/// <summary>
/// 单个按钮的样式
/// </summary>
private class StyleItem
{
public Alignment Align; //对其方式
public bool Show; //是否隐藏
public string Desc; //按钮描述
}
/// <summary>
/// 对齐方式
/// </summary>
private enum Alignment
{
Left = 0,
Middle = 1,
Right = 2
}
private void Awake()
{
//设置按钮的默认描述
_label_ignore.text = LoadText.Instance.Label_Btn_Ignore;
_label_update.text = LoadText.Instance.Label_Btn_Update;
_label_package.text = LoadText.Instance.Label_Btn_Package;
InitConfig();
}
private void InitConfig()
{
// string url = AssetUtility.Config.GetConfigAsset(ConfigPath);
// if (!String.IsNullOrEmpty(url))
// {
// string finalPath = SetFilePath(url);
// InitConfigDic(finalPath);
// }
}
#region
private string SetFilePath(string path)
{
#if UNITY_ANDROID
if (path.StartsWith(Application.persistentDataPath))
path = $"file://{path}";
#elif UNITY_IOS
if (path.StartsWith(Application.persistentDataPath)||path.StartsWith(Application.streamingAssetsPath))
path = $"file://{path}";
#endif
return path;
}
private void InitConfigDic(string path)
{
UnityWebRequest www = UnityWebRequest.Get(path);
UnityWebRequestAsyncOperation request = www.SendWebRequest();
while (!request.isDone)
{
}
if (!String.IsNullOrEmpty(www.downloadHandler.text))
{
loadConfig = JsonUtility.FromJson<Dictionary<StyleEnum, Dictionary<BtnEnum, StyleItem>>>(www.downloadHandler.text);
// loadConfig = JsonConvert.DeserializeObject<Dictionary<StyleEnum, Dictionary<BtnEnum, StyleItem>>>(www.downloadHandler.text);
}
www.Dispose();
}
#endregion
/// <summary>
/// 设置样式
/// </summary>
/// <param name="type">样式对应的id</param>
public void SetStyle(StyleEnum type)
{
if (type == StyleEnum.Style_Default)
return;
if (loadConfig == null)
{
Debug.LogError("LoadConfig is null");
return;
}
var style = loadConfig[type];
if (style == null)
{
Debug.LogError($"LoadConfig, Can not find type:{type},please check it");
return;
}
SetButtonStyle(style);
}
/// <summary>
/// 设置按钮的描述,是否隐藏
/// </summary>
private void SetButtonStyle(Dictionary<BtnEnum, StyleItem> list)
{
foreach (var item in list)
{
switch (item.Key)
{
case BtnEnum.BtnOK:
_label_update.text = item.Value.Desc;
_btn_update.gameObject.SetActive(item.Value.Show);
SetButtonPos(item.Value.Align, _btn_update.transform);
break;
case BtnEnum.BtnIgnore:
_label_ignore.text = item.Value.Desc;
_btn_ignore.gameObject.SetActive(item.Value.Show);
SetButtonPos(item.Value.Align, _btn_ignore.transform);
break;
case BtnEnum.BtnOther:
_label_package.text = item.Value.Desc;
_btn_package.gameObject.SetActive(item.Value.Show);
SetButtonPos(item.Value.Align, _btn_package.transform);
break;
}
}
}
/// <summary>
/// 设置按钮位置
/// </summary>
private void SetButtonPos(Alignment align, Transform item)
{
switch (align)
{
case Alignment.Left:
item.SetSiblingIndex(0);
break;
case Alignment.Middle:
item.SetSiblingIndex(1);
break;
case Alignment.Right:
item.SetSiblingIndex(2);
break;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c56a1db52fd64134881893a68f6e1371
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,141 @@
using UnityEngine;
namespace Launcher
{
public class TextMode
{
public string Label_Load_Progress = "正在下载资源文件,请耐心等待\n当前下载速度{0}/s 资源文件大小:{1}";
public string Label_Load_FirstUnpack = "首次进入游戏,正在初始化游戏资源...(此过程不消耗网络流量)";
public string Label_Load_Unpacking = "正在更新本地资源版本,请耐心等待...(此过程不消耗网络流量)";
public string Label_Load_Checking = "检测版本文件{0}...";
public string Label_Load_Checked = "最新版本检测完成";
public string Label_Load_Package = "当前使用的版本过低,请下载安装最新版本";
public string Label_Load_Plantform = "当前使用的版本过低,请前往应用商店安装最新版本";
public string Label_Load_Notice = "检测到可选资源更新,推荐完成更新提升游戏体验";
public string Label_Load_Force = "检测到版本更新,取消更新将导致无法进入游戏";
public string Label_Load_Force_WIFI =
"检测到有新的游戏内容需要更新,更新包大小<color=#BA3026>{0}</color>, 取消更新将导致无法进入游戏,您当前已为<color=#BA3026>wifi网络</color>,请开始更新";
public string Label_Load_Force_NO_WIFI =
"检测到有新的游戏内容需要更新,更新包大小<color=#BA3026>{0}</color>, 取消更新将导致无法进入游戏,请开始更新";
public string Label_Load_Error = "更新参数错误{0},请点击确定重新启动游戏";
public string Label_Load_FirstEntrerGame_Error = "首次进入游戏资源异常";
public string Label_Load_UnpackComplete = "正在加载最新资源文件...(此过程不消耗网络流量)";
public string Label_Load_UnPackError = "资源解压失败,请点击确定重新启动游戏";
public string Label_Load_Load_Progress = "正在载入...{0}%";
public string Label_Load_Download_Progress = "正在下载...{0}%";
public string Label_Load_Load_Complete = "载入完成";
public string Label_Load_Init = "初始化...";
public string Label_Net_UnReachable = "当前网络不可用,请检查本地网络设置后点击确认进行重试";
public string Label_Net_ReachableViaCarrierDataNetwork = "当前是移动网络,是否继续下载";
public string Label_Net_Error = "网络异常,请重试";
public string Label_Net_Changed = "网络切换,正在尝试重连,{0}次";
public string Label_Data_Empty = "数据异常";
public string Label_Memory_Low = "初始化资源加载失败,请检查本地内存是否充足";
public string Label_Memory_Low_Load = "内存是否充足,无法更新";
public string Label_Memory_UnZip_Low = "内存不足,无法解压";
public string Label_App_id = "游戏版本号:{0}";
public string Label_Res_id = "资源版本号:{0}";
public string Label_Clear_Comfirm = "是否清理本地资源?(清理完成后会关闭游戏且重新下载最新资源)";
public string Label_RestartApp = "本次更新需要重启应用,请点击确定重新启动游戏";
public string Label_DownLoadFailed = "网络太慢,是否继续下载";
public string Label_ClearConfig = "清除环境配置,需要重启应用";
public string Label_RegionInfoIllegal = "区服信息为空";
public string Label_RemoteUrlisNull = "热更地址为空";
public string Label_FirstPackageNotFound = "首包资源加载失败";
public string Label_RequestReginInfo = "正在请求区服信息{0}次";
public string Label_RequestTimeOut = "请求区服信息超时,是否重试?";
public string Label_Region_ArgumentError = "参数错误";
public string Label_Region_IndexOutOfRange = "索引越界";
public string Label_Region_NonConfigApplication = "未配置此应用";
public string Label_Region_SystemError = "系统异常";
public string Label_PreventionOfAddiction = "著作人权XX市TEngine有限公司 软著登记号2022SR0000000\n抵制不良游戏拒绝盗版游戏。注意自我保护谨防受骗上当。适度游戏益脑" +
"沉迷游戏伤身。合理安排时间,享受健康生活。";
public string Label_Btn_Update = "确定";
public string Label_Btn_Ignore = "取消";
public string Label_Btn_Package = "更新";
public string Label_Dlc_ConfigVerificateStage = "配置校验中...";
public string Label_Dlc_ConfigLoadingStage = "下载配置中...";
public string Label_Dlc_AssetsLoading = "下载资源中...";
public string Label_Dlc_LoadingFinish = "下载结束";
public string Label_Dlc_Load_Force_WIFI =
"检测到有新的游戏内容需要更新, 取消更新将导致无法进入游戏,您当前已为<color=#BA3026>wifi网络</color>,请开始更新";
public string Label_Dlc_Load_Force_NO_WIFI =
"检测到有新的游戏内容需要更新, 取消更新将导致无法进入游戏,请开始更新";
public string Label_Had_Update = "检测到有版本更新...";
public string Label_RequestVersionIng = "正在向服务器请求版本信息中...";
public string Label_RequestVersionInfo = "正在向服务器请求版本信息{0}次";
}
public class LoadText : TextMode
{
private static LoadText _instance;
public static LoadText Instance => _instance ??= new LoadText();
public void InitConfigData(TextAsset asset)
{
if (asset == null)
return;
TextMode loadConfig = JsonUtility.FromJson<TextMode>(asset.text);
if (loadConfig != null)
{
Label_Load_Progress = loadConfig.Label_Load_Progress;
Label_Load_FirstUnpack = loadConfig.Label_Load_FirstUnpack;
Label_Load_Unpacking = loadConfig.Label_Load_Unpacking;
Label_Load_Checking = loadConfig.Label_Load_Checking;
Label_Load_Checked = loadConfig.Label_Load_Checked;
Label_Load_Package = loadConfig.Label_Load_Package;
Label_Load_Plantform = loadConfig.Label_Load_Plantform;
Label_Load_Notice = loadConfig.Label_Load_Notice;
Label_Load_Force = loadConfig.Label_Load_Force;
Label_Load_Force_WIFI = loadConfig.Label_Load_Force_WIFI;
Label_Load_Force_NO_WIFI = loadConfig.Label_Load_Force_NO_WIFI;
Label_Load_Error = loadConfig.Label_Load_Error;
Label_Load_FirstEntrerGame_Error = loadConfig.Label_Load_FirstEntrerGame_Error;
Label_Load_UnpackComplete = loadConfig.Label_Load_UnpackComplete;
Label_Load_UnPackError = loadConfig.Label_Load_UnPackError;
Label_Load_Load_Progress = loadConfig.Label_Load_Load_Progress;
Label_Load_Download_Progress = loadConfig.Label_Load_Download_Progress;
Label_Load_Load_Complete = loadConfig.Label_Load_Load_Complete;
Label_Load_Init = loadConfig.Label_Load_Init;
Label_Net_UnReachable = loadConfig.Label_Net_UnReachable;
Label_Net_Error = loadConfig.Label_Net_Error;
Label_Net_Changed = loadConfig.Label_Net_Changed;
Label_Data_Empty = loadConfig.Label_Data_Empty;
Label_Memory_Low = loadConfig.Label_Memory_Low;
Label_Memory_Low_Load = loadConfig.Label_Memory_Low_Load;
Label_Memory_UnZip_Low = loadConfig.Label_Memory_UnZip_Low;
Label_App_id = loadConfig.Label_App_id;
Label_Res_id = loadConfig.Label_Res_id;
Label_Clear_Comfirm = loadConfig.Label_Clear_Comfirm;
Label_RestartApp = loadConfig.Label_RestartApp;
Label_DownLoadFailed = loadConfig.Label_DownLoadFailed;
Label_ClearConfig = loadConfig.Label_ClearConfig;
Label_PreventionOfAddiction = loadConfig.Label_PreventionOfAddiction;
Label_RegionInfoIllegal = loadConfig.Label_RegionInfoIllegal;
Label_RemoteUrlisNull = loadConfig.Label_RemoteUrlisNull;
Label_FirstPackageNotFound = loadConfig.Label_FirstPackageNotFound;
Label_RequestReginInfo = loadConfig.Label_RequestReginInfo;
Label_Net_ReachableViaCarrierDataNetwork = loadConfig.Label_Net_ReachableViaCarrierDataNetwork;
Label_RequestTimeOut = loadConfig.Label_RequestTimeOut;
Label_Region_ArgumentError = loadConfig.Label_Region_ArgumentError;
Label_Region_IndexOutOfRange = loadConfig.Label_Region_IndexOutOfRange;
Label_Region_NonConfigApplication = loadConfig.Label_Region_NonConfigApplication;
Label_Region_SystemError = loadConfig.Label_Region_SystemError;
Label_Btn_Ignore = loadConfig.Label_Btn_Ignore;
Label_Btn_Package = loadConfig.Label_Btn_Package;
Label_Btn_Update = loadConfig.Label_Btn_Update;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 26b25172848a83441b2cfadd771152ea
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,16 @@
using UnityEngine;
namespace Launcher
{
/// <summary>
/// 热更UI基类。
/// </summary>
public class UIBase : MonoBehaviour
{
protected object Param;
public virtual void OnEnter(object param)
{
Param = param;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b150d874e1db306419683d8fb8f50af4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,37 @@
using System.Collections.Generic;
using UnityEngine;
namespace Launcher
{
/// <summary>
/// 热更UI定义。
/// </summary>
public class UIDefine
{
public static readonly string UILoadUpdate = "UILoadUpdate";
public static readonly string UILoadTip = "UILoadTip";
/// <summary>
/// 注册ui
/// </summary>
/// <param name="list"></param>
public static void RegisterUI(Dictionary<string, string> list)
{
if (list == null)
{
Debug.LogError("[UIManager]list is null");
return;
}
if (!list.ContainsKey(UILoadUpdate))
{
list.Add(UILoadUpdate, $"AssetLoad/{UILoadUpdate}");
}
if (!list.ContainsKey(UILoadTip))
{
list.Add(UILoadTip, $"AssetLoad/{UILoadTip}");
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8b4a6ad67f754024987f55526fa21034
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,104 @@
using UnityEngine;
using UnityEngine.UI;
using System;
namespace Launcher
{
public enum MessageShowType
{
None = 0,
OneButton = 1,
TwoButton = 2,
ThreeButton = 3,
}
/// <summary>
/// UI更新加载提示。
/// </summary>
public class UILoadTip : UIBase
{
public Button _btn_update;
public Button _btn_ignore;
public Button _btn_package;
public Text _label_desc;
public Action OnOk;
public Action OnCancel;
public MessageShowType Showtype = MessageShowType.None;
void Start()
{
_btn_update.onClick.AddListener(OnGameUpdate);
_btn_ignore.onClick.AddListener(OnGameIgnore);
_btn_package.onClick.AddListener(OnInvoke);
}
public override void OnEnter(object data)
{
_btn_ignore.gameObject.SetActive(false);
_btn_package.gameObject.SetActive(false);
_btn_update.gameObject.SetActive(false);
switch (Showtype)
{
case MessageShowType.OneButton:
_btn_update.gameObject.SetActive(true);
break;
case MessageShowType.TwoButton:
_btn_update.gameObject.SetActive(true);
_btn_ignore.gameObject.SetActive(true);
break;
case MessageShowType.ThreeButton:
_btn_ignore.gameObject.SetActive(true);
_btn_package.gameObject.SetActive(true);
_btn_package.gameObject.SetActive(true);
break;
}
_label_desc.text = data.ToString();
}
private void OnGameUpdate()
{
if (OnOk == null)
{
_label_desc.text = "<color=#BA3026>该按钮不应该存在</color>";
}
else
{
OnOk();
_OnClose();
}
}
private void OnGameIgnore()
{
if (OnCancel == null)
{
_label_desc.text = "<color=#BA3026>该按钮不应该存在</color>";
}
else
{
OnCancel();
_OnClose();
}
}
private void OnInvoke()
{
if (OnOk == null)
{
_label_desc.text = "<color=#BA3026>该按钮不应该存在</color>";
}
else
{
OnOk();
_OnClose();
}
}
private void _OnClose()
{
LauncherMgr.Hide(UIDefine.UILoadTip);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1d32acf4f4a006a4986b0c39320a1a99
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,66 @@
using UnityEngine;
using UnityEngine.UI;
namespace Launcher
{
/// <summary>
/// UI更新界面。
/// </summary>
public class UILoadUpdate : UIBase
{
[SerializeField] public Button _btn_clear;
[SerializeField] public Scrollbar _obj_progress;
[SerializeField] public Text _label_desc;
[SerializeField] public Text _label_appid;
[SerializeField] public Text _label_resid;
public virtual void Start()
{
_btn_clear.onClick.AddListener(OnClear);
_btn_clear.gameObject.SetActive(true);
OnUpdateUIProgress(0f);
}
public override void OnEnter(object param)
{
if (param == null)
{
return;
}
base.OnEnter(param);
_label_desc.text = param.ToString();
}
internal void OnRefreshVersion(string appId, string resId)
{
_label_appid.text = string.Format(LoadText.Instance.Label_App_id, appId);
_label_resid.text = string.Format(LoadText.Instance.Label_Res_id, resId);
}
/// <summary>
/// 清空本地缓存
/// </summary>
public virtual void OnClear()
{
LauncherMgr.ShowMessageBox(LoadText.Instance.Label_Clear_Comfirm, MessageShowType.TwoButton,
LoadStyle.StyleEnum.Style_Clear,
() =>
{
// GameModule.Resource.ClearUnusedCacheFilesAsync();
Application.Quit();
}, () => { });
}
/// <summary>
/// 下载进度更新。
/// </summary>
/// <param name="progress">当前进度。</param>
internal virtual void OnUpdateUIProgress(float progress)
{
_obj_progress.gameObject.SetActive(true);
_obj_progress.size = progress;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f0fad7cbc10b815488c9e6ebfeccb210
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: