public AltSupportingBgm(IBgm regular, IBgm alternate, SwitchMode switchMode) { Regular = regular; Alt = alternate; SwitchMode = switchMode; current = Regular; }
public AltSupportingBgm(IBgm regular, IBgm alternate, SwitchMode switchMode) { Regular = regular; Alt = alternate; SwitchMode = switchMode; current = Regular; }
public AltSupportingBgm(IBgm regular, IBgm alternate, SwitchMode switchMode) { #pragma warning disable RECS0021 Regular = regular; Alt = alternate; SwitchMode = switchMode; current = Regular; #pragma warning restore RECS0021 }
public AltSupportingBgm(IBgm regular, IBgm alternate, SwitchMode switchMode) { #pragma warning disable RECS0021 Regular = regular; Alt = alternate; SwitchMode = switchMode; current = Regular; #pragma warning restore RECS0021 }
public void Play() { if (current == null || current.State == SoundState.Stopped) { switch (SwitchMode) { case SwitchMode.Random: current = Main.rand.Next(2) == 0 ? Regular : Alt; break; case SwitchMode.Alternate: current = current == null || current == Alt ? Regular : Alt; break; } } current.Play(); }
public BgmEntry(IBgm music, BgmPriority priority, Func <bool> play) { Music = music; Priority = priority; ShouldPlay = play; }
public void Play() { if (current == null || current.State == SoundState.Stopped) switch (SwitchMode) { case SwitchMode.Random: current = Main.rand.Next(2) == 0 ? Regular : Alt; break; case SwitchMode.Alternate: current = current == null || current == Alt ? Regular : Alt; break; } current.Play(); }