fix scene(failed)

This commit is contained in:
左右看
2023-07-09 17:33:52 +08:00
parent 5ee6e7e6ad
commit 45e05b5800
3 changed files with 20 additions and 3 deletions
+3 -2
View File
@@ -13,7 +13,7 @@ public class UmaSceneController:MonoBehaviour
{ {
if (instance) if (instance)
{ {
Destroy(this.gameObject); Destroy(instance.gameObject);
} }
instance = this; instance = this;
DontDestroyOnLoad(this); DontDestroyOnLoad(this);
@@ -26,9 +26,10 @@ public class UmaSceneController:MonoBehaviour
IEnumerator LoadLiveSceneAsync(string sceneName, Action OnSceneloaded, Action OnLastSceneUnloaded) IEnumerator LoadLiveSceneAsync(string sceneName, Action OnSceneloaded, Action OnLastSceneUnloaded)
{ {
if (CavansInstance) if (CavansInstance)
{ {
Destroy(CavansInstance); //Destroy(CavansInstance);
} }
CavansInstance = Instantiate(CavansPrefab, transform); CavansInstance = Instantiate(CavansPrefab, transform);
var animation = CavansInstance.GetComponent<Animation>(); var animation = CavansInstance.GetComponent<Animation>();
+1 -1
View File
@@ -148,7 +148,7 @@ public class UmaViewerMain : MonoBehaviour
string filePath = asset.FilePath; string filePath = asset.FilePath;
if (File.Exists(filePath)) if (File.Exists(filePath))
{ {
AssetBundle bundle = AssetBundle.LoadFromFile(filePath); AssetBundle bundle = UmaViewerBuilder.LoadOrGet(asset);
foreach (var item in UmaDatabaseController.Instance.LiveData) foreach (var item in UmaDatabaseController.Instance.LiveData)
{ {
var musicId = Convert.ToInt32(item["music_id"]); var musicId = Convert.ToInt32(item["music_id"]);
@@ -13,6 +13,7 @@ using System.Data;
using System.Runtime.Remoting.Metadata.W3cXsd2001; using System.Runtime.Remoting.Metadata.W3cXsd2001;
using CriWare; using CriWare;
using static UmaViewerAudio; using static UmaViewerAudio;
using UnityEngine.SceneManagement;
namespace Gallop.Live namespace Gallop.Live
{ {
@@ -504,6 +505,21 @@ namespace Gallop.Live
void Update() void Update()
{ {
if (Input.GetKeyDown(KeyCode.Escape))
{
UmaSceneController.instance.LoadScene("Version2",
delegate ()
{
AssetBundle.UnloadAllAssetBundles(true);
},
delegate ()
{
});
return;
}
if (_isLiveSetup) if (_isLiveSetup)
{ {
if(_syncTime == false) if(_syncTime == false)