Files
plugin-library/Assets/Domain/Test/HotUpdate/Application/UIViews/Launcher.cs

54 lines
1.3 KiB
C#
Raw Normal View History

2025-09-24 15:34:24 +08:00
using Stary.Evo;
using System;
using System.Collections;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using UnityEngine;
using YooAsset;
public class Launcher : MonoBehaviour
{
public GameObject Splash;
void Start()
{
if (Splash == null)
{
Splash = GameObject.Find(nameof(Splash));
}
StartCor();
}
private async void StartCor()
{
// var resourceCore = ResourceManager.Instance.GetResourceCore(UIConfig.UIPackageName);
//
// await resourceCore.InitializeAsync(UIConfig.UIPackageName);
await UIManager.Instance.InitUIConfig();
await UIManager.Instance.Preload<UILoadingView>();
Loading.Instance.StartLoading(EnterGameCor);
if (Splash != null)
{
Splash.SetActive(false);
}
}
IEnumerator EnterGameCor(Action<float, string> loadingRefresh)
{
loadingRefresh?.Invoke(0.3f, "loading..........1");
yield return new WaitForSeconds(0.5f);
loadingRefresh?.Invoke(0.6f, "loading..........2");
yield return new WaitForSeconds(0.5f);
loadingRefresh?.Invoke(1, "loading..........3");
yield return new WaitForSeconds(0.5f);
UIManager.Instance.Open<UILoginView>();
}
}