Пример #1
0
 private IEnumerator WaitForBulletTouchZombie()
 {
     do
     {
     }while(1 == 1);
     enemy.DamageEnemy(Damage);
     yield return(0);
 }
Пример #2
0
 private void checkForZombie()
 {
     GameObject[] zombieObjects = GameObject.FindGameObjectsWithTag("Zombie");
     zombies = new Zombie[zombieObjects.Length];
     for (int i = 0; i != zombieObjects.Length; i++)
     {
         zombies[i] = zombieObjects[i].GetComponent <Zombie>();
         if (checkRange(zombies[i].transform.position, transform.position, zombies[i].width / 2, zombies[i].height / 2))
         {
             Debug.Log("Hit it");
             zombieHealth = zombieObjects[i].GetComponent <ZombieHealth>();
             zombieHealth.DamageEnemy(gameAttribute.weaponPower);
             GameMaster.KillBullet(this);
         }
     }
 }