本文整理汇总了C#中Thing.TrueCenter方法的典型用法代码示例。如果您正苦于以下问题:C# Thing.TrueCenter方法的具体用法?C# Thing.TrueCenter怎么用?C# Thing.TrueCenter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thing
的用法示例。
在下文中一共展示了Thing.TrueCenter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Impact
public static void Impact(Thing skyfaller, Thing resultThing)
{
DoRoofPunch(skyfaller.Position);
// max side length of drawSize or actual size etermine result crater radius
var impactRadius = Mathf.Max(Mathf.Max(skyfaller.def.Size.x, skyfaller.def.Size.z), Mathf.Max(skyfaller.Graphic.drawSize.x, skyfaller.Graphic.drawSize.y)) * 2;
// Throw some dust puffs
for (var i = 0; i < 6; i++)
{
var loc = skyfaller.TrueCenter() + Gen.RandomHorizontalVector(1f);
MoteMaker.ThrowDustPuff(loc, 1.2f);
}
// Throw a quick flash
MoteMaker.ThrowLightningGlow(skyfaller.TrueCenter(), impactRadius);
// Spawn the crater
var crater = (Crater)ThingMaker.MakeThing(ThingDef.Named("Crater"));
// adjust result crater size to the impact zone radius
crater.impactRadius = impactRadius;
// make explosion in the impact area
DoImpactExplosion(skyfaller, impactRadius);
// MapComponent Injector
if (!Find.Map.components.Exists(component => component.GetType() == typeof(MapCompCameraShaker)))
Find.Map.components.Add(new MapCompCameraShaker());
// Do a bit of camera shake for added effect
MapCompCameraShaker.DoShake(impactRadius * 0.02f);
// spawn the crater, rotated to the random angle, to provide visible variety
GenSpawn.Spawn(crater, skyfaller.Position, Rot4.North);
// place the impact result thing
//GenPlace.TryPlaceThing(resultThing, skyfaller.Position, ThingPlaceMode.Near);
if (resultThing != null)
GenSpawn.Spawn(resultThing, skyfaller.Position);
// Destroy incoming pod
skyfaller.Destroy();
}