Exemplo n.º 1
0
    private void BulletHit(Creep creep, float _damage, GameObject bulletPref)
    {
        GameObject bulletGO = Instantiate(bulletPref, firePoints.GetRandomPoint().position, Quaternion.identity) as GameObject;
        Bullet     bullet   = bulletGO.GetComponent <Bullet> ();

        if (bullet != null)
        {
            bullet.SeekEnemy(creep, _damage);
        }
        creep.GetClosestTowerAfterHit(this);
    }
Exemplo n.º 2
0
 public void Fire(Creep creep, float damage)
 {
     if (creep)
     {
         if (IsRanger)
         {
             GameObject bulletGO = Instantiate(bulletPref, firePoint.position, Quaternion.identity) as GameObject;
             Bullet     bullet   = bulletGO.GetComponent <Bullet> ();
             if (bullet != null)
             {
                 bullet.SeekEnemy(creep, damage);
             }
         }
         else
         {
             creep.CalcDamage(damage);
         }
         creep.GetClosestTowerAfterHit(this);
     }
 }