Stop the audio error log from happening

No more "Audio source track is Undefined, moving to Menu track"
This commit is contained in:
Noah Pilarski 2022-07-18 15:30:37 -04:00
parent b2fb622bbb
commit cdc4086cce

View File

@ -37,9 +37,13 @@ namespace NewHorizons.Components
MakeWhiteHole();
_isWarpingIn = false;
_oneShotSource = gameObject.AddComponent<OWAudioSource>();
var audioObject = new GameObject("WarpOneShot");
audioObject.transform.parent = transform;
audioObject.SetActive(false);
_oneShotSource = audioObject.AddComponent<OWAudioSource>();
_oneShotSource._track = OWAudioMixer.TrackName.Ship;
audioObject.SetActive(true);
GlobalMessenger.AddListener("FinishOpenEyes", new Callback(OnFinishOpenEyes));
}