Hi, I’m trying to figure out how to count the number of files in a directory and then create buttons for each of those directories.
So far I can create directories in a specified directory if it doesn’t already exist.
if (System.IO.Directory.Exists ("C:\\Diary\\" + newDiaryName.text + "\\"))
{
//Folder Exists
Debug.Log ("Directory already exists");
}
else
{
//Create Folder
System.IO.Directory.CreateDirectory ("C:\\Diary\\" + newDiaryName.text + "\\");
}
What I want to do is is display buttons that represent the directories in the “Diary” folder. So I need to loop and add each directory to a list.
I’m having trouble finding info on searching for folders rather than actual files.
Any one able to enlighten me?
Thanks!