本文整理汇总了C#中MinerWars.AppCode.Game.Entities.MyEntity.HighlightEntity方法的典型用法代码示例。如果您正苦于以下问题:C# MyEntity.HighlightEntity方法的具体用法?C# MyEntity.HighlightEntity怎么用?C# MyEntity.HighlightEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MinerWars.AppCode.Game.Entities.MyEntity
的用法示例。
在下文中一共展示了MyEntity.HighlightEntity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddEntityToSelection
/// <summary>
/// Adds entity to selection
/// </summary>
/// <param name="entity"></param>
public static void AddEntityToSelection(MyEntity entity)
{
////if animated - disable animation
//MyEntities.RegisterForStopAnimations(entity);
if (!(entity is MinerWars.AppCode.Game.Entities.InfluenceSpheres.MyInfluenceSphere))
{
UnregistreEntityFromUpdateRecursive(entity);
}
if (MyFakes.POST_MYENTITYANIMATOR_VALUES)
{
Quaternion rotation = Quaternion.CreateFromRotationMatrix(entity.WorldMatrix);
Debug.WriteLine(string.Format("animator.AddKey(,new Vector3({0:0.0##}f, {1:0.0##}f, {2:0.0##}f), new Quaternion({3:0.0##}f, {4:0.0##}f, {5:0.0##}f, {6:0.0##}f));",
entity.WorldMatrix.Translation.X, entity.WorldMatrix.Translation.Y, entity.WorldMatrix.Translation.Z,
rotation.X, rotation.Y, rotation.Z, rotation.W));
}
// disable selecting another prefabs or object except ones in prefab container
if (MyEditor.Static.GetEditedPrefabContainer() != null)
{
MyPrefabContainer selectedPrefabContainer = null;
MyEntity selectedEntity = entity;
while (selectedEntity != null)
{
selectedPrefabContainer = selectedEntity.Parent as MyPrefabContainer;
if (selectedPrefabContainer != null)
break;
selectedEntity = selectedEntity.Parent;
}
if (selectedPrefabContainer != MyEditor.Static.GetEditedPrefabContainer())
return;
}
if (entity == MyEditor.Static.GetEditedPrefabContainer()) return;
if (SelectedSnapPoint != null) return;
entity = MySelectionTool.GetSelectableEntity(entity);
if (entity != null)
{
/*
if (entity is MyPrefabLargeWeapon)
{
((MyPrefabLargeWeapon)entity).GetGun().ForceDeactivate();
((MyPrefabLargeWeapon)entity).GetGun().HighlightEntity(ref MyEditorConstants.SELECTED_OBJECT_DIFFUSE_COLOR_ADDITION);
entity.HighlightEntity(ref MyEditorConstants.SELECTED_OBJECT_DIFFUSE_COLOR_ADDITION);
} */
//@ get selectable entity
if (SelectedEntities.Contains(entity) == false)
{
//@ hack coz prefab containers
if (MyEditor.Static.GetEditedPrefabContainer() != null && MyEditor.Static.GetEditedPrefabContainer().HasEditState())
MyEditor.Static.GetEditedPrefabContainer().UpdateEditedNode(entity);
SelectedEntities.Add(entity);
}
if (entity is MyVoxelMap) SwitchGizmoMode();
entity.HighlightEntity(ref MyEditorConstants.SELECTED_OBJECT_DIFFUSE_COLOR_ADDITION);
}
}