本文整理汇总了C#中MinerWars.AppCode.Game.Entities.MyEntity类的典型用法代码示例。如果您正苦于以下问题:C# MyEntity类的具体用法?C# MyEntity怎么用?C# MyEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MyEntity类属于MinerWars.AppCode.Game.Entities命名空间,在下文中一共展示了MyEntity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MyNotification
public MyNotification(MyTextsWrapperEnum notificationText, int disapearTimeMs, MyEntity owner = null,
object[] textFormatArguments = null)
: this(notificationText, GetCurrentScreen(), 1.0f, MyGuiConstants.DEFAULT_CONTROL_FONT,
MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, disapearTimeMs, owner, false,
textFormatArguments)
{
}
示例2: Init
/// <summary>
/// Inits the specified hud label text.
/// </summary>
/// <param name="hudLabelText">The hud label text.</param>
/// <param name="modelLod0Enum">The model lod0 enum.</param>
/// <param name="modelLod1Enum">The model lod1 enum.</param>
/// <param name="parentObject">The parent object.</param>
/// <param name="scale">The scale.</param>
/// <param name="objectBuilder">The object builder.</param>
public override void Init(StringBuilder hudLabelText, MyModelsEnum? modelLod0Enum, MyModelsEnum? modelLod1Enum, MyEntity parentObject, float? scale, MyMwcObjectBuilder_Base objectBuilder, MyModelsEnum? modelCollision = null, Models.MyModelsEnum? modelLod2 = null)
{
Flags |= EntityFlags.EditableInEditor;
NeedsUpdate = true;
base.Init(hudLabelText, modelLod0Enum, modelLod1Enum, null, scale, objectBuilder, modelCollision, modelLod2);
}
示例3: AddEntity
/// <summary>
/// Adds entity to action entities list
/// </summary>
public void AddEntity(MyEntity entity)
{
if (entity != null)
{
ActionEntities.Add(entity);
}
}
示例4: MyEditorActionBase
public MyEditorActionBase(MyEntity entity)
{
MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartProfilingBlock("MyEditorActionBase::ctor");
Init(1);
AddEntity(entity);
MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().EndProfilingBlock();
}
示例5: UpdateEntity
public void UpdateEntity(MyEntity entity)
{
Vector3 position;
Quaternion rotation;
GetValues(m_time, out position, out rotation);
entity.MoveAndRotate(position, Matrix.CreateFromQuaternion(rotation));
}
示例6: GetEffectForWeapon
static MyParticleEffect GetEffectForWeapon(MyEntity weapon, int effectID)
{
Dictionary<int, MyParticleEffect> effects;
m_hitParticles.TryGetValue(weapon, out effects);
if (effects == null)
{
effects = new Dictionary<int, MyParticleEffect>();
m_hitParticles.Add(weapon, effects);
}
MyParticleEffect effect;
effects.TryGetValue(effectID, out effect);
if (effect == null)
{
effect = MyParticlesManager.CreateParticleEffect(effectID);
effects.Add(effectID, effect);
effect.Tag = weapon;
effect.OnDelete += new EventHandler(effect_OnDelete);
}
else
{
effect.Restart();
}
return effect;
}
示例7: GetSelectableEntity
/// <summary>
/// GetSelectableEntity - return top most parent which can be selectable (in case of weapons slection return ship!)
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public static MyEntity GetSelectableEntity(MyEntity entity)
{
if (entity == null)
return null;
if (entity.Parent == null)
{
if (entity.IsSelectable())
return entity;
else
return null;
}
MyEntity currEntity = entity;
MyEntity topMostSelectable = (currEntity.IsSelectable()) ? currEntity : null; //store
while (currEntity.Parent != null)
{
if (currEntity.IsSelectableAsChild() && currEntity.IsSelectable())
return currEntity;
currEntity = currEntity.Parent;
if (currEntity.IsSelectable())
topMostSelectable = currEntity;
}
return topMostSelectable;
}
示例8: mineDetector_OnEntityPositionChange
private void mineDetector_OnEntityPositionChange(MyEntityDetector sender, MyEntity entity, Vector3 newposition)
{
if (sender.Closed)
return;
if (entity == MySession.PlayerShip)
{
if (m_beepCue == null || !m_beepCue.Value.IsPlaying)
{
m_beepCue = MyAudio.AddCue2D(MySoundCuesEnum.SfxHudAlarmDamageA);
}
float distance = (entity.GetPosition() - sender.GetPosition()).Length();
if (distance < m_mineStartRadius)
{
uint mineId = 0;
for (int i = 0; i < m_mines.GetLength(0); i++)
{
if (m_mines[i, 1] == sender.Parent.EntityId.Value.NumericValue)
{
mineId = m_mines[i, 0];
}
}
ExplodeMine(mineId);
sender.Off();
sender.Parent.MarkForClose();
}
}
}
示例9: MyScriptWrapper_AlarmLaunched
void MyScriptWrapper_AlarmLaunched(MyEntity prefabContainer, MyEntity enemy)
{
if (prefabContainer.EntityId != null && prefabContainer.EntityId.Value.NumericValue == 155)
{
MyScriptWrapper.ActivateSpawnPoint(153);
}
}
示例10: EntityInventoryItemAmountChanged
void EntityInventoryItemAmountChanged(MyEntity entity, MyInventory inventory, MyInventoryItem item, float number)
{
if (MyScriptWrapper.IsPlayerShip(entity))
{
CheckOre();
}
}
示例11: MyRenderObject
public MyMwcVector3Int? RenderCellCoord; //Render cell coordinate if voxel
public MyRenderObject(MyEntity entity, MyMwcVector3Int? renderCellCoord)
{
Entity = entity;
Flags = MyElementFlag.EF_AABB_DIRTY;
m_renderFlags = RenderFlags.SkipIfTooSmall | RenderFlags.NeedsResolveCastShadow;
RenderCellCoord = renderCellCoord;
}
示例12: ScannerOnOnEntityScanned
private void ScannerOnOnEntityScanned(MyPrefabScanner sender, MyEntity scannedEntity)
{
if (scannedEntity == MySession.PlayerShip && m_scanners.Contains(sender))
{
scannedEntity.DoDamage(0, 1000000, 0, MyDamageType.Unknown, MyAmmoType.Unknown, null);
((MyPrefabContainer) sender.Parent).AlarmOn = true;
}
}
示例13: Init
public override void Init(StringBuilder displayName, Models.MyModelsEnum? modelLod0Enum, Models.MyModelsEnum? modelLod1Enum, MyEntity parentObject, float? scale, CommonLIB.AppCode.ObjectBuilders.MyMwcObjectBuilder_Base objectBuilder, Models.MyModelsEnum? modelCollision = null, Models.MyModelsEnum? modelLod2Enum = null)
{
base.Init(displayName, modelLod0Enum, modelLod1Enum, parentObject, scale, objectBuilder, modelCollision, modelLod2Enum);
this.CastShadows = false;
this.NeedsUpdate = true;
this.Save = false;
}
示例14: MyEditorActionWithObjectBuildersBase
public MyEditorActionWithObjectBuildersBase(MyEntity actionEntity, bool getExactCopy = false)
: base(actionEntity)
{
MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartProfilingBlock("MyEditorActionWithObjectBuildersBase::ctor");
this.Init(1);
ActionObjectBuilders.Add(new ObjectBuilderCreate(actionEntity, getExactCopy));
MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().EndProfilingBlock();
}
示例15: GetIntersectionWithLine
public MyIntersectionResultLineTriangleEx? GetIntersectionWithLine(MyEntity physObject, ref MyLine line, ref Matrix customInvMatrix, IntersectionFlags flags)
{
MyLine lineInModelSpace = new MyLine(MyUtils.GetTransform(line.From, ref customInvMatrix), MyUtils.GetTransform(line.To, ref customInvMatrix), true);
MyIntersectionResultLineTriangleEx? ret = m_rootNode.GetIntersectionWithLine(physObject, m_model, ref lineInModelSpace, null, flags);
return ret;
}