This commit is contained in:
左右看
2023-07-12 09:27:26 +08:00
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)
+1 -1
View File
@@ -682,7 +682,7 @@ public class UmaViewerBuilder : MonoBehaviour
GameObject.Find("AudioManager")
};
UmaSceneController.instance.LoadScene("LiveScene",
UmaSceneController.LoadScene("LiveScene",
delegate ()
{
// Move the GameObject (you attach this in the Inspector) to the newly loaded Scene
@@ -502,7 +502,7 @@ namespace Gallop.Live
if (Input.GetKeyDown(KeyCode.Escape))
{
isExit = true;
UmaSceneController.instance.LoadScene("Version2");
UmaSceneController.LoadScene("Version2");
AssetBundle.UnloadAllAssetBundles(true);
}