コード例 #1
0
 IEnumerator BubbleSpawnRoutine()
 {
     while (1 == 1)
     {
         float random        = Random.Range(9f, -9f);
         float randomScale   = Random.Range(0.25f, 1.5f);
         float randomSeconds = Random.Range(.5f, 1.25f);
         Instantiate(bubblePrefab, new Vector2(random, -6.0f), Quaternion.identity);
         bubblePrefab.transform.localScale = new Vector2(randomScale, randomScale);
         bubbleScript.setSpeed();
         yield return(new WaitForSeconds(randomSeconds));
     }
 }