本文整理汇总了C#中MinerWars.AppCode.Game.Entities.MyEntity类的典型用法代码示例。如果您正苦于以下问题:C# MyEntity类的具体用法?C# MyEntity怎么用?C# MyEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MyEntity类属于MinerWars.AppCode.Game.Entities命名空间,在下文中一共展示了MyEntity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
{
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:7,代码来源:MyHudNotification.cs
示例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);
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:16,代码来源:MyShip.cs
示例3: AddEntity
/// <summary>
/// Adds entity to action entities list
/// </summary>
public void AddEntity(MyEntity entity)
{
if (entity != null)
{
ActionEntities.Add(entity);
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:10,代码来源:MyEditorActionBase.cs
示例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();
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:7,代码来源:MyEditorActionBase.cs
示例5: UpdateEntity
public void UpdateEntity(MyEntity entity)
{
Vector3 position;
Quaternion rotation;
GetValues(m_time, out position, out rotation);
entity.MoveAndRotate(position, Matrix.CreateFromQuaternion(rotation));
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:7,代码来源:MyEntityAnimator.cs
示例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;
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:27,代码来源:MyParticleEffects.cs
示例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;
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:32,代码来源:MySelectionTool.cs
示例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();
}
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:31,代码来源:MyMinesField.cs
示例9: MyScriptWrapper_AlarmLaunched
void MyScriptWrapper_AlarmLaunched(MyEntity prefabContainer, MyEntity enemy)
{
if (prefabContainer.EntityId != null && prefabContainer.EntityId.Value.NumericValue == 155)
{
MyScriptWrapper.ActivateSpawnPoint(153);
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:7,代码来源:MyHubShowcaseMission.cs
示例10: EntityInventoryItemAmountChanged
void EntityInventoryItemAmountChanged(MyEntity entity, MyInventory inventory, MyInventoryItem item, float number)
{
if (MyScriptWrapper.IsPlayerShip(entity))
{
CheckOre();
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:7,代码来源:MyHarvestOreSubmission.cs
示例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;
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:11,代码来源:MyRenderObject.cs
示例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;
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyFortValiantMissionBase.cs
示例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;
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyMeteor.cs
示例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();
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyEditorActionWithObjectBuildersBase.cs
示例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;
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyModelOctree.cs
示例16: GetIntersectionWithSphere
// Return true if object intersects specified sphere.
// This method doesn't return exact point of intersection or any additional data.
// We don't look for closest intersection - so we stop on first intersection found.
public bool GetIntersectionWithSphere(MyEntity physObject, ref BoundingSphere sphere)
{
// Transform sphere from world space to object space
Matrix worldInv = physObject.GetWorldMatrixInverted();
Vector3 positionInObjectSpace = MyUtils.GetTransform(sphere.Center, ref worldInv);
BoundingSphere sphereInObjectSpace = new BoundingSphere(positionInObjectSpace, sphere.Radius);
return m_rootNode.GetIntersectionWithSphere(m_model, ref sphereInObjectSpace);
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:12,代码来源:MyModelOctree.cs
示例17: MyGuiControlEntityUse
protected MyGuiControlEntityUse(IMyGuiControlsParent parent, Vector2 size, MyEntity entity, MyTexture2D texture)
: base(parent, Vector2.Zero, size, Vector4.One, new StringBuilder(entity.DisplayName), MyGuiManager.GetHubItemBackground())
{
m_entity = entity;
m_topLeftPosition = -m_size.Value / 2f + new Vector2(0.025f, 0.025f);
Controls.Add(new MyGuiControlLabel(this, m_topLeftPosition + new Vector2(0.063f, 0.0f), null, GetEntityName(entity), MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue()));
LoadControls();
m_texture = texture;
}
开发者ID:ripark,项目名称:Miner-Wars-2081,代码行数:9,代码来源:MyGuiControlEntityUse.cs
示例18: UpdateGunShot
public static void UpdateGunShot(MyEntity physObject, MyTrailerGunsShotTypeEnum gunShot)
{
// This method will be called even on not-tracker objects, so here we check if we need to store data about this one
MyPhysObjectTrackedTickData tickData = InsertActiveTick(physObject);
if (tickData != null)
{
tickData.GunShot = gunShot;
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:9,代码来源:MyTrailerSave.cs
示例19: MyEditorActionEntityCopy
public MyEditorActionEntityCopy(MyEntity actionEntity)
: base(actionEntity, true)
{
ActionEntities.Clear();
SourceEntities = new List<MyEntity>();
SourceEntities.Add(actionEntity);
AddChildren();
RemapEntityIdsOnInit();
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:9,代码来源:MyEditorActionEntityCopy.cs
示例20: Start
public void Start(Vector3 startPos, Vector3 goalPos, MyEntity goalEntity)
{
m_startPos = startPos;
m_goalPos = goalPos;
m_goalEntity = goalEntity;
Path = new List<Vector3>();
Message = MyTextsWrapper.Get(MyTextsWrapperEnum.GPSNoPath);
goalEntity.OnClose += goalEntity_OnClose;
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:10,代码来源:MyComputeGPSJob.cs
注:本文中的MinerWars.AppCode.Game.Entities.MyEntity类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论