update samples

This commit is contained in:
hevinci
2022-11-26 17:39:52 +08:00
parent f31e5e0d22
commit f6f326119c
17 changed files with 169 additions and 108 deletions
@@ -0,0 +1,15 @@
using System;
using UnityEngine;
using YooAsset;
public class BhvApplicationQuit : MonoBehaviour
{
private void Awake()
{
DontDestroyOnLoad(this.gameObject);
}
private void OnApplicationQuit()
{
YooAssets.Destroy();
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 3cbcea01819f3d94ba5162624ad9c75f
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -17,8 +17,6 @@ internal class FsmSceneBattle : IStateNode
}
void IStateNode.OnEnter()
{
UniWindow.OpenWindowSync<UILoadingWindow>("UILoading");
UniModule.StartCoroutine(Prepare());
}
void IStateNode.OnUpdate()
@@ -37,6 +35,7 @@ internal class FsmSceneBattle : IStateNode
private IEnumerator Prepare()
{
yield return UniWindow.OpenWindowAsync<UILoadingWindow>("UILoading");
yield return YooAssets.LoadSceneAsync("scene_battle");
_battleRoom = new BattleRoom();
@@ -16,9 +16,6 @@ internal class FsmSceneHome : IStateNode
}
void IStateNode.OnEnter()
{
if (_machine.PreviousNode != typeof(FsmInitGame).FullName)
UniWindow.OpenWindowSync<UILoadingWindow>("UILoading");
UniModule.StartCoroutine(Prepare());
}
void IStateNode.OnUpdate()
@@ -31,6 +28,9 @@ internal class FsmSceneHome : IStateNode
private IEnumerator Prepare()
{
if (_machine.PreviousNode != typeof(FsmInitGame).FullName)
yield return UniWindow.OpenWindowAsync<UILoadingWindow>("UILoading");
yield return YooAssets.LoadSceneAsync("scene_home");
yield return UniWindow.OpenWindowAsync<UIHomeWindow>("UIHome");
yield return new WaitForSeconds(0.5f);
@@ -39,12 +39,13 @@ public class FsmCreateDownloader : IStateNode
if (downloader.TotalDownloadCount == 0)
{
Debug.Log("没有发现需要下载的资源!");
Debug.Log("Not found any download files !");
_machine.ChangeState<FsmDownloadOver>();
}
else
{
Debug.Log($"一共发现了{downloader.TotalDownloadCount}个资源需要更新下载!");
//A total of 10 files were found that need to be downloaded
Debug.Log($"Found total {downloader.TotalDownloadCount} files that need download !");
// 发现新更新文件后,挂起流程系统
// 注意:开发者需要在下载前检测磁盘空间不足