Пример #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);
        }
Пример #2
0
 static SfxEntry GetVanilla(SoundEffect   e , SfxPlayBehaviour b = SfxPlayBehaviour.Singleton, bool ambient = false)
 {
     return new SfxEntry(e.CreateInstance, b, ambient);
 }