Skip to content

Commit b5ef4c6

Browse files
committed
Remove redundant SaveAndImportTexture function
1 parent ae5771e commit b5ef4c6

File tree

1 file changed

+0
-34
lines changed
  • Packages/dev.koz39.icon-generator/Editor

1 file changed

+0
-34
lines changed

Packages/dev.koz39.icon-generator/Editor/Utils.cs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -101,40 +101,6 @@ public static string SanitizeFileName(string name)
101101
return Regex.Replace(name, invalidRegStr, "_");
102102
}
103103

104-
public static void SaveAndImportTexture(string filePath, byte[] bytes, Localization localization, string completionMsgKeyName, string importerWarningMsgKeyName, string failedMsgKeyName)
105-
{
106-
try
107-
{
108-
File.WriteAllBytes(filePath, bytes);
109-
AssetDatabase.ImportAsset(filePath);
110-
111-
TextureImporter importer = AssetImporter.GetAtPath(filePath) as TextureImporter;
112-
if (importer != null)
113-
{
114-
importer.alphaIsTransparency = true;
115-
importer.textureType = TextureImporterType.Sprite;
116-
importer.SaveAndReimport();
117-
}
118-
else
119-
{
120-
Debug.LogWarning(localization.GetLocalizedText(importerWarningMsgKeyName, filePath));
121-
}
122-
Debug.Log(localization.GetLocalizedText(completionMsgKeyName, filePath));
123-
}
124-
catch (System.IO.IOException ex)
125-
{
126-
Debug.LogError(localization.GetLocalizedText("ErrorSavingTextureFile", filePath, ex.Message));
127-
}
128-
catch (System.UnauthorizedAccessException ex)
129-
{
130-
Debug.LogError(localization.GetLocalizedText("PermissionErrorSavingTextureFile", filePath, ex.Message));
131-
}
132-
catch (System.Exception e)
133-
{
134-
Debug.LogError(localization.GetLocalizedText(failedMsgKeyName, e.Message, e.StackTrace));
135-
}
136-
}
137-
138104
public static void SaveAndImportIconTexture(string filePath, byte[] bytes, Localization localization, bool pingAsset)
139105
{
140106
try

0 commit comments

Comments
 (0)