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(); } }
public SoundTrigger(SapientCalls.Call call, Func <bool, bool> trigger = null) { this.trigger = trigger; this.call = call; }