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)
{
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<Animation>();