Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Create_Folder()
- {
- string[] m_Folders = AssetDatabase.GetAllAssetPaths();
- foreach (string m_folder in m_Folders)
- {
- string _folder = Path.GetDirectoryName(m_folder);
- if (m_folder.Contains("Packages")) continue;
- if (m_folder.Contains("ProjectSettings")) continue;
- if (m_folder.Contains("C:/")) continue;
- if (m_folder.Contains("Library")) continue;
- string[] m_AllFolers = Directory.GetDirectories(m_folder);
- Debug.Log(m_AllFolers);
- if (m_folder.Contains("/Assets/Assets "))
- {
- m_AlreadyExistcsAssets = true;
- }
- if (m_folder.Contains("/Assets/Scripts "))
- {
- m_AlreadyExistcsScripts = true;
- }
- if (m_folder.Contains("/Assets/Materials "))
- {
- m_AlreadyExistcsMaterials = true;
- }
- if (m_folder.Contains("/Assets/Prefabs "))
- {
- m_AlreadyExistcsPrefabs = true;
- }
- if (m_folder.Contains("/Assets/Recourses "))
- {
- m_AlreadyExistcsResources = true;
- }
- if (m_folder.Contains("/Assets/Textures "))
- {
- m_AlreadyExistcsTextures = true;
- }
- if (m_folder.Contains("/Assets/Audio "))
- {
- m_AlreadyExistcsAudio = true;
- }
- }
- if (m_WantAssets == true)
- {
- if (m_AlreadyExistcsAssets == true)
- {
- return;
- }
- string guid = AssetDatabase.CreateFolder("Assets", "Assets");
- string newFolderPath = AssetDatabase.GUIDToAssetPath(guid);
- }
- if (m_WantScripts == true)
- {
- if (m_AlreadyExistcsScripts == true)
- {
- return;
- }
- string guid = AssetDatabase.CreateFolder("Assets", "Scripts");
- string newFolderPath = AssetDatabase.GUIDToAssetPath(guid);
- }
- if (m_WantMaterials == true)
- {
- if (m_AlreadyExistcsMaterials == true)
- {
- return;
- }
- string guid = AssetDatabase.CreateFolder("Assets", "Materials");
- string newFolderPath = AssetDatabase.GUIDToAssetPath(guid);
- }
- if (m_WantPrefabs == true)
- {
- if (m_AlreadyExistcsPrefabs == true)
- {
- return;
- }
- string guid = AssetDatabase.CreateFolder("Assets", "Prefabs");
- string newFolderPath = AssetDatabase.GUIDToAssetPath(guid);
- }
- if (m_WantResources == true)
- {
- if (m_AlreadyExistcsResources == true)
- {
- return;
- }
- string guid = AssetDatabase.CreateFolder("Assets", "Resources");
- string newFolderPath = AssetDatabase.GUIDToAssetPath(guid);
- }
- if (m_WantTextures == true)
- {
- if (m_AlreadyExistcsTextures == true)
- {
- return;
- }
- string guid = AssetDatabase.CreateFolder("Assets", "Textures");
- string newFolderPath = AssetDatabase.GUIDToAssetPath(guid);
- }
- if (m_WantAudio == true)
- {
- if (m_AlreadyExistcsAudio == true)
- {
- return;
- }
- string guid = AssetDatabase.CreateFolder("Assets", "Audio");
- string newFolderPath = AssetDatabase.GUIDToAssetPath(guid);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement