So i have a folder I'm trying to rename (I read i should use Directory.move to do this).
"ExampleA"
I use Directory.Move("ExampleA","New Folder") (code below)
Where "New Folder" is what "ExampleA" Should be renamed to, this works, it moves the directory and it's contents but it's also leaving the "ExampleA" folder still there, and when i try and delete it it says It Doesn't exist.
Full Code here
string oldDirectory = Application.dataPath + "/Photos/" + GameObject.Find("Camera").GetComponent<CameraController>().cardNames[assignmentButton];
Directory.Move(oldDirectory, Application.dataPath + "/Photos/" + renameInput.text);
Debug.Log("Attempting to delete: " + oldDirectory);
if(Directory.Exists(oldDirectory))
Directory.Delete(oldDirectory,true);
The old directory does indeed exist, but this code seems to think it doesn't, i get thrown an error saying it doesn't exist if i remove the Directory.Exists check.