Update samples

This commit is contained in:
hevinci
2022-07-18 14:59:15 +08:00
parent df5f0b9c13
commit 95e6921a4e
357 changed files with 0 additions and 8 deletions

View File

@@ -0,0 +1,42 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using YooAsset;
internal class FsmUpdateStaticVersion : IFsmNode
{
public string Name { private set; get; } = nameof(FsmUpdateStaticVersion);
void IFsmNode.OnEnter()
{
PatchEventDispatcher.SendPatchStepsChangeMsg(EPatchStates.UpdateStaticVersion);
BootScene.Instance.StartCoroutine(GetStaticVersion());
}
void IFsmNode.OnUpdate()
{
}
void IFsmNode.OnExit()
{
}
private IEnumerator GetStaticVersion()
{
yield return new WaitForSecondsRealtime(0.5f);
// 更新资源版本号
var operation = YooAssets.UpdateStaticVersionAsync(30);
yield return operation;
if (operation.Status == EOperationStatus.Succeed)
{
Debug.Log($"Found static version : {operation.ResourceVersion}");
PatchUpdater.ResourceVersion = operation.ResourceVersion;
FsmManager.Transition(nameof(FsmUpdateManifest));
}
else
{
Debug.LogWarning(operation.Error);
PatchEventDispatcher.SendStaticVersionUpdateFailedMsg();
}
}
}