示例#1
0
 public void PlaySound(SapientCalls.Call sound)
 {
     if (sound != null && Find.CameraDriver.CurrentViewRect.ExpandedBy(10).Contains(Pawn.Position))
     {
         SoundInfo info = SoundInfo.InMap(new TargetInfo(Pawn.PositionHeld, Pawn.MapHeld));
         Rand.PushState();
         sound.sound.PlayOneShot(info);
         Rand.PopState();
     }
 }
示例#2
0
 public SoundTrigger(SapientCalls.Call call, Func <bool, bool> trigger = null)
 {
     this.trigger = trigger;
     this.call    = call;
 }