Update samples

This commit is contained in:
hevinci
2022-09-27 21:26:00 +08:00
parent af37bb6e54
commit 84045b13c6
6 changed files with 8 additions and 201 deletions
@@ -45,9 +45,6 @@ public class GameScene1 : MonoBehaviour
void InitWindow()
{
var resVersion = CanvasRoot.transform.Find("res_version/label").GetComponent<Text>();
resVersion.text = $"资源版本 : {YooAssets.GetResourceVersion()}";
var playMode = CanvasRoot.transform.Find("play_mode/label").GetComponent<Text>();
if (BootScene.GamePlayMode == YooAssets.EPlayMode.EditorSimulateMode)
playMode.text = "编辑器下模拟模式";
@@ -24,7 +24,7 @@ public class FsmUpdateManifest : IFsmNode
yield return new WaitForSecondsRealtime(0.5f);
// 更新补丁清单
var operation = YooAssets.UpdateManifestAsync(PatchUpdater.ResourceVersion, 30);
var operation = YooAssets.UpdateManifestAsync("DefaultPackage", PatchUpdater.PackageCRC, 30);
yield return operation;
if(operation.Status == EOperationStatus.Succeed)
@@ -24,13 +24,13 @@ internal class FsmUpdateStaticVersion : IFsmNode
yield return new WaitForSecondsRealtime(0.5f);
// 更新资源版本号
var operation = YooAssets.UpdateStaticVersionAsync(30);
var operation = YooAssets.UpdateStaticVersionAsync("DefaultPackage", 30);
yield return operation;
if (operation.Status == EOperationStatus.Succeed)
{
Debug.Log($"Found static version : {operation.ResourceVersion}");
PatchUpdater.ResourceVersion = operation.ResourceVersion;
Debug.Log($"Found static version : {operation.PackageCRC}");
PatchUpdater.PackageCRC = operation.PackageCRC;
FsmManager.Transition(nameof(FsmUpdateManifest));
}
else
@@ -16,7 +16,7 @@ public static class PatchUpdater
/// <summary>
/// 资源版本
/// </summary>
public static int ResourceVersion { set; get; }
public static string PackageCRC { set; get; }
/// <summary>
/// 开启初始化流程