Esempio n. 1
0
 void Update()
 {
     if (start)
     {
         transform.Translate(Time.deltaTime * speed, 0, 0);
         GameObject zombie = search.SearchClosestZombie(row, 0, range);
         if (zombie)
         {
             zombie.GetComponent <ZombieHealth>().Damage(10000);
             StartCoroutine(Stop());
         }
         if (transform.position.x > (StageMap.RightGrid + 3.5f))
         {
             Destroy(gameObject);
         }
     }
     else
     {
         if (search.isZombieInRange(row, 0, range))
         {
             start = true;
             AudioManager.GetInstance().PlaySound(sound);
         }
     }
 }
Esempio n. 2
0
    void Update()
    {
        transform.Translate(Speed * Time.deltaTime, 0, 0);

        if (_row < 0 && StageMap.MaxRow <= _row)
        {
            _target = null;
        }
        _target = _search.SearchClosestZombie(_row, 0, Range);
        if (_target)
        {
            _target.SendMessage("Blink");
            HitEffect();
            _target.GetComponent <ZombieHealth>().Damage(AtkDamage);
        }
    }