Пример #1
0
        public static string CreateAssetPath(string path)
        {
            string[] foldersChain = URLManager.SplitPath(path);
            if (foldersChain.Length <= 0)
            {
                return(string.Empty);
            }
            string currentPath = foldersChain[0];

            for (int i = 0; i < foldersChain.Length - 1; i++)
            {
                if (!AssetDatabase.IsValidFolder(currentPath + "/" + foldersChain[i + 1]))
                {
                    AssetDatabase.CreateFolder(currentPath, foldersChain[i + 1]);
                }
                currentPath = Path.Combine(currentPath, foldersChain[i + 1]);
            }
            return(path);
        }