Merge branch 'master' of https://github.com/croakfang/UmaViewer
This commit is contained in:
@@ -14,14 +14,15 @@ public class UmaSceneController:MonoBehaviour
|
|||||||
if (instance)
|
if (instance)
|
||||||
{
|
{
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
instance = this;
|
instance = this;
|
||||||
DontDestroyOnLoad(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)
|
IEnumerator LoadLiveSceneAsync(string sceneName, Action OnSceneloaded, Action OnLastSceneUnloaded)
|
||||||
|
|||||||
@@ -682,7 +682,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
GameObject.Find("AudioManager")
|
GameObject.Find("AudioManager")
|
||||||
};
|
};
|
||||||
|
|
||||||
UmaSceneController.instance.LoadScene("LiveScene",
|
UmaSceneController.LoadScene("LiveScene",
|
||||||
delegate ()
|
delegate ()
|
||||||
{
|
{
|
||||||
// Move the GameObject (you attach this in the Inspector) to the newly loaded Scene
|
// 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))
|
if (Input.GetKeyDown(KeyCode.Escape))
|
||||||
{
|
{
|
||||||
isExit = true;
|
isExit = true;
|
||||||
UmaSceneController.instance.LoadScene("Version2");
|
UmaSceneController.LoadScene("Version2");
|
||||||
AssetBundle.UnloadAllAssetBundles(true);
|
AssetBundle.UnloadAllAssetBundles(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user