// creates a new levelData and displays it as an UIEditorLevel in the EditorSelection private IEnumerator cCreateNewLevel(LevelData l) { // create new uiEditorLevel UIEditorLevel editorLevel = Instantiate(uiEditorLevelPrefab, new Vector3(0, 0, 0), Quaternion.identity); editorLevel.transform.parent = placingParent; editorLevel.levelData = l; editorLevel.UpdateTexts(); uiEditorLevels.Add(editorLevel); yield break; }
// loads the list of custom levels public void LoadUIEditorLevels() { uiEditorLevels = new List <UIEditorLevel>(); DestroyChildren(placingParent); foreach (LevelData l in LevelManager.customLevels) { UIEditorLevel editorLevel = Instantiate(uiEditorLevelPrefab, new Vector3(0, 0, 0), Quaternion.identity); editorLevel.transform.parent = placingParent; editorLevel.levelData = l; editorLevel.UpdateTexts(); uiEditorLevels.Add(editorLevel); } }