update samples
parent
9a84cdef9f
commit
4490c99eee
|
@ -35,13 +35,13 @@ internal class FsmSceneBattle : IStateNode
|
||||||
|
|
||||||
private IEnumerator Prepare()
|
private IEnumerator Prepare()
|
||||||
{
|
{
|
||||||
yield return UniWindow.OpenWindowAsync<UILoadingWindow>("UILoading");
|
|
||||||
yield return YooAssets.LoadSceneAsync("scene_battle");
|
yield return YooAssets.LoadSceneAsync("scene_battle");
|
||||||
|
|
||||||
_battleRoom = new BattleRoom();
|
_battleRoom = new BattleRoom();
|
||||||
yield return _battleRoom.LoadRoom();
|
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()
|
private IEnumerator Prepare()
|
||||||
{
|
{
|
||||||
if (_machine.PreviousNode != typeof(FsmInitGame).FullName)
|
|
||||||
yield return UniWindow.OpenWindowAsync<UILoadingWindow>("UILoading");
|
|
||||||
|
|
||||||
yield return YooAssets.LoadSceneAsync("scene_home");
|
yield return YooAssets.LoadSceneAsync("scene_home");
|
||||||
yield return UniWindow.OpenWindowAsync<UIHomeWindow>("UIHome");
|
yield return UniWindow.OpenWindowAsync<UIHomeWindow>("UIHome");
|
||||||
yield return new WaitForSeconds(0.5f);
|
|
||||||
|
// 释放资源
|
||||||
// 等所有数据准备完毕后,关闭加载界面。
|
var package = YooAssets.GetPackage("DefaultPackage");
|
||||||
UniWindow.CloseWindow<UILoadingWindow>();
|
package.UnloadUnusedAssets();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue