// Update is called once per frame void Update() { foreach (Lantern peachBlossom in peachBlossomList) { peachBlossom.Floating(); peachBlossom.Boundary(); peachBlossom.Move(); } for (int j = 0; j < lanternCount; j++) { lantern = lanternList[j]; lantern.Floating(); lantern.Boundary(); lantern.Move(); } if (timer % interval == 0 && lanternCount < maxLanternCount - 1) { lanternCount += 1; } if (timer < maxLanternCount * (interval + 1)) { timer++; } if (peachBlossomTimer % interval == 0 && peachBlossomCount < maxPeachBlossomCount - 1) { peachBlossom = new Lantern(peachBlossomTemplate); peachBlossom.vel = Random.insideUnitSphere * 0.05f; peachBlossomList.Add(peachBlossom); peachBlossomCount += 1; } if (peachBlossomTimer < maxPeachBlossomCount * (interval + 1)) { peachBlossomTimer += 1; } }