parentFolder | The name of the parent folder. |
newFolderName | The name of the new folder. |
string The GUID of the newly created folder.
Create a new folder.
#pragma strict public class CreateFolderExample extends MonoBehaviour { @MenuItem("GameObject/Create Folder") static function CreateMaterial() { var guid: String = AssetDatabase.CreateFolder("Assets", "My Folder"); var newFolderPath: String = AssetDatabase.GUIDToAssetPath(guid); } }
using UnityEngine; using UnityEditor;
public class CreateFolderExample : MonoBehaviour { [MenuItem("GameObject/Create Folder")] static void CreateMaterial() { string guid = AssetDatabase.CreateFolder("Assets", "My Folder"); string newFolderPath = AssetDatabase.GUIDToAssetPath(guid); } }