This commit is contained in:
CroakFang
2023-07-12 09:21:08 +08:00
parent c04b8107c9
commit 1ea26223fc
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -14,14 +14,15 @@ public class UmaSceneController:MonoBehaviour
if (instance)
{
Destroy(gameObject);
return;
}
instance = this;
DontDestroyOnLoad(this);
}
public void LoadScene(string name, Action OnSceneloaded = null, Action OnLastSceneUnloaded = null)
public static void LoadScene(string name, Action OnSceneloaded = null, Action OnLastSceneUnloaded = null)
{
StartCoroutine(LoadLiveSceneAsync(name, OnSceneloaded, OnLastSceneUnloaded));
instance.StartCoroutine(instance.LoadLiveSceneAsync(name, OnSceneloaded, OnLastSceneUnloaded));
}
IEnumerator LoadLiveSceneAsync(string sceneName, Action OnSceneloaded, Action OnLastSceneUnloaded)