public static void CreateUnityFolder(string childPath) { var fullPath = UnityPathUtility.GetUnityAbsoluteFolderPath(childPath); if (CSharpFileUtility.IsFolderExist(fullPath) == false) { Directory.CreateDirectory(fullPath); RefreshAsset(); } }
public static void SetTextureImporterSetting(string presetPath, string texturePath) { if (IsFileInPath(texturePath) == false) { return; } var preset = AssetDatabase.LoadAssetAtPath <Preset>(presetPath); if (preset == null) { return; } var presetType = preset.GetTargetTypeName(); var textureFileExtenstion = CSharpFileUtility.GetExtensionFromFullPath(texturePath); if (presetType == "TextureImporter" && textureFileExtenstion == "png") { var textureImporter = AssetImporter.GetAtPath(texturePath) as TextureImporter; preset.ApplyTo(textureImporter); textureImporter.SaveAndReimport(); } }
public static bool IsUnityFolderExist(string childPath) { return(CSharpFileUtility.IsFolderExist("Assets/" + childPath)); }
public static bool IsFileInPath(string unityFileFullPath) { var slashToCsharp = CSharpFileUtility.ParseSlashToCsharp(unityFileFullPath); return(CSharpFileUtility.IsFileInPath(slashToCsharp)); }
public static bool IsFileInPath(string unityFullFolderPath, string fileName, FileType fileType) { var slashToCsharp = CSharpFileUtility.ParseSlashToCsharp(unityFullFolderPath); return(CSharpFileUtility.IsFileInPath(slashToCsharp, fileName, GetExtension(fileType))); }
public static string GetCsharpUnityAbsoluteFullPath(string childPath, string fileName, string extension) { return(CSharpFileUtility.ParseSlashToCsharp(GetUnityAbsoluteFullPath(childPath, fileName, extension))); }
public static string GetCsharpUnityAbsoluteFolderPath(string childPath) { return(CSharpFileUtility.ParseSlashToCsharp(GetUnityAbsoluteFolderPath(childPath))); }