예제 #1
0
파일: Health.cs 프로젝트: jvdwijk/Red-Baron
 private void Update()
 {
     if (_health <= 0)
     {
         if (gameObject.CompareTag("Enemy"))
         {
             EnemyDeath();
             ObjectPool.Instance.PoolObject(gameObject);
         }
         if (CompareTag("Player"))
         {
             _onDeath.Death();
         }
     }
     if (!CompareTag("Player"))
     {
         return;
     }
     if (_health >= 7 || _counter >= Time.time)
     {
         return;
     }
     _counter = Time.time + _delay;
     _health++;
 }