mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-14 19:40:47 +00:00
update samples
This commit is contained in:
@@ -4,6 +4,7 @@ using UnityEngine;
|
||||
using UniFramework.Pooling;
|
||||
using UniFramework.Window;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Module;
|
||||
using YooAsset;
|
||||
|
||||
internal class FsmInitGame : IStateNode
|
||||
@@ -16,7 +17,19 @@ internal class FsmInitGame : IStateNode
|
||||
}
|
||||
void IStateNode.OnEnter()
|
||||
{
|
||||
var handle = YooAssets.LoadAssetSync<GameObject>("UICanvas");
|
||||
UniModule.StartCoroutine(Prepare());
|
||||
}
|
||||
void IStateNode.OnUpdate()
|
||||
{
|
||||
}
|
||||
void IStateNode.OnExit()
|
||||
{
|
||||
}
|
||||
|
||||
private IEnumerator Prepare()
|
||||
{
|
||||
var handle = YooAssets.LoadAssetAsync<GameObject>("UICanvas");
|
||||
yield return handle;
|
||||
var canvas = handle.InstantiateSync();
|
||||
var desktop = canvas.transform.Find("Desktop").gameObject;
|
||||
GameObject.DontDestroyOnLoad(canvas);
|
||||
@@ -29,10 +42,4 @@ internal class FsmInitGame : IStateNode
|
||||
|
||||
_machine.ChangeState<FsmSceneHome>();
|
||||
}
|
||||
void IStateNode.OnUpdate()
|
||||
{
|
||||
}
|
||||
void IStateNode.OnExit()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user