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); } }
protected virtual void OnTriggerEnter(Collider other) { SoldierHP targetHp = other.gameObject.GetComponent <SoldierHP>(); if (targetHp != null && targetHp != Shooter) { targetHp.Hit(); } }
protected override void OnTriggerEnter(Collider other) { base.OnTriggerEnter(other); SoldierHP targetHp = other.gameObject.GetComponent <SoldierHP>(); if (targetHp == Shooter) { return; } Die(); }