mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix no audio and eye closing effect
This commit is contained in:
parent
1b1bf47266
commit
392fc404f4
@ -14,6 +14,7 @@ namespace NewHorizons.Builder.Volumes
|
||||
volume.creditsType = info.creditsType;
|
||||
volume.gameOverText = info.gameOverText;
|
||||
volume.deathType = info.deathType == null ? null : EnumUtils.Parse(info.deathType.ToString(), DeathType.Default);
|
||||
volume.colour = info.gameOverTextColour?.ToColor();
|
||||
|
||||
return volume;
|
||||
}
|
||||
|
||||
@ -15,6 +15,8 @@ namespace NewHorizons.Components.Volumes
|
||||
public string gameOverText;
|
||||
public DeathType? deathType = DeathType.Default;
|
||||
|
||||
public Color? colour;
|
||||
|
||||
private GameOverController _gameOverController;
|
||||
private PlayerCameraEffectController _playerCameraEffectController;
|
||||
|
||||
@ -52,6 +54,8 @@ namespace NewHorizons.Components.Volumes
|
||||
}
|
||||
else
|
||||
{
|
||||
// Wake up relaxed next loop
|
||||
PlayerData.SetLastDeathType(DeathType.Meditation);
|
||||
FadeHandler.FadeOut(fadeLength);
|
||||
}
|
||||
|
||||
@ -62,6 +66,11 @@ namespace NewHorizons.Components.Volumes
|
||||
_gameOverController._deathText.text = TranslationHandler.GetTranslation(gameOverText, TranslationHandler.TextType.UI);
|
||||
_gameOverController.SetupGameOverScreen(5f);
|
||||
|
||||
if (colour != null)
|
||||
{
|
||||
_gameOverController._deathText.color = (Color)colour;
|
||||
}
|
||||
|
||||
// Make sure the fade handler is off now
|
||||
FadeHandler.FadeIn(0f);
|
||||
|
||||
@ -95,6 +104,8 @@ namespace NewHorizons.Components.Volumes
|
||||
LoadManager.LoadScene(OWScene.Credits_Fast, LoadManager.FadeType.ToBlack);
|
||||
break;
|
||||
default:
|
||||
// GameOverController disables post processing
|
||||
_gameOverController._flashbackCamera.postProcessing.enabled = true;
|
||||
GlobalMessenger.FireEvent("TriggerFlashback");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
using NewHorizons.External.SerializableData;
|
||||
using NewHorizons.External.SerializableEnums;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel;
|
||||
@ -18,5 +19,10 @@ namespace NewHorizons.External.Modules.Volumes.VolumeInfos
|
||||
/// The type of death the player will have if they enter this volume. Don't set to have the camera just fade out.
|
||||
/// </summary>
|
||||
[DefaultValue("default")] public NHDeathType? deathType = null;
|
||||
|
||||
/// <summary>
|
||||
/// Change the colour of the game over text. Leave empty to use the default orange.
|
||||
/// </summary>
|
||||
public MColor gameOverTextColour;
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,10 +41,13 @@ namespace NewHorizons.Handlers
|
||||
|
||||
while (Time.unscaledTime < endTime)
|
||||
{
|
||||
LoadManager.s_instance._fadeImage.color = Color.Lerp(Color.black, Color.clear, (Time.unscaledTime - startTime) / length);
|
||||
var t = Mathf.Clamp01((Time.unscaledTime - startTime) / length);
|
||||
LoadManager.s_instance._fadeImage.color = Color.Lerp(Color.black, Color.clear, t);
|
||||
AudioListener.volume = t;
|
||||
yield return new WaitForEndOfFrame();
|
||||
}
|
||||
|
||||
AudioListener.volume = 1;
|
||||
LoadManager.s_instance._fadeCanvas.enabled = false;
|
||||
LoadManager.s_instance._fadeImage.color = Color.clear;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user