|
|
|
|
|
|
{ |
|
|
|
var ballOut = Random.Range(12.5f, 14f); |
|
|
|
var flip = Random.Range(0, 2); |
|
|
|
var serve = 1f; |
|
|
|
ball.transform.position = new Vector3(-ballOut, 1f, 0f) + transform.position; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
ball.transform.position = new Vector3(ballOut, 1f, 0f) + transform.position; |
|
|
|
serve = -1f; |
|
|
|
m_BallRb.velocity = new Vector3(0f, 20f, 0f); |
|
|
|
ball.transform.position = new Vector3(serve * ballOut, 1f, 0f) + transform.position; |
|
|
|
m_BallRb.velocity = new Vector3(serve * 2f, 20f, 0f); |
|
|
|
ball.transform.localScale = new Vector3(.5f, .5f, .5f); |
|
|
|
m_BallScript.ResetPoint(); |
|
|
|
} |
|
|
|