mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Neatened up NHGameOverManager.LoadCustomCreditsScene() and added some comments to explain things
This commit is contained in:
parent
6d77b0b1d1
commit
0e6555d933
@ -148,13 +148,12 @@ namespace NewHorizons.Components
|
||||
|
||||
LoadManager.LoadScene(toScene, LoadManager.FadeType.ToBlack);
|
||||
|
||||
// We need to do this so we can unsubscribe from within the lambda.
|
||||
LoadManager.SceneLoadEvent completeCreditsLoad = null;
|
||||
|
||||
// Unfortunately we can't make this a private method, as LoadManager.SceneLoadEvent enforces the (fromScene, toScene) parameters, which prevents us from passing in gameOver and mod, which we need.
|
||||
LoadManager.SceneLoadEvent completeCreditsLoad = null; // needs to be done so we can unsubscribe from within the lambda.
|
||||
completeCreditsLoad = (fromScene, toScene) =>
|
||||
{
|
||||
// Patch new music clip
|
||||
var musicSource = Locator.FindObjectsOfType<OWAudioSource>().Where(x => x.name == "AudioSource").Single();
|
||||
var musicSource = Locator.FindObjectsOfType<OWAudioSource>().Where(x => x.name == "AudioSource").Single(); // AudioSource that plays the credits music is literally called "AudioSource", luckily it's the only one called that. Lazy OW devs do be lazy.
|
||||
if (mod is not null)
|
||||
{
|
||||
AudioUtilities.SetAudioClip(musicSource, gameOver.audio, mod);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user