Files

35 lines
761 B
C#
Raw Permalink Normal View History

2024-05-13 01:28:33 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace HP.Generics
{
public class Intro : MonoBehaviour
{
public string scenName;
void Start()
{
LoadAsyncScenes();
}
public void LoadAsyncScenes()
{
StartCoroutine(LoadAsyncScenesRoutine());
}
IEnumerator LoadAsyncScenesRoutine()
{
#region
yield return new WaitForSeconds(2);
AsyncOperation asyncLoad;
asyncLoad = SceneManager.LoadSceneAsync(scenName);
while (!asyncLoad.isDone) { yield return null; }
yield return null;
#endregion
}
}
}