本文整理汇总了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;
}
示例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);
}