diff --git a/Assets/Scripts/UmaSceneController.cs b/Assets/Scripts/UmaSceneController.cs index 2bf12fa..863107b 100644 --- a/Assets/Scripts/UmaSceneController.cs +++ b/Assets/Scripts/UmaSceneController.cs @@ -13,7 +13,7 @@ public class UmaSceneController:MonoBehaviour { if (instance) { - Destroy(this.gameObject); + Destroy(instance.gameObject); } instance = this; DontDestroyOnLoad(this); @@ -26,9 +26,10 @@ public class UmaSceneController:MonoBehaviour IEnumerator LoadLiveSceneAsync(string sceneName, Action OnSceneloaded, Action OnLastSceneUnloaded) { + if (CavansInstance) { - Destroy(CavansInstance); + //Destroy(CavansInstance); } CavansInstance = Instantiate(CavansPrefab, transform); var animation = CavansInstance.GetComponent(); diff --git a/Assets/Scripts/UmaViewerMain.cs b/Assets/Scripts/UmaViewerMain.cs index 8100722..22d5f13 100644 --- a/Assets/Scripts/UmaViewerMain.cs +++ b/Assets/Scripts/UmaViewerMain.cs @@ -148,7 +148,7 @@ public class UmaViewerMain : MonoBehaviour string filePath = asset.FilePath; if (File.Exists(filePath)) { - AssetBundle bundle = AssetBundle.LoadFromFile(filePath); + AssetBundle bundle = UmaViewerBuilder.LoadOrGet(asset); foreach (var item in UmaDatabaseController.Instance.LiveData) { var musicId = Convert.ToInt32(item["music_id"]); diff --git a/Assets/Scripts/umamusume/Gallop/Live/Director.cs b/Assets/Scripts/umamusume/Gallop/Live/Director.cs index 8c94cb2..8b53ba1 100644 --- a/Assets/Scripts/umamusume/Gallop/Live/Director.cs +++ b/Assets/Scripts/umamusume/Gallop/Live/Director.cs @@ -13,6 +13,7 @@ using System.Data; using System.Runtime.Remoting.Metadata.W3cXsd2001; using CriWare; using static UmaViewerAudio; +using UnityEngine.SceneManagement; namespace Gallop.Live { @@ -504,6 +505,21 @@ namespace Gallop.Live void Update() { + if (Input.GetKeyDown(KeyCode.Escape)) + { + UmaSceneController.instance.LoadScene("Version2", + delegate () + { + AssetBundle.UnloadAllAssetBundles(true); + }, + delegate () + { + + }); + + return; + } + if (_isLiveSetup) { if(_syncTime == false)