예제 #1
0
    void OnTriggerEnter(Collider col)
    {
        if (col.gameObject != DamageAuthor)
        {
            ILivingCharacter character = col.gameObject.GetComponent <ILivingCharacter>();
            if (character != null)
            {
                character.Damage(damage);
            }

            GameManager.Instance.projectilePool.Despawn(transform);
        }
    }
예제 #2
0
    void OnTriggerEnter(Collider col)
    {
        if (!IsAlive)
        {
            return;
        }

        if (col.gameObject.CompareTag("Player"))
        {
            ILivingCharacter character = col.gameObject.GetComponent <ILivingCharacter>();
            if (character != null)
            {
                character.Damage(damage);
            }
        }
    }