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


C# Ship.GetRoot方法代码示例

本文整理汇总了C#中Ship.GetRoot方法的典型用法代码示例。如果您正苦于以下问题:C# Ship.GetRoot方法的具体用法?C# Ship.GetRoot怎么用?C# Ship.GetRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ship的用法示例。


在下文中一共展示了Ship.GetRoot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ApplyPowerup

        protected override void ApplyPowerup(Ship ship)
        {
            PlayerShip applyShip;
            EnemyPlayerShip applyAIShip;

            if (ship == Player.Ship)
            {
                if (Config.SoundFXOn)
                    GameStateManagementGame.Instance.soundManager.PlaySound("FX1", 0.7f);  
 
                applyShip = ship.GetRoot() as PlayerShip;

                if (applyShip.Shield.Health < Config.ShieldHealth)
                {
                    if (Config.ship1Active)
                        applyShip.Shield.ShieldRegen(Config.ShieldsPowerupValue + 5);
                    else
                        applyShip.Shield.ShieldRegen(Config.ShieldsPowerupValue);
                }
            }

            if (ship == Player.EnemyPlayer)
            {
                applyAIShip = ship.GetRoot() as EnemyPlayerShip;

                if (applyAIShip.Shield.Health < Config.ShieldHealth)
                    applyAIShip.Shield.ShieldRegen(Config.ShieldsPowerupValue);
            }
        }
开发者ID:JoeMarsh,项目名称:Astro-Flare-Rampage,代码行数:29,代码来源:PowerupShields.cs

示例2: ApplyPowerup

        protected override void ApplyPowerup(Ship ship)
        {
            //new EffectNode(Config.LightningSpriteSheet, this.Position);
            PlayerShip applyShip;
            applyShip = ship.GetRoot() as PlayerShip;

            //for (int i = Enemy.Enemies.Count - 1; i >= 0; i--)
            //{
            //    ProjectileBulletGreenBeam.FireBullet(Vector2.Normalize(Enemy.Enemies[i].Position - applyShip.Position), applyShip.Position);
            //}
            //for (int i = Enemy.Enemies.Count - 1; i >= 0; i--)
            //{
            //    ProjectileBulletGreenBeam.FireBullet(Vector2.Normalize(Enemy.Enemies[i].Position - applyShip.Position), applyShip.Position);
            //}
            //for (int i = Enemy.Enemies.Count - 1; i >= 0; i--)
            //{
            //    ProjectileBulletGreenBeam.FireBullet(Vector2.Normalize(Enemy.Enemies[i].Position - applyShip.Position), applyShip.Position);
            //}
            //for (int i = Enemy.Enemies.Count - 1; i >= 0; i--)
            //{
            //    ProjectileBulletGreenBeam.FireBullet(Vector2.Normalize(Enemy.Enemies[i].Position - applyShip.Position), applyShip.Position);
            //}
            //for (int i = Enemy.Enemies.Count - 1; i >= 0; i--)
            //{
            //    ProjectileBulletGreenBeam.FireBullet(Vector2.Normalize(Enemy.Enemies[i].Position - applyShip.Position), applyShip.Position);
            //}

            //AoEWeaponBurstWave tempWeapon = new AoEWeaponBurstWave(applyShip, 0, 200, 50f);
            AoEWeaponBurstWave tempWeapon = new AoEWeaponBurstWave(applyShip, 0, 100, 50f);
            tempWeapon.StartFire();
        }
开发者ID:JoeMarsh,项目名称:Astro-Flare-Rampage,代码行数:31,代码来源:PowerupDamageAll.cs

示例3: ApplyPowerup

        protected override void ApplyPowerup(Ship ship)
        {
            PlayerShip applyShip;
            //EnemyPlayerShip applyAIShip;

            if (ship == Player.Ship)
            {
                if (Config.SoundFXOn)
                    GameStateManagementGame.Instance.soundManager.PlaySound("FX1", 0.7f);   

                applyShip = ship.GetRoot() as PlayerShip;

                applyShip.laserDefence += 5;
            }

            if (ship == Player.EnemyPlayer)
            {

            }
        }
开发者ID:JoeMarsh,项目名称:Astro-Flare-Rampage,代码行数:20,代码来源:PowerupLaserDefence.cs


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