當前位置: 首頁>>代碼示例>>C#>>正文


C# MyEntityDetector.SetSensorDetectRigidBodyTypes方法代碼示例

本文整理匯總了C#中MinerWars.AppCode.Game.Entities.EntityDetector.MyEntityDetector.SetSensorDetectRigidBodyTypes方法的典型用法代碼示例。如果您正苦於以下問題:C# MyEntityDetector.SetSensorDetectRigidBodyTypes方法的具體用法?C# MyEntityDetector.SetSensorDetectRigidBodyTypes怎麽用?C# MyEntityDetector.SetSensorDetectRigidBodyTypes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MinerWars.AppCode.Game.Entities.EntityDetector.MyEntityDetector的用法示例。


在下文中一共展示了MyEntityDetector.SetSensorDetectRigidBodyTypes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateDetectorForParticleEffect

        void CreateDetectorForParticleEffect()
        {
            m_smallShipDetector = new MyEntityDetector();

            m_smallShipDetector.Init(
                null,
                new MyMwcObjectBuilder_EntityDetector(
                    new Vector3(MyDummyPointConstants.PARTICLE_DETECTOR_SIZE * UserScale, 0, 0),
                    MyMwcObjectBuilder_EntityDetector_TypesEnum.Sphere),
                this,
                WorldMatrix,
                new List<IMyEntityDetectorCriterium>());

            m_smallShipDetector.Save = false;
            m_smallShipDetector.SetSensorDetectRigidBodyTypes(MyConstants.RIGIDBODY_TYPE_SHIP);

            m_smallShipDetector.On();
        }
開發者ID:Bunni,項目名稱:Miner-Wars-2081,代碼行數:18,代碼來源:MyDummyPoint.cs

示例2: Load

        public override void Load()
        {
            
            if (!IsMainSector) return;

            RemoveFriends();

            MyScriptWrapper.DisableAllGlobalEvents();

            m_attackerBots.Clear();

            m_detectorFirst = MyScriptWrapper.GetDetector((uint)EntityID.DetectorFirst);
            m_detectorSecond = MyScriptWrapper.GetDetector((uint)EntityID.DetectorSecond);
            m_detectorThird = MyScriptWrapper.GetDetector((uint)EntityID.DetectorThird);
            m_detectorFirst.SetSensorDetectRigidBodyTypes(null);
            m_detectorSecond.SetSensorDetectRigidBodyTypes(null);
            m_detectorThird.SetSensorDetectRigidBodyTypes(null);

            m_madelyn = MyScriptWrapper.GetEntity("Madelyn");
            //Because she was hidden in previous mission
            MyScriptWrapper.UnhideEntity(m_madelyn);
            m_transporter = MyScriptWrapper.GetEntity((uint)EntityID.Transporter);
            m_transporter.OnContactEvent += new Action<MyEntity>(m_transporter_OnContactEvent);
            m_reassignBotTargets = false;

            m_motherShipSpeed = MOTHERSHIP_FULLSPEED;

            MyScriptWrapper.PrepareMotherShipForMove(m_transporter);

            MyScriptWrapper.AddNotification(MyScriptWrapper.CreateNotification(Localization.MyTextsWrapperEnum.SwitchInHUBTurrets, MyGuiManager.GetFontMinerWarsGreen(), 60000, 
                new object[] {
                    MyGuiManager.GetInput().GetGameControlTextEnum(MyGameControlEnums.ROLL_LEFT),
                    MyGuiManager.GetInput().GetGameControlTextEnum(MyGameControlEnums.ROLL_RIGHT)
                }
            ));

            foreach (var item in m_spawnCompanions)
            {
                MyScriptWrapper.ActivateSpawnPoint(item);
            }
           
            var pos = MySession.PlayerShip.WorldMatrix.Translation;
            MySession.PlayerShip.WorldMatrix = m_transporter.WorldMatrix;
            Vector3 playerPos = m_transporter.WorldMatrix.Translation - 400 * m_transporter.WorldMatrix.Forward;
            MyScriptWrapper.Move(MySession.PlayerShip, playerPos);
            //MyScriptWrapper.EnablePhysics(MySession.PlayerShip.EntityId.Value.NumericValue, false);
            MyScriptWrapper.HideEntity(MySession.PlayerShip);

            m_towers[0] = MyScriptWrapper.GetEntity((uint)EntityID.Tower1);
            m_towers[1] = MyScriptWrapper.GetEntity((uint)EntityID.Tower2);
            m_towers[2] = MyScriptWrapper.GetEntity((uint)EntityID.Tower3);

            MyScriptWrapper.SetEntityPriority(m_towers[0], -1);
            MyScriptWrapper.SetEntityPriority(m_towers[1], -1);
            MyScriptWrapper.SetEntityPriority(m_towers[2], -1);
            MyScriptWrapper.SetEntityPriority(MyScriptWrapper.GetEntity((uint)EntityID.TowerDown), -1);

            MyScriptWrapper.TakeControlOfLargeWeapon(m_towers[m_activeTower]);
            MyScriptWrapper.ForbideDetaching();
            MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.Mystery);
            
            MyScriptWrapper.SwitchTowerPrevious += MyScriptWrapper_SwitchTowerPrevious;
            MyScriptWrapper.SwitchTowerNext += MyScriptWrapper_SwitchTowerNext;
            MyScriptWrapper.EntityDeath += MyScriptWrapper_OnEntityDeath;
            MyScriptWrapper.OnSpawnpointBotSpawned += BotSpawned;

            m_objective01_flyTowardsMadelyn.OnMissionLoaded += O01FlyTowardsMadelynLoaded;
            m_objective01_flyTowardsMadelyn.OnMissionSuccess += O01FlyTowardsMadelynSuccess;

            m_madelynDestinationReached = false;
            m_transporterDestinationReached = false;
            m_moveMadelynFlag = false;
           
            m_towersCount = 3;
            m_activeTower = 0;
            m_switchCounter = 0;

            MyScriptWrapper.DrawHealthOfCustomPrefabInLargeWeapon(MyScriptWrapper.GetEntity((uint)EntityID.TransporterShip));
            MyScriptWrapper.DisableShipBackCamera();
            m_detectorFirst.OnEntityEnter += DetectorActionFirst;
            m_detectorFirst.On();

            MyScriptWrapper.OnDialogueFinished += MyScriptWrapper_OnDialogueFinished;
            base.Load();
        }
開發者ID:Bunni,項目名稱:Miner-Wars-2081,代碼行數:85,代碼來源:MyChineseEscapeMission.cs


注:本文中的MinerWars.AppCode.Game.Entities.EntityDetector.MyEntityDetector.SetSensorDetectRigidBodyTypes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。