示例#1
0
 private void PlayExplosionSound(SoundDef explosionSound)
 {
     if ((!Prefs.DevMode) ? (!explosionSound.NullOrUndefined()) : (explosionSound != null))
     {
         explosionSound.PlayOneShot(new TargetInfo(base.Position, base.Map));
     }
     else
     {
         damType.soundExplosion.PlayOneShot(new TargetInfo(base.Position, base.Map));
     }
 }
示例#2
0
        private static void PlayExplosionSound2(Explosion __instance, SoundDef explosionSound)
        {
            Thing thing = __instance;

            if ((!Prefs.DevMode) ? (!explosionSound.NullOrUndefined()) : (explosionSound != null))
            {
                SoundStarter_Patch.PlayOneShot(explosionSound, (new TargetInfo(thing.Position, thing.Map)));
            }
            else
            {
                SoundStarter_Patch.PlayOneShot(__instance.damType.soundExplosion, new TargetInfo(thing.Position, thing.Map));
            }
        }
        private void PlayExplosionSound(SoundDef explosionSound)
        {
            bool flag;

            if (Prefs.DevMode)
            {
                flag = (explosionSound != null);
            }
            else
            {
                flag = !explosionSound.NullOrUndefined();
            }
            if (flag)
            {
                explosionSound.PlayOneShot(new TargetInfo(base.Position, base.Map, false));
                return;
            }
            this.damType.soundExplosion.PlayOneShot(new TargetInfo(base.Position, base.Map, false));
        }
示例#4
0
 public static void PlayImpactSound(Thing hitThing, ImpactSoundTypeDef ist, Map map)
 {
     if (ist != null && (!ist.playOnlyIfHitPawn || hitThing is Pawn))
     {
         if (map == null)
         {
             Log.Warning("Can't play impact sound because map is null.");
         }
         else
         {
             SoundDef soundDef = null;
             soundDef = ((hitThing.Stuff == null) ? hitThing.def.soundImpactDefault : hitThing.Stuff.stuffProps.soundImpactStuff);
             if (soundDef.NullOrUndefined())
             {
                 soundDef = SoundDefOf.BulletImpact_Ground;
             }
             soundDef.PlayOneShot(new TargetInfo(hitThing.PositionHeld, map));
         }
     }
 }