void Awake() { m_Animator = GetComponent <Animator>(); GameManager.GType = GameType.None; GameManager.CurrentUIRoot = GetComponent <Canvas>(); m_Instance = this; m_Blank.SetActive(false); m_RiseMask.gameObject.SetActive(false); m_LoadingFlag.SetActive(true); //Get chapter level prefab m_ChapterLevelPrefab = m_LevelRoot.transform.GetChild(0).GetComponent <ChapterLevel>(); m_ChapterLevelPrefab.transform.SetParent(transform); m_ChapterLevelPrefab.gameObject.SetActive(false); if (PlayerPrefs.HasKey(ConstantData.MissionProgressKeyName)) { m_MissionProgress = PlayerPrefs.GetString(ConstantData.MissionProgressKeyName); } else { m_MissionProgress = "1-1"; PlayerPrefs.SetString(ConstantData.MissionProgressKeyName, m_MissionProgress); } if (string.IsNullOrEmpty(ConstantData.BattleSceneType)) { m_Animator.Play("Loading"); Invoke("LoadingDone", 1f); } else { m_Animator.SetTrigger(ConstantData.BattleSceneType); LoadLevelWithChapter(ConstantData.LoadedChapter); } }
void OnDestroy() { m_Instance = null; GameStatistics.Serialize(); HOAudioManager.StopLoopClip(); }
void Awake() { m_Animator = GetComponent<Animator>(); GameManager.GType = GameType.None; GameManager.CurrentUIRoot = GetComponent<Canvas>(); m_Instance = this; m_Blank.SetActive(false); m_RiseMask.gameObject.SetActive(false); m_LoadingFlag.SetActive(true); //Get chapter level prefab m_ChapterLevelPrefab = m_LevelRoot.transform.GetChild(0).GetComponent<ChapterLevel>(); m_ChapterLevelPrefab.transform.SetParent(transform); m_ChapterLevelPrefab.gameObject.SetActive(false); if (PlayerPrefs.HasKey(ConstantData.MissionProgressKeyName)) { m_MissionProgress = PlayerPrefs.GetString(ConstantData.MissionProgressKeyName); } else { m_MissionProgress = "1-1"; PlayerPrefs.SetString(ConstantData.MissionProgressKeyName, m_MissionProgress); } if(string.IsNullOrEmpty(ConstantData.BattleSceneType)) { m_Animator.Play("Loading"); Invoke("LoadingDone", 1f); } else { m_Animator.SetTrigger(ConstantData.BattleSceneType); LoadLevelWithChapter(ConstantData.LoadedChapter); } }