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


C# EntityDetector.MyEntityDetector类代码示例

本文整理汇总了C#中MinerWars.AppCode.Game.Entities.EntityDetector.MyEntityDetector的典型用法代码示例。如果您正苦于以下问题:C# MyEntityDetector类的具体用法?C# MyEntityDetector怎么用?C# MyEntityDetector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MyEntityDetector类属于MinerWars.AppCode.Game.Entities.EntityDetector命名空间,在下文中一共展示了MyEntityDetector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UnregisterSlowDetectorForUpdate

        public static void UnregisterSlowDetectorForUpdate(MyEntityDetector detector)
        {
            m_slowDetectors.Remove(detector);
            m_currentDetectorIndex = 0;

            UpdateEntitiesPerFrame();
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:7,代码来源:MyEntityDetectorsManager.cs

示例2: RegisterSlowDetectorForUpdate

        public static void RegisterSlowDetectorForUpdate(MyEntityDetector detector)
        {
            m_slowDetectors.Add(detector);
            detector.UpdateCounter = GlobalSlowDetectorCounter++;

            UpdateEntitiesPerFrame();
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:7,代码来源:MyEntityDetectorsManager.cs

示例3: 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

示例4: CanBeSlowDetectorUpdated

        public static bool CanBeSlowDetectorUpdated(MyEntityDetector detector)
        {
            Debug.Assert(m_slowDetectors.Count > m_currentDetectorIndex);
            int index = detector.UpdateCounter % m_slowDetectors.Count;
            if (index >= m_currentDetectorIndex && index < m_currentDetectorIndex + m_entitiesPerFrameToUpdate)
                return true;

            return false;
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:9,代码来源:MyEntityDetectorsManager.cs

示例5: DetectorOnOnEntityEnter

        private void DetectorOnOnEntityEnter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
        {
            var isEnteredWithDrone = MyGuiScreenGamePlay.Static.IsControlledDrone &&
                                    entity == MyGuiScreenGamePlay.Static.ControlledDrone;

            if(MyScriptWrapper.IsPlayerShip(entity) || isEnteredWithDrone)
            {
                m_detector.Off();
                MyScriptWrapper.PlayDialogue(m_dialogueId);
                if (OnDialogStarted != null) OnDialogStarted();
            }
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:12,代码来源:MyDetectorDialogue.cs

示例6: OnDetector

        void OnDetector(MyEntityDetector sender, MyEntity entity, int meetCriterias)
        {
            if (entity != null && entity == MinerWars.AppCode.Game.Managers.Session.MySession.PlayerShip)
            {
                MyScriptWrapper.OnSpawnpointBotSpawned += OnSpawnpointBotSpawned;
                MyScriptWrapper.EntityDeath += EntityDeath;

                SpawnNewWave(0);

                m_detector.OnEntityEnter -= OnDetector;
            }
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:12,代码来源:MySpawnpointWaves.cs

示例7: DialogueBase

 private void DialogueBase(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == MySession.PlayerShip)
     {
         MyScriptWrapper.PlayDialogue(Audio.Dialogues.MyDialogueEnum.RIFT_0200_STATION);
         MissionTimer.RegisterTimerAction(24000, DialogueBaseCont, false);
         sender.Off();
     }
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:9,代码来源:MyRiftMission.cs

示例8: RiftLeft

        private void RiftLeft(MyEntityDetector sender, MyEntity entity)
        {
            if (entity == MySession.PlayerShip)
            {
                // stop shakes
                m_riftShake = false;

                MyScriptWrapper.PlayDialogue(Audio.Dialogues.MyDialogueEnum.RIFT_1100_LEAVING);
            }
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:10,代码来源:MyRiftMission.cs

示例9: RiftReached

        private void RiftReached(MyEntityDetector sender, MyEntity entity, int meetCriterias)
        {
            if (entity == MySession.PlayerShip)
            {
                //MyAudio.ApplyTransition(MyMusicTransitionEnum.Mystery);

                // start shakes
                m_riftShake = true;
                MissionTimer.RegisterTimerAction(MyMwcUtils.GetRandomInt(4000, 12000), m_farExplosionAction, false);
            }
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:11,代码来源:MyRiftMission.cs

示例10: DummyNearVolodia_Enter

 void DummyNearVolodia_Enter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (MyScriptWrapper.IsPlayerShip(entity))
     {
         MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_0700_STRANGERPROPOSAL);
         sender.Off();
     }
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyRussianTransmitterMission.cs

示例11: Detector3Action

 public void Detector3Action(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (MySession.IsPlayerShip(entity))
     {
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawn3);
         m_Detector3.Off();
     }
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyArabianBorderMission.cs

示例12: M03DetectorOnOnEntityEnter

 private void M03DetectorOnOnEntityEnter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == MySession.PlayerShip)
     {
         var madelynLocation = MyScriptWrapper.GetEntity((uint)EntityID.RunForYourLifeMovingMadelyn);
         MyScriptWrapper.Move(m_madelyn, madelynLocation.GetPosition(), madelynLocation.GetForward(), madelynLocation.GetUp());
         sender.Off();
     }
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:9,代码来源:MyAlienGateMission.cs

示例13: EscapeEvent

        private void EscapeEvent(MyEntityDetector sender, MyEntity entity, int meetcriterias)
        {
            if (MyMissions.ActiveMission != null && MyMissions.ActiveMission.ActiveObjectives != null && MyMissions.ActiveMission.ActiveObjectives.Contains(m_escape))
            {
                MyScriptWrapper.AddExplosions(new List<uint>() { (uint)EntityID.EscapeEventDummyToActive1, (uint)EntityID.EscapeEventDummyToActive2 }, Explosions.MyExplosionTypeEnum.LARGE_SHIP_EXPLOSION, 100);

                MyScriptWrapper.SetEntityEnabled(MyScriptWrapper.GetEntity((uint)EntityID.ParticleDummy1), false);
                MyScriptWrapper.SetEntityEnabled(MyScriptWrapper.GetEntity((uint)EntityID.ParticleDummy2), false);
                ShowContainer(EntityID.InvisibleContainer3);
                MyScriptWrapper.AddVoxelHand((uint)EntityID.VoxelMap, 2203550, 100, MyMwcVoxelMaterialsEnum.Stone_03, MyMwcVoxelHandModeTypeEnum.SUBTRACT);
                MyScriptWrapper.AddVoxelHand((uint)EntityID.VoxelMap, 2203550, 61, MyMwcVoxelMaterialsEnum.Stone_03, MyMwcVoxelHandModeTypeEnum.SUBTRACT);
                MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnPointEscape);

                this.Components.Add(new MyHeadshake(MissionTimer.ElapsedTime, MyHeadshake.DefaultShaking, 12, 5, 10));
            }

        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:17,代码来源:MyBarthsMoonTransmitterMission.cs

示例14: Load

        public override void Load() // Code in that block will be called on the load of the sector
        {
             base.Load();

             m_Detector1 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector1));
            m_Detector1.OnEntityEnter += Detector1Action;
            m_Detector1.On();

            m_Detector2 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector2));
            m_Detector2.OnEntityEnter += Detector2Action;
            m_Detector2.On();

            m_Detector3 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector3));
            m_Detector3.OnEntityEnter += Detector3Action;
            m_Detector3.On();

            m_Detector4 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector4));
            m_Detector4.OnEntityEnter += Detector4Action;
            m_Detector4.On();



            MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.HeavyFight, 3); // Sets music group to be played in the sector - no matter if the mission is running or not
            MyScriptWrapper.SetPlayerFaction(MyMwcObjectBuilder_FactionEnum.Rainiers);


        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:27,代码来源:MyCKDMothershipFacilityMission.cs

示例15: Load

 public override void Load(MyMissionBase sender)
 {
     m_detector = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity(m_detectorId));
     m_detector.On();
     m_detector.OnEntityEnter += DetectorOnOnEntityEnter;
     MyScriptWrapper.OnDialogueFinished += MyScriptWrapperOnOnDialogueFinished;
     base.Load(sender);
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyDetectorDialogue.cs


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