Esempio n. 1
0
    public void AfterLoad(int checkpointNumber, int subobjectives)
    {
        MenuCameraEffects menuCameraEffects = MenuCameraEffects.instance;

        if ((bool)menuCameraEffects && currentLevelNumber >= 0 && currentLevelNumber < levels.Length)
        {
            string text = levels[currentLevelNumber];
            if (text != null && text == "Halloween")
            {
                menuCameraEffects.ForceDisableOcclusion(forceDisableOcclusion: true);
            }
            else
            {
                menuCameraEffects.ForceDisableOcclusion(forceDisableOcclusion: false);
            }
        }
        state = GameState.PlayingLevel;
        defaultLight.gameObject.SetActive(value: false);
        currentCheckpointNumber        = Mathf.Min(checkpointNumber, currentLevel.checkpoints.Length - 1);
        currentCheckpointSubObjectives = subobjectives;
        currentLevel.BeginLevel();
        if (currentLevel.prerespawn != null)
        {
            currentLevel.prerespawn(currentCheckpointNumber, startingLevel: true);
        }
        RespawnAllPlayers();
        currentLevel.Reset(currentCheckpointNumber, currentCheckpointSubObjectives);
        CheckpointLoaded(checkpointNumber);
        SignalManager.EndReset();
        currentLevel.PostEndReset(currentCheckpointNumber);
    }
Esempio n. 2
0
    public void UnloadLevel()
    {
        StatsAndAchievements.Save();
        Resume();
        AfterUnload();
        MenuCameraEffects menuCameraEffects = MenuCameraEffects.instance;

        if ((bool)menuCameraEffects)
        {
            menuCameraEffects.ForceDisableOcclusion(forceDisableOcclusion: false);
        }
    }