mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Don't just cut to black
This commit is contained in:
parent
0f56b59d63
commit
bddcd88b16
@ -25,12 +25,14 @@ namespace NewHorizons.Handlers
|
|||||||
yield return new WaitForEndOfFrame();
|
yield return new WaitForEndOfFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void FadeThen(float length, Action action) => Delay.StartCoroutine(FadeThenCoroutine(length, action));
|
public static void FadeThen(float length, float totalTime, Action action) => Delay.StartCoroutine(FadeThenCoroutine(length, totalTime, action));
|
||||||
|
|
||||||
private static IEnumerator FadeThenCoroutine(float length, Action action)
|
private static IEnumerator FadeThenCoroutine(float length, float totalTime, Action action)
|
||||||
{
|
{
|
||||||
yield return FadeOutCoroutine(length);
|
yield return FadeOutCoroutine(length);
|
||||||
|
|
||||||
|
yield return new WaitForSeconds(totalTime - length);
|
||||||
|
|
||||||
action?.Invoke();
|
action?.Invoke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -970,11 +970,13 @@ namespace NewHorizons
|
|||||||
OWInput.ChangeInputMode(InputMode.None);
|
OWInput.ChangeInputMode(InputMode.None);
|
||||||
|
|
||||||
// Hide unloading
|
// Hide unloading
|
||||||
ManualOnStartSceneLoad(sceneToLoad);
|
// When warping with the ship or vessel there are graphical effects we want to see! Do not pause immediately or cut to black immediately
|
||||||
FadeHandler.FadeThen(1f, () =>
|
// Otherwise we fade to black much quicker. Still wait a bit for the sound effects to finish
|
||||||
|
FadeHandler.FadeThen(IsWarpingFromShip || IsWarpingFromVessel ? 1f : 0.2f, 1.2f, () =>
|
||||||
{
|
{
|
||||||
// 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);
|
||||||
LoadManager.LoadSceneImmediate(sceneToLoad);
|
LoadManager.LoadSceneImmediate(sceneToLoad);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user