public void stopGrounds() { if (defaultGround != null) { MoveBoad mb = defaultGround.GetComponent <MoveBoad> (); mb.stopMover(); } foreach (MoveBoad mb in backgroundList) { mb.stopMover(); } }
private IEnumerator CreatePipes() { yield return(new WaitForSeconds(1.5f)); while (true) { yield return(new WaitForSeconds(waitCreatePipeTime)); GameObject go = Instantiate(pipes, new Vector3(2.5f, Random.Range(1.1f, 3f), 0), Quaternion.identity) as GameObject; MoveBoad mb = go.GetComponent <MoveBoad> (); boadList.Add(mb); yield return(new WaitForSeconds(waitCreatePipeTime)); } }
private IEnumerator CreateGround() { while (true) { if (firstWaitFlg) { yield return(new WaitForSeconds(waitCreateGroundTime)); firstWaitFlg = false; } GameObject go = Instantiate(ground, new Vector3(3.36f, 3.86f, -1f), Quaternion.identity) as GameObject; MoveBoad mb = go.GetComponent <MoveBoad> (); backgroundList.Add(mb); yield return(new WaitForSeconds(2.58f)); } }