Esempio n. 1
0
        void OnTowerPreparingToShoot(TowerPreparingToShootEventData e)
        {
            var structure = GetStructure(e.Team, e.Type);

            if (structure != null)
            {
                var tower = structure as DrawableTower;
                if (tower != null)
                {
                    tower.WillShoot();
                    PlaySound(tower.Structure.Team == Teams.Left ?
                              Sounds.LeftTowerShot : Sounds.RightTowerShot,
                              new Vec2(tower.Structure.Rectangle.X + tower.Structure.Rectangle.Width / 2f,
                                       tower.Structure.Rectangle.Y + tower.Structure.Rectangle.Height / 2f));
                }
            }
        }
Esempio n. 2
0
		void OnTowerPreparingToShoot(TowerPreparingToShootEventData e)
		{
			var structure = GetStructure(e.Team, e.Type);
			if (structure != null) {
				var tower = structure as DrawableTower;
				if (tower != null) {
					tower.WillShoot();
					PlaySound(tower.Structure.Team == Teams.Left ?
					          Sounds.LeftTowerShot : Sounds.RightTowerShot,
					          new Vec2(tower.Structure.Rectangle.X + tower.Structure.Rectangle.Width / 2f,
					         		   tower.Structure.Rectangle.Y + tower.Structure.Rectangle.Height / 2f));
				}
			}
		}