當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。