private void UpdateOnHitRocketRing () {
float speedFactor = 1f;
if (Time.time - hitRing.lastHitTime < PowerUpRing.HIT_WAIT_TIME / 2) {
speedFactor = 0.1f;
return;
}
float ballDiameter = Ball.GetComponent<Renderer> ().bounds.size.y;
float xzDistance = Vector3.Scale (rocketRingHitTarget - Ball.transform.position, new Vector3(1, 0, 1)).magnitude;
if (xzDistance < ballDiameter * 0.5f) {
if (Ball.GetComponent<Rigidbody> ().isKinematic) {
Ball.GetComponent<Rigidbody> ().isKinematic = false;
}
} else {
Ball.transform.position += MAX_VELOCITY * 0.5f * Time.deltaTime * (rocketRingHitTarget - Ball.transform.position) * speedFactor;
}
}