diff --git a/Assets/Scenes/Version2.unity b/Assets/Scenes/Version2.unity index 317d339..22da645 100644 --- a/Assets/Scenes/Version2.unity +++ b/Assets/Scenes/Version2.unity @@ -32722,7 +32722,7 @@ MonoBehaviour: m_TargetGraphic: {fileID: 1882365343} m_HandleRect: {fileID: 1882365342} m_Direction: 2 - m_Value: 1 + m_Value: 0 m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: @@ -33090,7 +33090,7 @@ MonoBehaviour: m_Calls: - m_Target: {fileID: 1564959567} m_TargetAssemblyTypeName: UmaViewerUI, umamusume - m_MethodName: ChangeMainPath + m_MethodName: ChangeDataPath m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} diff --git a/Assets/Scripts/UmaDatabase/UmaDatabaseController.cs b/Assets/Scripts/UmaDatabase/UmaDatabaseController.cs index 4746268..29a41f0 100644 --- a/Assets/Scripts/UmaDatabase/UmaDatabaseController.cs +++ b/Assets/Scripts/UmaDatabase/UmaDatabaseController.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using Mono.Data.Sqlite; using System.Data; using Assets.Scripts; +using System.IO; public class UmaDatabaseController { @@ -60,11 +61,13 @@ public class UmaDatabaseController { if(Config.Instance.WorkMode == WorkMode.Standalone) { + if(!File.Exists($@"{Config.Instance.MainPath}\meta_umaviewer")) throw new Exception(); metaDb = new SqliteConnection($@"Data Source={Config.Instance.MainPath}\meta_umaviewer;"); masterDb = new SqliteConnection($@"Data Source={Config.Instance.MainPath}\master\master_umaviewer.mdb;"); } else { + if (!File.Exists($@"{Config.Instance.MainPath}\meta")) throw new Exception(); metaDb = new SqliteConnection($@"Data Source={Config.Instance.MainPath}\meta;"); masterDb = new SqliteConnection($@"Data Source={Config.Instance.MainPath}\master\master.mdb;"); } @@ -214,10 +217,10 @@ public class UmaDatabaseController public void CloseAllConnection() { - masterDb.Close(); - metaDb.Close(); - masterDb.Dispose(); - metaDb.Dispose(); + masterDb?.Close(); + metaDb?.Close(); + masterDb?.Dispose(); + metaDb?.Dispose(); SqliteConnection.ClearAllPools(); GC.Collect(); GC.WaitForPendingFinalizers(); diff --git a/Assets/Scripts/UmaSceneController.cs b/Assets/Scripts/UmaSceneController.cs index 863107b..25ce3dc 100644 --- a/Assets/Scripts/UmaSceneController.cs +++ b/Assets/Scripts/UmaSceneController.cs @@ -19,7 +19,7 @@ public class UmaSceneController:MonoBehaviour DontDestroyOnLoad(this); } - public void LoadScene(string name, Action OnSceneloaded, Action OnLastSceneUnloaded) + public void LoadScene(string name, Action OnSceneloaded = null, Action OnLastSceneUnloaded = null) { StartCoroutine(LoadLiveSceneAsync(name, OnSceneloaded, OnLastSceneUnloaded)); } @@ -45,13 +45,13 @@ public class UmaSceneController:MonoBehaviour // Wait until the last operation fully loads to return anything yield return new WaitUntil(()=> asyncLoad.isDone); - OnSceneloaded(); + OnSceneloaded?.Invoke(); // Unload the previous Scene AsyncOperation asyncUnLoad = SceneManager.UnloadSceneAsync(currentScene); yield return new WaitUntil(() => asyncUnLoad.isDone); - OnLastSceneUnloaded(); + OnLastSceneUnloaded?.Invoke(); animation.Play("SceneTransition_e"); yield return new WaitUntil(() => !animation.isPlaying); diff --git a/Assets/Scripts/umamusume/Gallop/Live/Director.cs b/Assets/Scripts/umamusume/Gallop/Live/Director.cs index c115b7a..25787d4 100644 --- a/Assets/Scripts/umamusume/Gallop/Live/Director.cs +++ b/Assets/Scripts/umamusume/Gallop/Live/Director.cs @@ -495,11 +495,14 @@ namespace Gallop.Live } } + bool isExit; void Update() { + if (isExit) return; if (Input.GetKeyDown(KeyCode.Escape)) { - SceneManager.LoadScene("Version2"); + isExit = true; + UmaSceneController.instance.LoadScene("Version2"); AssetBundle.UnloadAllAssetBundles(true); }