public void rWorld(string s) { if (File.Exists(Application.persistentDataPath + Path.DirectorySeparatorChar + "saves" + Path.DirectorySeparatorChar + s + ".dat")) { List <string> st = new List <string>(); st.Add("ok"); WindowUI wui = new WindowUI(WindowImage.WARNING, WindowType.OK, st, "World Rename Error", "The world name already exists.", true, 12, ExitDefault.CLOSEOPERATION); wui.Display(); return; } if (manage.options[manage.value].text == s) { List <string> st = new List <string>(); st.Add("Ok"); WindowUI wui = new WindowUI(WindowImage.ERROR, WindowType.OK, st, "World Rename", "You must rename to world to something else!", false, 9, ExitDefault.CLOSEOPERATION); wui.Display(); } else { File.Move(Application.persistentDataPath + Path.DirectorySeparatorChar + "saves" + Path.DirectorySeparatorChar + manage.options[manage.value].text + ".dat", Application.persistentDataPath + Path.DirectorySeparatorChar + "saves" + Path.DirectorySeparatorChar + s + ".dat"); } dropdownManager.mangeWrolds(); }
public void deleteWorld() { if (input.options[input.value].text.Equals("None")) { return; } if (File.Exists(Application.persistentDataPath + Path.DirectorySeparatorChar + "saves" + Path.DirectorySeparatorChar + input.options[input.value].text + ".dat")) { File.Delete(Application.persistentDataPath + Path.DirectorySeparatorChar + "saves" + Path.DirectorySeparatorChar + input.options[input.value].text + ".dat"); input.options.RemoveAt(input.value); dp.options.RemoveAt(input.value); input.value = 0; dropdownManager.mangeWrolds(); } }