|
|
|
|
|
|
|
|
|
|
public void MatchReset() |
|
|
|
{ |
|
|
|
var ballOut = Random.Range(10f, 18f); |
|
|
|
var ballOut = Random.Range(12f, 16f); |
|
|
|
ball.transform.position = new Vector3(-ballOut, 10f, 0f) + transform.position; |
|
|
|
ball.transform.position = new Vector3(-ballOut, 12f, 0f) + transform.position; |
|
|
|
ball.transform.position = new Vector3(ballOut, 10f, 0f) + transform.position; |
|
|
|
ball.transform.position = new Vector3(ballOut, 12f, 0f) + transform.position; |
|
|
|
} |
|
|
|
m_BallRb.velocity = new Vector3(0f, 0f, 0f); |
|
|
|
ball.transform.localScale = new Vector3(.5f, .5f, .5f); |
|
|
|
|
|
|
{ |
|
|
|
m_BallRb.AddForce(down); |
|
|
|
var rgV = m_BallRb.velocity; |
|
|
|
m_BallRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -30f, 30f), Mathf.Min(rgV.y, 45f), rgV.z); |
|
|
|
m_BallRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -30f, 30f), Mathf.Min(rgV.y, 35f), rgV.z); |
|
|
|
} |
|
|
|
} |