/// <summary> /// Delete saveFile for button, removes it from buttonList and nameList + destroysButtonObject /// </summary> /// <param name="button"></param> public void DeleteLevel(LevelEditorLevelButton button) { LevelSaveLoad.Delete(button.GetName(), FilePaths.CustomEditLevelFolder); buttons.Remove(button); fileNames.Remove(button.GetName()); Destroy(button.gameObject); }
public void ClickOnCustomLevelButton() { if (deleteMode) { LevelSaveLoad.Delete(levelName, FilePaths.CustomPlayLevelFolder); selection.RemoveLevel(this); Destroy(this.gameObject); } else { Gamemaster.Instance.SetNextCustomLevelToLoad(levelName); SceneManager.LoadScene(SceneDictionary.Play); } }