当前位置: 首页>>代码示例>>C#>>正文


C# IntVec3.GetBeltComponent方法代码示例

本文整理汇总了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;
        }
开发者ID:686d7066,项目名称:RW_A2B,代码行数:18,代码来源:BeltLiftComponent.cs

示例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;
            }
        }
开发者ID:686d7066,项目名称:RW_A2B,代码行数:26,代码来源:BeltComponent.cs

示例3: GetSenderAtPos

 public static Sender GetSenderAtPos(IntVec3 pos)
 {
     return pos.GetBeltComponent() as Sender;
 }
开发者ID:686d7066,项目名称:RW_A2B_Teleporter,代码行数:4,代码来源:A2BTeleporterManager.cs

示例4: GetReceiverAtPos

 public static Receiver GetReceiverAtPos(IntVec3 pos)
 {
     return pos.GetBeltComponent() as Receiver;
 }
开发者ID:686d7066,项目名称:RW_A2B_Teleporter,代码行数:4,代码来源:A2BTeleporterManager.cs

示例5: IsFreeBelt

 protected bool IsFreeBelt(IntVec3 position)
 {
     BeltComponent destBelt = position.GetBeltComponent();
     return (destBelt != null && destBelt.CanAcceptFrom(this));
 }
开发者ID:686d7066,项目名称:RW_A2B,代码行数:5,代码来源:BeltSelectorComponent.cs

示例6: IsFreeBelt

 private bool IsFreeBelt(IntVec3 position, bool onlyCheckConnection = false)
 {
     BeltComponent destBelt = position.GetBeltComponent();
     return (destBelt != null && destBelt.CanAcceptFrom(this, onlyCheckConnection));
 }
开发者ID:686d7066,项目名称:RW_A2B,代码行数:5,代码来源:BeltSplitterComponent.cs


注:本文中的IntVec3.GetBeltComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。