public void OnNew() { int levelId; if (int.TryParse(levelIDText.text, out levelId)) { LevelData newlevel = new LevelData(); newlevel.levelNum = levelId; var newCom = new ComAddLevel(_levelList, newlevel); newCom.Execute(); _comList.Add(newCom); JumpToLevelID(levelId, 0.3f); } }
public void OnClone() { if (_levelList.CurrentSelectedLevel == null) { return; } int levelId; if (int.TryParse(levelIDText.text, out levelId)) { LevelData cloneLevel = _levelList.CurrentSelectedLevel.Clone(); cloneLevel.levelNum = levelId; cloneLevel.name += " (Clone)"; var cloneCom = new ComAddLevel(_levelList, cloneLevel); cloneCom.Execute(); _comList.Add(cloneCom); JumpToLevelID(levelId, 0.3f); } }