Exemplo n.º 1
0
        public static void CreateUnityFolder(string childPath)
        {
            var fullPath = UnityPathUtility.GetUnityAbsoluteFolderPath(childPath);

            if (CSharpFileUtility.IsFolderExist(fullPath) == false)
            {
                Directory.CreateDirectory(fullPath);
                RefreshAsset();
            }
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
 public static bool IsUnityFolderExist(string childPath)
 {
     return(CSharpFileUtility.IsFolderExist("Assets/" + childPath));
 }
Exemplo n.º 4
0
        public static bool IsFileInPath(string unityFileFullPath)
        {
            var slashToCsharp = CSharpFileUtility.ParseSlashToCsharp(unityFileFullPath);

            return(CSharpFileUtility.IsFileInPath(slashToCsharp));
        }
Exemplo n.º 5
0
        public static bool IsFileInPath(string unityFullFolderPath, string fileName, FileType fileType)
        {
            var slashToCsharp = CSharpFileUtility.ParseSlashToCsharp(unityFullFolderPath);

            return(CSharpFileUtility.IsFileInPath(slashToCsharp, fileName, GetExtension(fileType)));
        }
Exemplo n.º 6
0
 public static string GetCsharpUnityAbsoluteFullPath(string childPath, string fileName, string extension)
 {
     return(CSharpFileUtility.ParseSlashToCsharp(GetUnityAbsoluteFullPath(childPath, fileName, extension)));
 }
Exemplo n.º 7
0
 public static string GetCsharpUnityAbsoluteFolderPath(string childPath)
 {
     return(CSharpFileUtility.ParseSlashToCsharp(GetUnityAbsoluteFolderPath(childPath)));
 }