1
This commit is contained in:
54
Assets/Domain/Test/HotUpdate/Application/UIViews/Launcher.cs
Normal file
54
Assets/Domain/Test/HotUpdate/Application/UIViews/Launcher.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
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>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user