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


C# IMyEntity.nameWithId方法代码示例

本文整理汇总了C#中IMyEntity.nameWithId方法的典型用法代码示例。如果您正苦于以下问题:C# IMyEntity.nameWithId方法的具体用法?C# IMyEntity.nameWithId怎么用?C# IMyEntity.nameWithId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMyEntity的用法示例。


在下文中一共展示了IMyEntity.nameWithId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CurrentState

 public static MyCharacterMovementEnum CurrentState(IMyEntity character)
 {
     CharacterStateTracker tracker;
     if (!Registrar.TryGetValue(character, out tracker))
     {
         Logger.alwaysLog("CharacterStateTracker", "Failed lookup of character: " + character.nameWithId(), Logger.severity.WARNING);
         return MyCharacterMovementEnum.Died; // most likely deleted
     }
     return tracker.m_currentState;
 }
开发者ID:Souper07,项目名称:Autopilot,代码行数:10,代码来源:CharacterStateTracker.cs

示例2: SetupProjection

        /// <summary>
        /// Prepare a projected entity by disabling physics, game logic, etc.
        /// </summary>
        private static void SetupProjection(IMyEntity entity)
        {
            Static.logger.debugLog(entity is IMyCubeGrid, "setup: " + entity.nameWithId());
            if (entity is IMyCubeBlock)
            {
                IMyCubeBlock block2 = (IMyCubeBlock)entity;
                Static.logger.debugLog("setup: " + block2.nameWithId() + ", on " + block2.CubeGrid.nameWithId());
            }

            if (entity.Physics != null && entity.Physics.Enabled)
                entity.Physics.Enabled = false;

            Static.logger.debugLog("initial flags: " + entity.Flags);

            entity.Flags &= ~EntityFlags.Save;
            entity.Flags &= ~EntityFlags.Sync;
            entity.NeedsUpdate = MyEntityUpdateEnum.NONE;
            ((MyEntity)entity).IsPreview = true;

            Static.logger.debugLog("final flags: " + entity.Flags);

            MyCubeBlock block = entity as MyCubeBlock;
            if (block != null)
            {
                if (block.UseObjectsComponent.DetectorPhysics != null && block.UseObjectsComponent.DetectorPhysics.Enabled)
                    block.UseObjectsComponent.DetectorPhysics.Enabled = false;
                //block.NeedsUpdate = MyEntityUpdateEnum.NONE;

                if (block is Ingame.IMyBeacon || block is Ingame.IMyRadioAntenna)
                    ((IMyFunctionalBlock)block).RequestEnable(false);
            }

            foreach (var child in entity.Hierarchy.Children)
                SetupProjection(child.Container.Entity);
        }
开发者ID:Souper07,项目名称:Autopilot,代码行数:38,代码来源:Projector.cs


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