-
Notifications
You must be signed in to change notification settings - Fork 1
/
MusicSystem.cs
41 lines (37 loc) · 1.34 KB
/
MusicSystem.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Walgelijk;
namespace MadnessMicroactive;
public class MusicSystem : Walgelijk.System
{
private static Sound splitmek = SoundCache.Instance.LoadMusicNonLoop(Resources.Load<StreamAudioData>("music/splitmek.ogg"));
private static Sound jebus = SoundCache.Instance.LoadMusicNonLoop(Resources.Load<StreamAudioData>("music/jebus.ogg"));
private static Sound monks = SoundCache.Instance.LoadMusicNonLoop(Resources.Load<StreamAudioData>("music/monks.ogg"));
public override void FixedUpdate()
{
if (Scene.HasSystem<MenuScene.MainMenuSystem>())
{
Audio.Stop(jebus);
Audio.Stop(monks);
if (!Audio.IsPlaying(splitmek))
Audio.Play(splitmek);
}
else if (Scene.FindAnyComponent<DeathSequenceComponent>(out var _))
{
Audio.Stop(splitmek);
Audio.Stop(jebus);
Audio.Stop(monks);
}
else if (Scene.FindAnyComponent<BossControllerComponent>(out _))
{
Audio.Stop(splitmek);
Audio.Stop(monks);
if (!Audio.IsPlaying(jebus))
Audio.Play(jebus);
}
else
{
Audio.Stop(jebus);
if (!Audio.IsPlaying(splitmek) && !Audio.IsPlaying(monks))
Audio.Play(Utilities.PickRandom(splitmek, monks));
}
}
}