public override void DrawAt(Vector3 drawLoc, bool flip = false) { if (this.innerContainer.Any) { foreach (var item in innerContainer) { ActiveFlyer flyer = item as ActiveFlyer; if (flyer != null) { if (flyer.GetThingForGraphic() != null) { Pawn p = flyer.GetThingForGraphic() as Pawn; if (p != null) { // p.rotationTracker.Face(base.Position.ToVector3()); float angle = (base.Position.ToVector3() - drawLoc).AngleFlat(); p.Rotation = Pawn_RotationTracker.RotFromAngleBiased(angle); p.Drawer.DrawAt(drawLoc); return; } } } } } base.DrawAt(drawLoc, flip); }
public static void MakeFlyerLandAt(IntVec3 c, Map map, ActiveDropPodInfo info, FactionDefExtension extension = null) { ThingDef ActiveDropPod = DefDatabase <ThingDef> .GetNamed("OG_Active_DeepStrike_Flyer"); ThingDef DropPodIncoming = DefDatabase <ThingDef> .GetNamed("OG_DeepStrike_Flyer_Incoming"); ActiveFlyer activeDropPod = (ActiveFlyer)ThingMaker.MakeThing(ActiveDropPod, null); activeDropPod.Contents = info; activeDropPod.Contents.leaveSlag = false; SkyfallerMaker.SpawnSkyfaller(DropPodIncoming, activeDropPod, c, map); }
public Thing GetThingForGraphic() { if (thingforgfx == null) { ActiveFlyer flyer = innerContainer[0] as ActiveFlyer; if (flyer != null) { if (flyer.GetThingForGraphic() != null) { Pawn p = flyer.GetThingForGraphic() as Pawn; if (p != null) { thingforgfx = flyer.GetThingForGraphic(); } } } } return(thingforgfx); }