123
This commit is contained in:
parent
e13dfb8687
commit
de3c013417
@ -439,22 +439,6 @@ namespace VersionFlow.Editors
|
|||||||
EditorUtility.DisplayProgressBar("算hash", $"{step}/{total}", step / total * 1f);
|
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();
|
EditorUtility.ClearProgressBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
17
Assets/VersionFlow/Readme.md
Normal file
17
Assets/VersionFlow/Readme.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# VersionFlow 插件使用说明
|
||||||
|
|
||||||
|
### 基本流程
|
||||||
|
1. **配置打包设置**
|
||||||
|
通过菜单 `VersionFlow/Settings` 设置 AssetBundle 打包资源
|
||||||
|
|
||||||
|
2. **构建与上传**
|
||||||
|
操作流程:获取远端版本号 → 执行构建 → 上传资源
|
||||||
|
|
||||||
|
3. **配置运行时设置**
|
||||||
|
设置资源下载地址
|
||||||
|
|
||||||
|
4. **启动更新流程**
|
||||||
|
调用 `VersionFlow.StartVersionFlow()` 开始下载
|
||||||
|
|
||||||
|
5. **加载资源**
|
||||||
|
使用 `VersionFlow.BundleManager` 中的 API 加载资源
|
||||||
7
Assets/VersionFlow/Readme.md.meta
Normal file
7
Assets/VersionFlow/Readme.md.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 836675c603609774e883700107169501
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -3,56 +3,60 @@ using UnityEngine;
|
|||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using VersionFlow.Runtime;
|
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))
|
private void Awake()
|
||||||
VersionFlowX.BundleMgr.Instantiate("Assets/Test/UI/p1.prefab", uiParent);
|
{
|
||||||
if (Input.GetKeyDown(KeyCode.Keypad2))
|
StartCoroutine(VersionFlowX.StartVersionFlow(this));
|
||||||
VersionFlowX.BundleMgr.Instantiate("Assets/Test/UI/p2.prefab", uiParent);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
[SerializeField]
|
private void Update()
|
||||||
Text ui_state;
|
{
|
||||||
[SerializeField]
|
if (Input.GetKeyDown(KeyCode.Keypad1))
|
||||||
Slider ui_slider;
|
VersionFlowX.BundleMgr.Instantiate("Assets/Test/UI/p1.prefab", uiParent);
|
||||||
[SerializeField]
|
if (Input.GetKeyDown(KeyCode.Keypad2))
|
||||||
RectTransform uiParent;
|
VersionFlowX.BundleMgr.Instantiate("Assets/Test/UI/p2.prefab", uiParent);
|
||||||
|
}
|
||||||
|
|
||||||
public void StateChange(EnumVersionFlowState state)
|
[SerializeField]
|
||||||
{
|
Text ui_state;
|
||||||
ui_state.text = state.ToString();
|
[SerializeField]
|
||||||
}
|
Slider ui_slider;
|
||||||
|
[SerializeField]
|
||||||
|
RectTransform uiParent;
|
||||||
|
|
||||||
public void ShowDownloadProgress(ulong downloadBytes, ulong totalBytes)
|
public void StateChange(EnumVersionFlowState state)
|
||||||
{
|
{
|
||||||
ui_slider.minValue = 0;
|
ui_state.text = state.ToString();
|
||||||
ui_slider.maxValue = totalBytes;
|
}
|
||||||
ui_slider.value = downloadBytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void HideDownloadProgress()
|
public void ShowDownloadProgress(ulong downloadBytes, ulong totalBytes)
|
||||||
{
|
{
|
||||||
ui_slider.gameObject.SetActive(false);
|
ui_slider.minValue = 0;
|
||||||
}
|
ui_slider.maxValue = totalBytes;
|
||||||
|
ui_slider.value = downloadBytes;
|
||||||
|
}
|
||||||
|
|
||||||
public void DownloadConfirm(ulong totalSize, Action<bool> confirm)
|
public void HideDownloadProgress()
|
||||||
{
|
{
|
||||||
confirm.Invoke(true);
|
ui_slider.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnError(string msg, string btnTxt, Action callback, string title = "错误")
|
public void DownloadConfirm(ulong totalSize, Action<bool> confirm)
|
||||||
{
|
{
|
||||||
ui_state.text = msg;
|
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)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2,10 +2,13 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class ui : MonoBehaviour
|
namespace VersionFlow.Demo
|
||||||
{
|
{
|
||||||
public void Close()
|
public class UI : MonoBehaviour
|
||||||
{
|
{
|
||||||
Destroy(gameObject);
|
public void Close()
|
||||||
|
{
|
||||||
|
Destroy(gameObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user