private void CreateLevelEditorScene(int levelId, bool bLoad = false) { NewScene(); GameObject levelMapGo = new GameObject("LevelMap"); levelMapGo.transform.position = Vector3.zero; LevelMap levelMap = levelMapGo.AddComponent <LevelMap>(); levelMapGo.transform.hideFlags = HideFlags.NotEditable; levelMap.LevelId = levelId; if (bLoad) { levelMap.LoadLevelMap(); } Close(); }
void OnEnable() { int levelIndex = 1; while (File.Exists(LevelMap.GetLevelDataPath(levelIndex))) { levelIndex++; } m_maxLevelId = levelIndex - 1; if (m_maxLevelId > 0) { m_levelString = new string[m_maxLevelId]; for (int i = 0; i < m_maxLevelId; i++) { m_levelString[i] = (i + 1).ToString(); } } }
void OnEnable() { m_target = (LevelMap)target; }