Cleaned Scripts, added comments, added end scene

This commit is contained in:
Thorbjoern
2025-07-03 13:31:47 +02:00
parent 410166ba80
commit 9a54b4ee58
9 changed files with 461 additions and 31 deletions
+11 -3
View File
@@ -52,7 +52,7 @@ public class SceneLoader : MonoBehaviour
LoadNewRoom();
}
private async UniTaskVoid LoadNewRoom()
private async UniTaskVoid LoadNewRoom() // Aktuelle Methode zum Laden von Szenen
{
int sceneCount = SceneManager.sceneCount;
@@ -65,7 +65,15 @@ public class SceneLoader : MonoBehaviour
await SceneManager.UnloadSceneAsync(myScene);
}
}
await SceneManager.LoadSceneAsync(currentScene + 1, LoadSceneMode.Additive);
Debug.Log("Loaded Room " + currentScene + 1);
if (currentScene == SceneManager.sceneCountInBuildSettings-1)
{
await SceneManager.LoadSceneAsync(baseSceneIndex); // Lädt die Basis-Szene komplett neu, falls vorherige Szene die letzte war.
}
else
{
await SceneManager.LoadSceneAsync(currentScene + 1, LoadSceneMode.Additive); // Lädt die nächste Szene additiv
Debug.Log("Loaded Room " + (currentScene + 1));
}
}
}