Example #1
0
        private void OnTriggerEnter(Collider other)
        {
            SoldierHP targetHp = other.gameObject.GetComponent <SoldierHP>();

            if (targetHp != null && targetHp != _bullet.Shooter)
            {
                _bullet.Shot((other.transform.position - transform.position) * 3f);
            }
        }
Example #2
0
        protected virtual void OnTriggerEnter(Collider other)
        {
            SoldierHP targetHp = other.gameObject.GetComponent <SoldierHP>();

            if (targetHp != null && targetHp != Shooter)
            {
                targetHp.Hit();
            }
        }
Example #3
0
        protected override void OnTriggerEnter(Collider other)
        {
            base.OnTriggerEnter(other);

            SoldierHP targetHp = other.gameObject.GetComponent <SoldierHP>();

            if (targetHp == Shooter)
            {
                return;
            }
            Die();
        }