mirror of
https://github.com/FalloutCollaborationProject/FCP-Tools.git
synced 2026-07-27 16:59:37 -07:00
27 lines
755 B
C#
27 lines
755 B
C#
using Verse.Sound;
|
|
|
|
namespace FCP.Core;
|
|
|
|
public class CompFlyingPawn : ThingComp
|
|
{
|
|
public CompProperties_FlyingPawn Props => props as CompProperties_FlyingPawn;
|
|
|
|
public Pawn pawn => parent as Pawn;
|
|
|
|
public bool isFlyingCurrently;
|
|
|
|
public void ChangeGraphic(bool withSound = false)
|
|
{
|
|
pawn.Drawer.renderer.renderTree.SetDirty();
|
|
|
|
if (!withSound || Props.soundOnFly == null) return;
|
|
SoundInfo info = SoundInfo.InMap(new TargetInfo(pawn.PositionHeld, pawn.MapHeld));
|
|
Props.soundOnFly.PlayOneShot(info);
|
|
}
|
|
|
|
public override void PostExposeData()
|
|
{
|
|
base.PostExposeData();
|
|
Scribe_Values.Look(ref isFlyingCurrently, "isFlyingCurrently");
|
|
}
|
|
} |