//스테이트별 함수 public void WaitGame() { Stages.SetActive(true); //스테이지 선택창 표시 SoundManager.instance.StopBGM(); curentState = eFlowState.WAIT; _PlayTime = 60f; //플레이타임 설정 ActivateTitle(); }
// public void ResultGame() { checkTime = 0; curentState = eFlowState.RESULT; UIScript.instance.setMaxScore(theData.getScore(stageLevel)); //해당 스테이지의 최고점수 참조 ActivateTitle(); _result.showResult(); }
public void PlayGame() { SoundManager.instance.PlayBGM(1); isPlaying = true; curentState = eFlowState.PLAY; ActivateTitle(); //상태바 제거 checkTime = 0; _wormGC.startSpawn(1, 4); //벌레 생성 시작 }
public void TimeoverGame() { isPlaying = false; curentState = eFlowState.TIMEOVER; SoundManager.instance.StopBGM(); ActivateTitle(true, "Time OVER!"); //문구 교체 isEnd = true; //스태틱형 변수로 게임이 종료되었음을 각 객체에 알림 _wormGC.StopSpawn(); //벌레 생성 중지 _PlayTime = 0f; //플레이타임 초기화 checkTime = 0; //생성된 벌레들 제거 BugControl[] bugs = GameObject.FindObjectsOfType <BugControl>(); for (int i = 0; i < bugs.Length; i++) { Destroy(bugs[i].gameObject); } //현재점수가 최고점수보다 높을경우 DB에 최신화 if (UIScript.instance.getScore() > theData.getScore(stageLevel)) { theData.SaveScore(stageLevel, UIScript.instance.getScore()); ResultWindow.isHigherThanTop = true; } }
public void GoGame() { curentState = eFlowState.GO; ActivateTitle(true, "GO!"); checkTime = 0; }