//게임 시작. 무기 선택 부터 시작. public void GameStart() { gameState = DefEnum.GameState.SELECT_WEAPON; if (ingameUI == null) { ingameUI = UIManager.Instance.LoadUI("IngameUI").GetComponent <IngameUI>(); } else { ingameUI.gameObject.SetActive(true); } planet.Init(); currentScore = 0; currentResources = 0; upgradeCost = 0; upgradeLV = 1; SetMainWeaponID(); GetUpgradeCost(); ingameUI.SetScore(currentScore); ingameUI.SetResources(currentResources, upgradeCost); SpawnManager.Instance.Init(); EffectManager.Instance.InitIngameEffects(); //시작할 때 무기 선택 창 열기. UIManager.Instance.LoadPopupUI("WeaponUI"); }
//게임 종료 처리. public void GameEnd(bool success) { gameState = DefEnum.GameState.END; EffectManager.Instance.Pause(); IngameSceneManager.Instance.PlayIngameScene(success ? "Clear" : "Defeat", ShowResultUI); isGameResult = success; currentScore += planet.CurrentHP * 50; }
public void Init() { arrivalEnemyAtkPoints = new Enemy[attackPoints.Length]; for (int i = 0; i < arrivalEnemyAtkPoints.Length; ++i) { arrivalEnemyAtkPoints[i] = null; } //인트로 화면 출력. gameState = DefEnum.GameState.INTRO; UIManager.Instance.LoadUI("IntroUI"); }
//인게임 튜토리얼 출력. public void ShowTutorial() { //이미 튜토리얼 봤으면 바로 게임 진행. if (DataManager.Instance.playedTutorial) { Play(); return; } gameState = DefEnum.GameState.TUTORIAL; IngameSceneManager.Instance.PlayIngameScene("Tutorial_02", EndTutorial); }
//인트로 화면으로 전환. public void GoIntro() { DataManager.Instance.ClearEnemyLevelDataList(); EffectManager.Instance.ClearEffectList(); SoundManager.Instance.AllSFXStop(); ResourceManager.Instance.EndUseObjectPool(); ClearEnemyList(); planet.Clear(); gameState = DefEnum.GameState.INTRO; ingameUI.gameObject.SetActive(false); UIManager.Instance.LoadUI("IntroUI"); }
//게임 일시 정지 해제. public void Play() { gameState = DefEnum.GameState.PLAY; EffectManager.Instance.Play(); SoundManager.Instance.Play(); }
//게임 일시 정지. public void Pause() { gameState = DefEnum.GameState.PAUSE; EffectManager.Instance.Pause(); SoundManager.Instance.Pause(); }