static SfxEntry GetVanilla(SoundEffect[] es, SfxPlayBehaviour b = SfxPlayBehaviour.Singleton, bool ambient = false) { return(new SfxEntry(i => { var e = es[i == -1 || i >= es.Length ? Main.rand.Next(es.Length) : i]; return e == null ? null : e.CreateInstance(); }, es.Length, _ => b, ambient)); }
static SfxEntry GetVanilla(SoundEffect[] es, SfxPlayBehaviour b = SfxPlayBehaviour.Singleton, bool ambient = false) { return new SfxEntry(i => { var e = es[i == -1 || i >= es.Length ? Main.rand.Next(es.Length) : i]; return e == null ? null : e.CreateInstance(); }, es.Length, _ => b, ambient); }
static SfxEntry GetVanilla(SoundEffect e , SfxPlayBehaviour b = SfxPlayBehaviour.Singleton, bool ambient = false) { return new SfxEntry(e.CreateInstance, b, ambient); }
public SfxEntry(Func <SoundEffectInstance> getInstance, SfxPlayBehaviour behaviour, bool ambient = false) : this(_ => getInstance(), 1, _ => behaviour, ambient) { }
static SfxEntry GetVanilla(SoundEffect e, SfxPlayBehaviour b = SfxPlayBehaviour.Singleton, bool ambient = false) { return(new SfxEntry(e.CreateInstance, b, ambient)); }