mirror of https://github.com/tuyoogame/YooAsset
update samples
parent
9a84cdef9f
commit
4490c99eee
|
@ -35,13 +35,13 @@ internal class FsmSceneBattle : IStateNode
|
|||
|
||||
private IEnumerator Prepare()
|
||||
{
|
||||
yield return UniWindow.OpenWindowAsync<UILoadingWindow>("UILoading");
|
||||
yield return YooAssets.LoadSceneAsync("scene_battle");
|
||||
|
||||
_battleRoom = new BattleRoom();
|
||||
yield return _battleRoom.LoadRoom();
|
||||
|
||||
// 等所有数据准备完毕后,关闭加载界面。
|
||||
UniWindow.CloseWindow<UILoadingWindow>();
|
||||
// 释放资源
|
||||
var package = YooAssets.GetPackage("DefaultPackage");
|
||||
package.UnloadUnusedAssets();
|
||||
}
|
||||
}
|
|
@ -28,14 +28,11 @@ 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);
|
||||
|
||||
// 等所有数据准备完毕后,关闭加载界面。
|
||||
UniWindow.CloseWindow<UILoadingWindow>();
|
||||
|
||||
// 释放资源
|
||||
var package = YooAssets.GetPackage("DefaultPackage");
|
||||
package.UnloadUnusedAssets();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue