- Home /
Please Help With Folder Creation Script
Hello community. I've begun using Unity roughly 3 months ago and I'm following the tutorials at walkerboystudio.com which some of you may be familiar with. I've begun the section on creating editor tools and I've run in to some issues with folder creation. Namely...
The video directs me to use the .Net method Directory.CreateDirectory for folder generation but I've noticed the video is a bit dated and I've discovered the CreateFolder function through Unity's API.
I am able to get this code working properly...
static function FolderGenerator () { AssetDatabase.CreateFolder ("Assets", "Materials"); }
My concern lies with creating my folders in relation to the "Assets" folder since it seems this may change depending on what I'm developing for. I have tried using Application.dataPath in place of "Assets" but I don't believe I'm using it correctly (since its not working). My head is spinning from staring at Unity's scripting reference to AssetDatabase.CreateFolder and trying to better understand. Any help would be appreciated!