unity create folder only if not exists code example
Example 1: c# making a folder
string path1 = @"C:\temp\";
string path2 = Path.Combine(path1, "temp1");
// Create directory temp1 if it doesn't exist
Directory.CreateDirectory(path2);
Example 2: unity create folder only if not exists
using System.IO;
//check if directory doesn't exit
if(!Directory.Exists(directoryPath))
{
//if it doesn't, create it
Directory.CreateDirectory(directoryPath);
}