public static string CreateFolder (string parentFolder, string newFolderName);

Parámetros

parentFolderThe name of the parent folder.
newFolderNameThe name of the new folder.

Valor de retorno

string The GUID of the newly created folder.

Descripción

Create a new folder.

using UnityEngine;
using UnityEditor;

public class CreateFolderExample : MonoBehaviour { [MenuItem("GameObject/Create Folder")] static void CreateFolder() { string guid = AssetDatabase.CreateFolder("Assets", "My Folder"); string newFolderPath = AssetDatabase.GUIDToAssetPath(guid); } }