mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-25 18:20:15 +00:00
update samples
This commit is contained in:
@@ -4,6 +4,7 @@ using UnityEngine;
|
|||||||
using UniFramework.Pooling;
|
using UniFramework.Pooling;
|
||||||
using UniFramework.Window;
|
using UniFramework.Window;
|
||||||
using UniFramework.Machine;
|
using UniFramework.Machine;
|
||||||
|
using UniFramework.Module;
|
||||||
using YooAsset;
|
using YooAsset;
|
||||||
|
|
||||||
internal class FsmInitGame : IStateNode
|
internal class FsmInitGame : IStateNode
|
||||||
@@ -16,7 +17,19 @@ internal class FsmInitGame : IStateNode
|
|||||||
}
|
}
|
||||||
void IStateNode.OnEnter()
|
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 canvas = handle.InstantiateSync();
|
||||||
var desktop = canvas.transform.Find("Desktop").gameObject;
|
var desktop = canvas.transform.Find("Desktop").gameObject;
|
||||||
GameObject.DontDestroyOnLoad(canvas);
|
GameObject.DontDestroyOnLoad(canvas);
|
||||||
@@ -29,10 +42,4 @@ internal class FsmInitGame : IStateNode
|
|||||||
|
|
||||||
_machine.ChangeState<FsmSceneHome>();
|
_machine.ChangeState<FsmSceneHome>();
|
||||||
}
|
}
|
||||||
void IStateNode.OnUpdate()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
void IStateNode.OnExit()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user