update samples
parent
824d1c1501
commit
ac251114ff
|
@ -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()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue