예제 #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (GameManager.instance.IsGameOver())
        {
            return;
        }

        if (unit.TakingDamage())
        {
            return;
        }

        if (collision.gameObject.CompareTag(GameInformation.enemyBulletTag))
        {
            unit.TakeDamage(collision.gameObject.GetComponent <EnemyBullet>().damage);
            Destroy(collision.gameObject);
        }
    }