StartCoroutine(MakeNextBall(hand,0.01f));
StartCoroutine(DestryPreviousBall(Basketball,3.0f));
IEnumerator MakeNextBall(Transform pos,float time)//多线程返回参数IEnumerator
{
yield return new WaitForSeconds(time);
Basketball = Instantiate(TempBasketBall,hand.position,hand.rotation) as Rigidbody;
}
IEnumerator DestryPreviousBall(Rigidbody ball,float time)
{
yield return new WaitForSeconds(time);
if(ball)
{
Destroy(ball.gameObject);
}
}