当前位置: 首页>>代码示例>>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;未经允许,请勿转载。