25 lines
784 B
C#
25 lines
784 B
C#
using GhostSystem;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class ReplaySceneLoader : MonoBehaviour
|
|
{
|
|
public GhostReplayManager replayManager;
|
|
private int currentScene;
|
|
public void LoadSceneAdditive(int sceneIndex)
|
|
{
|
|
sceneIndex += 1; // Um die Basis-Scene nicht zu laden
|
|
if(SceneManager.loadedSceneCount > 1)
|
|
{
|
|
SceneManager.UnloadSceneAsync(currentScene);
|
|
}
|
|
//if (sceneIndex == 0) return;
|
|
SceneManager.LoadSceneAsync(sceneIndex, LoadSceneMode.Additive);
|
|
currentScene = sceneIndex;
|
|
|
|
// replayManager.SceneId = SceneManager.GetSceneByBuildIndex(currentScene).name; wird jetzt durch Event der Szene gelöst
|
|
}
|
|
}
|