For checking if a file exists I use : if (!File.Exists("my file"))
but how do I do that for a folder or directory?
using System.IO;
///class blah blah
// and method blah, blah
//check if directory doesn't exit
if(!Directory.Exists(directoryPath))
{
//if it doesn't, create it
Directory.CreateDirectory(directoryPath);
}
You can now do:
AssetDatabase.IsValidFolder(string path);