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


C# MyEntity.Kill方法代碼示例

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


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

示例1: BotSpawned

        void BotSpawned(MyEntity spawnpoint, MyEntity bot)
        {
            //List<uint> { 
            //    (uint)EntityID.SpawnLastR, 
            //    (uint)EntityID.SpawnLastL, 
            //    (uint)EntityID.SpawnLastAsteroid, 
            //    (uint)EntityID.SpawnCenterL, 
            //    (uint)EntityID.SpawnCenterR }

            var attackerList = new List<uint>
            {
                (uint)EntityID.SpawnInR,
                (uint)EntityID.SpawnInL,
                (uint)EntityID.SpawnIn3,
                (uint)EntityID.SpawnIn4,
                (uint)EntityID.SpawnFrontL,
                (uint)EntityID.SpawnFrontR,
                (uint)EntityID.SpawnCenterL,
                (uint)EntityID.SpawnCenterR,
                (uint)EntityID.SpawnLastL,
                (uint)EntityID.SpawnLastR,
                (uint)EntityID.SpawnLastAsteroid,
                (uint)EntityID.SpawnLast1,
                (uint)EntityID.SpawnLast1_2,
                (uint)EntityID.SpawnLast2,
                (uint)EntityID.SpawnLast2_2,
                (uint)EntityID.SpawnLast3,
                (uint)EntityID.SpawnLast3_2,
                (uint)EntityID.SpawnLast4,
            };
            
            foreach (var item in attackerList)
            {
                if (spawnpoint == MyScriptWrapper.GetEntity(item) && bot != null)
                {
                    MyScriptWrapper.SetSleepDistance(bot as MySmallShipBot, 10000);
                    var botShip = bot as MySmallShipBot;
                    m_attackerBots.Add(botShip);
                    //botShip.Attack(MyScriptWrapper.GetEntity((uint)m_transporterAttackPoints[MyMwcUtils.GetRandomInt(m_transporterAttackPoints.Count)]));
                }
            }

            foreach (var item in m_spawnCompanions)
            {
                if (spawnpoint == MyScriptWrapper.GetEntity(item))
                {
                    MySmallShipBot botship = bot as MySmallShipBot;
                    //botship.SlowDown = 0.583f;
                    botship.SpeedModifier = 0.583f * (MOTHERSHIP_SLOWSPEED / MOTHERSHIP_FULLSPEED);

                    botship.IsDestructible = m_reassignBotTargets;
                    if (m_reassignBotTargets)
                        bot.Kill(m_towers[MyMwcUtils.GetRandomInt(m_towers.Length)]);
                }
            }
        }
開發者ID:Bunni,項目名稱:Miner-Wars-2081,代碼行數:56,代碼來源:MyChineseEscapeMission.cs


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