GameStateBehaviour.OnHitRocketRing C# (CSharp) Method

OnHitRocketRing() private method

private OnHitRocketRing ( ) : void
return void
	private void OnHitRocketRing () {

		int cupIDOffset = 0;
		if (BeerPongNetwork.Instance.thisPlayerID == BeerPong.PlayerID.Second) {
			
			cupIDOffset = playerCupCount;
		}
		
		int targetCupID = cupIDOffset;
		foreach (int key in dictCup.Keys) {
			
			if (key >= cupIDOffset && key < cupIDOffset + playerCupCount) {
				
				targetCupID = key;
				break;
			}
		}
		
		GameObject targetCup = dictCup [targetCupID];
		float ballRadius = Ball.GetComponent<Renderer> ().bounds.extents.y;
		rocketRingHitTarget = targetCup.GetComponent<BeerPongCup> ().top + ballRadius * Vector3.up;
		
		Ball.GetComponent <Rigidbody> ().isKinematic = true;
		Ball.GetComponent <Rigidbody> ().velocity = Vector3.zero;
	}