Exemple #1
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);
     }
 }
Exemple #2
0
 private void TrapTrigger(Creep creep)
 {
     if (trapCode.Equals(Constants.TOWER_CODE_GO_AWAY))
     {
         creep.MoveUp();
     }
     else if (trapCode.Equals(Constants.TOWER_CODE_COME_HERE))
     {
         creep.MoveDown();
     }
     else if (trapCode.Equals(Constants.TOWER_CODE_MAGIC_LOOP))
     {
         creep.MoveBack();
     }
     else
     {
         creep.CalcDamage(damage);
     }
     TowerDeath();
     GameEvents.current.EnemyAppear();
 }