mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'main' into dev
This commit is contained in:
commit
67590c5176
@ -5,6 +5,10 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace NewHorizons.Handlers
|
namespace NewHorizons.Handlers
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// copied from LoadManager.
|
||||||
|
/// exists so we can do things after the fade without patching.
|
||||||
|
/// </summary>
|
||||||
public static class FadeHandler
|
public static class FadeHandler
|
||||||
{
|
{
|
||||||
public static void FadeOut(float length) => Delay.StartCoroutine(FadeOutCoroutine(length));
|
public static void FadeOut(float length) => Delay.StartCoroutine(FadeOutCoroutine(length));
|
||||||
@ -17,11 +21,14 @@ namespace NewHorizons.Handlers
|
|||||||
|
|
||||||
while (Time.unscaledTime < endTime)
|
while (Time.unscaledTime < endTime)
|
||||||
{
|
{
|
||||||
LoadManager.s_instance._fadeImage.color = Color.Lerp(Color.clear, Color.black, (Time.unscaledTime - startTime) / length);
|
var t = Mathf.Clamp01((Time.unscaledTime - startTime) / length);
|
||||||
|
LoadManager.s_instance._fadeImage.color = Color.Lerp(Color.clear, Color.black, t);
|
||||||
|
AudioListener.volume = 1f - t;
|
||||||
yield return new WaitForEndOfFrame();
|
yield return new WaitForEndOfFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadManager.s_instance._fadeImage.color = Color.black;
|
LoadManager.s_instance._fadeImage.color = Color.black;
|
||||||
|
AudioListener.volume = 0;
|
||||||
yield return new WaitForEndOfFrame();
|
yield return new WaitForEndOfFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -981,11 +981,11 @@ namespace NewHorizons
|
|||||||
OWInput.ChangeInputMode(InputMode.None);
|
OWInput.ChangeInputMode(InputMode.None);
|
||||||
|
|
||||||
// Hide unloading
|
// Hide unloading
|
||||||
ManualOnStartSceneLoad(sceneToLoad);
|
|
||||||
FadeHandler.FadeThen(1f, () =>
|
FadeHandler.FadeThen(1f, () =>
|
||||||
{
|
{
|
||||||
// Slide reel unloading is tied to being removed from the sector, so we do that here to prevent a softlock
|
// Slide reel unloading is tied to being removed from the sector, so we do that here to prevent a softlock
|
||||||
Locator.GetPlayerSectorDetector().RemoveFromAllSectors();
|
Locator.GetPlayerSectorDetector().RemoveFromAllSectors();
|
||||||
|
ManualOnStartSceneLoad(sceneToLoad); // putting it before fade breaks ship warp effect cuz pause
|
||||||
LoadManager.LoadSceneImmediate(sceneToLoad);
|
LoadManager.LoadSceneImmediate(sceneToLoad);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user