//게임 시작 준비. void UpdateGameIn() { //스테이지 구축. GameObject stage = GameObject.Find("Stage"); if (stage == null) { stage = Instantiate(m_stagePrefabs[m_gameCount]) as GameObject; stage.name = "Stage"; return; } //페이드인을 기다립니다. GameObject[] blocks = GameObject.FindGameObjectsWithTag("Block"); foreach (GameObject obj in blocks) { BlockScript b = obj.GetComponent <BlockScript>(); if (b.IsFadeIn()) { return; } } //게임 시작으로 전환. m_state = State.Game; m_gameTime = 0; //발사할 수 있게 합니다. GameObject[] bars = GameObject.FindGameObjectsWithTag("Bar"); foreach (GameObject obj in bars) { BarScript bar = obj.GetComponent <BarScript>(); bar.SetShotEnable(true); //발사기능 OFF. } }
//스테이지를 바꾸는 연출.. void UpdateGameChanging() { //초밥 페이드 아웃 시작. GameObject[] blocks = GameObject.FindGameObjectsWithTag("Block"); foreach (GameObject obj in blocks) { BlockScript b = obj.GetComponent <BlockScript>(); b.FadeOut(); } //탄환 소거. GameObject[] balls = GameObject.FindGameObjectsWithTag("Ball"); foreach (GameObject obj in balls) { Destroy(obj); } //발사할 수 없게 합니다. GameObject[] bars = GameObject.FindGameObjectsWithTag("Bar"); foreach (GameObject obj in bars) { BarScript bar = obj.GetComponent <BarScript>(); bar.SetShotEnable(false); //발사 기능 OFF. } //다음 상태로 전환. m_state = State.GameOut; }