Files
TuanTuan-Engine/Assets/GameScripts/Main/GameStart.cs

38 lines
1.3 KiB
C#
Raw Normal View History

2025-11-03 17:46:28 +08:00
using UnityEngine;
2025-11-12 07:04:31 +08:00
using Cysharp.Threading.Tasks;
using Tuan.GameFramework;
using Tuan.GameScripts.Preload;
2025-11-12 18:39:09 +08:00
using YooAsset;
2025-11-03 17:46:28 +08:00
2025-11-12 07:04:31 +08:00
namespace Tuan.GameScripts.Main
2025-11-03 17:46:28 +08:00
{
2025-11-12 07:04:31 +08:00
public class GameStart : MonoBehaviour
{
2025-11-12 07:04:31 +08:00
// Start is called once before the first execution of Update after the MonoBehaviour is created
async void Start()
{
Debug.Log("GameStart");
GamePreload.Inst.Test("call by GameStart");
2025-11-12 18:39:09 +08:00
_ = LoadSceneTest();
// _ = FrameSplittingTest(1);
SimpleR3Test ui = await UIManager.Inst.ShowUIAsync<SimpleR3Test>("test1", MainUICanvas.Inst.Medium);
UIManager.Inst.CloseUI(ui);
await UIManager.Inst.ShowUIAsync<SimpleR3Test>("test2", MainUICanvas.Inst.Medium);
await UIManager.Inst.ShowUIAsync<SimpleR3Test>("test3", MainUICanvas.Inst.Medium);
await UIManager.Inst.ShowUIAsync<SimpleR3Test>("test1");
2025-11-12 07:04:31 +08:00
}
async UniTask FrameSplittingTest(int delayFrame)
2025-11-10 16:59:40 +08:00
{
2025-11-12 07:04:31 +08:00
for (int i = 0; i < 100; i++)
{
Debug.Log(i);
await UniTask.DelayFrame(delayFrame);
}
2025-11-10 16:59:40 +08:00
}
2025-11-12 18:39:09 +08:00
async UniTask LoadSceneTest()
{
PatchEvent.ClosePatchWindow();
await GameSceneManager.Inst.LoadSceneAsync("Test");
}
2025-11-03 17:46:28 +08:00
}
2025-11-10 16:59:40 +08:00
}