Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 static SfxEntry GetVanilla(SoundEffect   e , SfxPlayBehaviour b = SfxPlayBehaviour.Singleton, bool ambient = false)
 {
     return new SfxEntry(e.CreateInstance, b, ambient);
 }
Ejemplo n.º 4
0
 public SfxEntry(Func <SoundEffectInstance> getInstance, SfxPlayBehaviour behaviour, bool ambient = false)
     : this(_ => getInstance(), 1, _ => behaviour, ambient)
 {
 }
Ejemplo n.º 5
0
 static SfxEntry GetVanilla(SoundEffect e, SfxPlayBehaviour b = SfxPlayBehaviour.Singleton, bool ambient = false)
 {
     return(new SfxEntry(e.CreateInstance, b, ambient));
 }