public void RestartLevel(bool reset = true) { if (currentLevel.respawnLocked) { return; } SignalManager.BeginReset(); currentCheckpointNumber = 0; currentCheckpointSubObjectives = 0; if (currentLevel.prerespawn != null) { currentLevel.prerespawn(-1, startingLevel: false); } RespawnAllPlayers(); if (reset) { currentLevel.Reset(currentCheckpointNumber, currentCheckpointSubObjectives); if (NetGame.isServer) { NetSceneManager.ResetLevel(currentCheckpointNumber, currentCheckpointSubObjectives); } } currentLevel.BeginLevel(); SignalManager.EndReset(); if (reset) { currentLevel.PostEndReset(currentCheckpointNumber); } }
private IEnumerator ReloadBundleCoroutine() { SignalManager.BeginReset(); if (workshopLevel != null) { MenuCameraEffects.instance.RemoveOverride(); workshopLevel.Reload(); } Time.timeScale = 0f; SceneManager.LoadScene("Empty"); yield return(null); yield return(null); yield return(null); bundle = FileTools.LoadBundle(workshopLevel.dataPath); string[] scenePath = bundle.GetAllScenePaths(); SceneManager.LoadScene(Path.GetFileNameWithoutExtension(scenePath[0])); yield return(null); SubtitleManager.instance.SetProgress(ScriptLocalization.TUTORIAL.LOADING, 1f, 1f); yield return(null); FixupLoadedBundle(SceneManager.GetActiveScene()); bundle.Unload(unloadAllLoadedObjects: false); currentLevel.BeginLevel(); ResetAllPLayers(); Time.timeScale = 1f; SignalManager.EndReset(); FixAssetBundleImport(); }
public void RestartCheckpoint(int checkpointNumber, int subObjectives) { if (!currentLevel.respawnLocked) { currentCheckpointNumber = Mathf.Min(checkpointNumber, currentLevel.checkpoints.Length - 1); currentCheckpointSubObjectives = subObjectives; SignalManager.BeginReset(); if (currentLevel.prerespawn != null) { currentLevel.prerespawn(checkpointNumber, startingLevel: false); } RespawnAllPlayers(); currentLevel.Reset(currentCheckpointNumber, currentCheckpointSubObjectives); if (NetGame.isServer) { NetSceneManager.ResetLevel(currentCheckpointNumber, currentCheckpointSubObjectives); } currentLevel.BeginLevel(); CheckpointLoaded(currentCheckpointNumber); SignalManager.EndReset(); currentLevel.PostEndReset(currentCheckpointNumber); } }
public void BeforeLoad() { SignalManager.BeginReset(); }