/// <summary> /// 스테이지 클리어 했을때의 행동을 함 /// </summary> public void StageClear() { int currentWorld = HandOverData.WorldIndex; BackGround.instance.LightOn(); if (HandOverData.WorldIndex == -1) { //mapedit StartCoroutine(ChangeScene(SceneName.mapEdit, 0, exitWaitTime)); } else if (HandOverData.StageIndex == StageList.GetWorldSize(HandOverData.WorldIndex) - 1) { StageList.UnLock(HandOverData.WorldIndex + 1, 0); HandOverData.WorldIndex++; Exit(MainManager.View.StageSelect); } else { HandOverData.StageIndex++; StageList.UnLock(HandOverData.WorldIndex, HandOverData.StageIndex); HandOverData.StageName = StageList.GetStageName(HandOverData.WorldIndex, HandOverData.StageIndex); Debug.Log("world" + HandOverData.WorldIndex + "stage" + HandOverData.StageIndex); StartCoroutine(ChangeScene(SceneName.inGameScene, 3.5f, exitWaitTime)); } }
/// <summary> /// 인게임 스테이지로 이동 /// </summary> /// <param name="stageNum"></param> public void GoToStage(int worldIndex, int stageIndex) { if (isSceneChanging == false) { HandOverData.StageName = StageList.GetStageName(worldIndex, stageIndex); HandOverData.StageIndex = stageIndex; HandOverData.WorldIndex = worldIndex; HandOverData.ShowStageInfo = true; if (worldIndex > PlayerPrefs.GetInt(PrefsKey.lastWorld)) { PlayerPrefs.SetInt(PrefsKey.lastWorld, worldIndex); } UnityEngine.SceneManagement.SceneManager.LoadScene(SceneName.inGameScene); } }