public void IsHitByFrontLegs_ColliderIsFrontLegs_ReturnsTrue() { var colliderName = "frontLegs"; _ball.IsHitByFrontLegs(colliderName); Assert.IsTrue(_ball.IsHitByFrontLegs(colliderName)); }
private void OnCollisionEnter(Collision other) { if (!_ball.IsHitByFrontLegs(other.transform.name)) { return; } var direction = _ball.GetBallShootingDirectionWithForce(other.transform.position, transform.position); GetComponent <Rigidbody>().AddForce(direction, ForceMode.Impulse); }