From de3c013417aab6cbb8f7f40512275830411a58e4 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Mon, 11 Aug 2025 15:42:22 +0800 Subject: [PATCH] 123 --- .../VersionFlow/Editor/BuilderConfigEditor.cs | 18 +--- Assets/VersionFlow/Readme.md | 17 ++++ Assets/VersionFlow/Readme.md.meta | 7 ++ Assets/VersionFlow/Runtime/VersionFlow.cs | 2 +- Assets/VersionFlow/Sample/DEMO.cs | 88 ++++++++++--------- Assets/VersionFlow/Sample/ui.cs | 11 ++- 6 files changed, 79 insertions(+), 64 deletions(-) create mode 100644 Assets/VersionFlow/Readme.md create mode 100644 Assets/VersionFlow/Readme.md.meta diff --git a/Assets/VersionFlow/Editor/BuilderConfigEditor.cs b/Assets/VersionFlow/Editor/BuilderConfigEditor.cs index 2e43d43..43d33b7 100644 --- a/Assets/VersionFlow/Editor/BuilderConfigEditor.cs +++ b/Assets/VersionFlow/Editor/BuilderConfigEditor.cs @@ -439,22 +439,6 @@ namespace VersionFlow.Editors EditorUtility.DisplayProgressBar("算hash", $"{step}/{total}", step / total * 1f); } - //var procedu = Parallel.ForEach(bundleNames, item => - //{ - // var fullPath = $"{bundleOutputPath}/{item}"; - // var hash = AssetBundleParser.ParserHash(fullPath); - // lock (bundleExtraInfo) - // { - // bundleExtraInfo[item].BundleHash = hash; - // } - // step++; - //}); - - //while (!procedu.IsCompleted) - //{ - // EditorUtility.DisplayProgressBar("算hash", $"{step}/{total}", step / total * 1f); - //} - EditorUtility.ClearProgressBar(); } @@ -506,4 +490,4 @@ namespace VersionFlow.Editors AssetDatabase.Refresh(); } } -} +} \ No newline at end of file diff --git a/Assets/VersionFlow/Readme.md b/Assets/VersionFlow/Readme.md new file mode 100644 index 0000000..5592020 --- /dev/null +++ b/Assets/VersionFlow/Readme.md @@ -0,0 +1,17 @@ +# VersionFlow 插件使用说明 + +### 基本流程 +1. **配置打包设置** + 通过菜单 `VersionFlow/Settings` 设置 AssetBundle 打包资源 + +2. **构建与上传** + 操作流程:获取远端版本号 → 执行构建 → 上传资源 + +3. **配置运行时设置** + 设置资源下载地址 + +4. **启动更新流程** + 调用 `VersionFlow.StartVersionFlow()` 开始下载 + +5. **加载资源** + 使用 `VersionFlow.BundleManager` 中的 API 加载资源 \ No newline at end of file diff --git a/Assets/VersionFlow/Readme.md.meta b/Assets/VersionFlow/Readme.md.meta new file mode 100644 index 0000000..1358ffc --- /dev/null +++ b/Assets/VersionFlow/Readme.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 836675c603609774e883700107169501 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VersionFlow/Runtime/VersionFlow.cs b/Assets/VersionFlow/Runtime/VersionFlow.cs index 077ed1b..550fae1 100644 --- a/Assets/VersionFlow/Runtime/VersionFlow.cs +++ b/Assets/VersionFlow/Runtime/VersionFlow.cs @@ -467,4 +467,4 @@ namespace VersionFlow.Runtime Error = m_downloadReq.result == UnityWebRequest.Result.Success ? null : m_downloadReq.error; } } -} +} \ No newline at end of file diff --git a/Assets/VersionFlow/Sample/DEMO.cs b/Assets/VersionFlow/Sample/DEMO.cs index fa18471..d2a58ac 100644 --- a/Assets/VersionFlow/Sample/DEMO.cs +++ b/Assets/VersionFlow/Sample/DEMO.cs @@ -3,56 +3,60 @@ using UnityEngine; using UnityEngine.UI; using VersionFlow.Runtime; -public class DEMO : MonoBehaviour, IVersionFlowVisual +namespace VersionFlow.Demo { - private void Awake() - { - StartCoroutine(VersionFlowX.StartVersionFlow(this)); - } - private void Update() + public class DEMO : MonoBehaviour, IVersionFlowVisual { - if (Input.GetKeyDown(KeyCode.Keypad1)) - VersionFlowX.BundleMgr.Instantiate("Assets/Test/UI/p1.prefab", uiParent); - if (Input.GetKeyDown(KeyCode.Keypad2)) - VersionFlowX.BundleMgr.Instantiate("Assets/Test/UI/p2.prefab", uiParent); - } + private void Awake() + { + StartCoroutine(VersionFlowX.StartVersionFlow(this)); + } - [SerializeField] - Text ui_state; - [SerializeField] - Slider ui_slider; - [SerializeField] - RectTransform uiParent; + private void Update() + { + if (Input.GetKeyDown(KeyCode.Keypad1)) + VersionFlowX.BundleMgr.Instantiate("Assets/Test/UI/p1.prefab", uiParent); + if (Input.GetKeyDown(KeyCode.Keypad2)) + VersionFlowX.BundleMgr.Instantiate("Assets/Test/UI/p2.prefab", uiParent); + } - public void StateChange(EnumVersionFlowState state) - { - ui_state.text = state.ToString(); - } + [SerializeField] + Text ui_state; + [SerializeField] + Slider ui_slider; + [SerializeField] + RectTransform uiParent; - public void ShowDownloadProgress(ulong downloadBytes, ulong totalBytes) - { - ui_slider.minValue = 0; - ui_slider.maxValue = totalBytes; - ui_slider.value = downloadBytes; - } + public void StateChange(EnumVersionFlowState state) + { + ui_state.text = state.ToString(); + } - public void HideDownloadProgress() - { - ui_slider.gameObject.SetActive(false); - } + public void ShowDownloadProgress(ulong downloadBytes, ulong totalBytes) + { + ui_slider.minValue = 0; + ui_slider.maxValue = totalBytes; + ui_slider.value = downloadBytes; + } - public void DownloadConfirm(ulong totalSize, Action confirm) - { - confirm.Invoke(true); - } + public void HideDownloadProgress() + { + ui_slider.gameObject.SetActive(false); + } - public void OnError(string msg, string btnTxt, Action callback, string title = "错误") - { - ui_state.text = msg; - } + public void DownloadConfirm(ulong totalSize, Action confirm) + { + confirm.Invoke(true); + } - public void SetVersion(string localVer, string remoteVer) - { + public void OnError(string msg, string btnTxt, Action callback, string title = "错误") + { + ui_state.text = msg; + } + + public void SetVersion(string localVer, string remoteVer) + { + } } -} +} \ No newline at end of file diff --git a/Assets/VersionFlow/Sample/ui.cs b/Assets/VersionFlow/Sample/ui.cs index 65e8f01..d1ffb20 100644 --- a/Assets/VersionFlow/Sample/ui.cs +++ b/Assets/VersionFlow/Sample/ui.cs @@ -2,10 +2,13 @@ using System.Collections.Generic; using UnityEngine; -public class ui : MonoBehaviour +namespace VersionFlow.Demo { - public void Close() + public class UI : MonoBehaviour { - Destroy(gameObject); + public void Close() + { + Destroy(gameObject); + } } -} +} \ No newline at end of file