private void OnTriggerEnter2D(Collider2D collision) { if (IsUnit.isUnit(collision.gameObject)) { HitWithVehicle(collision.gameObject); } }
private void OnTriggerExit2D(Collider2D collision) { if (IsUnit.isUnit(collision.gameObject)) { if (unitsInProximityDistance.Contains(collision.gameObject)) { unitsInProximityDistance.Remove(collision.gameObject); } } UpdateRakeState(); }
private void OnTriggerEnter2D(Collider2D collision) { if (used) { return; } if (IsUnit.isUnit(collision.gameObject)) { used = true; GetComponent <Animator>().SetTrigger("Trigger"); victim = collision.gameObject; victim.GetComponent <Stats>().DealDamage(damageInPercent / 100.0f); } }