本文整理汇总了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);
}
}
示例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();
}
示例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)
{
}
}