コード例 #1
0
ファイル: Game.cs プロジェクト: chaojikugua/HumanFallFlat
 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);
     }
 }
コード例 #2
0
ファイル: Game.cs プロジェクト: chaojikugua/HumanFallFlat
    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();
    }
コード例 #3
0
ファイル: Game.cs プロジェクト: chaojikugua/HumanFallFlat
 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);
     }
 }
コード例 #4
0
ファイル: Game.cs プロジェクト: chaojikugua/HumanFallFlat
 public void BeforeLoad()
 {
     SignalManager.BeginReset();
 }