本文整理汇总了C#中IntVec3.GetBeltComponent方法的典型用法代码示例。如果您正苦于以下问题:C# IntVec3.GetBeltComponent方法的具体用法?C# IntVec3.GetBeltComponent怎么用?C# IntVec3.GetBeltComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IntVec3
的用法示例。
在下文中一共展示了IntVec3.GetBeltComponent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveThingTo
protected override void MoveThingTo([NotNull] Thing thing, IntVec3 beltDest)
{
OnBeginMove(thing, beltDest);
// Lifts only output to surface
var belt = beltDest.GetBeltComponent();
// Check if there is a belt, if it is empty, and also check if it is active !
if (belt == null || !belt.ItemContainer.Empty || belt.BeltPhase != Phase.Active)
{
return;
}
ItemContainer.TransferItem(thing, belt.ItemContainer);
// Need to check if it is a receiver or not ...
belt.ThingOrigin = parent.Position;
}
示例2: MoveThingTo
// This is a fast function for surface belts, underground belts must extend and override
protected virtual void MoveThingTo([NotNull] Thing thing, IntVec3 beltDest)
{
OnBeginMove(thing, beltDest);
if (CanOutputToNonBelt() && Find.TerrainGrid.TerrainAt(beltDest).changeable)
{
ItemContainer.DropItem(thing, beltDest);
}
else if ( OutputLevel == Level.Surface )
{
// Find a belt component at our output level
var belt = beltDest.GetBeltComponent();
// Check if there is a belt, if it is empty, and also check if it is active !
if (belt == null || !belt.ItemContainer.Empty || belt.BeltPhase != Phase.Active)
{
return;
}
ItemContainer.TransferItem(thing, belt.ItemContainer);
// Need to check if it is a receiver or not ...
belt.ThingOrigin = parent.Position;
}
}
示例3: GetSenderAtPos
public static Sender GetSenderAtPos(IntVec3 pos)
{
return pos.GetBeltComponent() as Sender;
}
示例4: GetReceiverAtPos
public static Receiver GetReceiverAtPos(IntVec3 pos)
{
return pos.GetBeltComponent() as Receiver;
}
示例5: IsFreeBelt
protected bool IsFreeBelt(IntVec3 position)
{
BeltComponent destBelt = position.GetBeltComponent();
return (destBelt != null && destBelt.CanAcceptFrom(this));
}
示例6: IsFreeBelt
private bool IsFreeBelt(IntVec3 position, bool onlyCheckConnection = false)
{
BeltComponent destBelt = position.GetBeltComponent();
return (destBelt != null && destBelt.CanAcceptFrom(this, onlyCheckConnection));
}