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


C# Entities.MyEntity类代码示例

本文整理汇总了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)
 {
 }
开发者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


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