mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2025-12-16 22:19:31 +07:00
unity 5.5 fixes
This commit is contained in:
@@ -216,7 +216,11 @@ namespace FTEditor.Postprocessors {
|
||||
atlas_importer.spritePixelsPerUnit = asset.Settings.PixelsPerUnit;
|
||||
atlas_importer.mipmapEnabled = asset.Settings.GenerateMipMaps;
|
||||
atlas_importer.filterMode = SwfAtlasFilterToImporterFilter(asset.Settings.AtlasTextureFilter);
|
||||
#if UNITY_5_5_OR_NEWER
|
||||
atlas_importer.textureCompression = SwfAtlasFormatToImporterCompression(asset.Settings.AtlasTextureFormat);
|
||||
#else
|
||||
atlas_importer.textureFormat = SwfAtlasFormatToImporterFormat(asset.Settings.AtlasTextureFormat);
|
||||
#endif
|
||||
AssetDatabase.WriteImportSettingsIfDirty(atlas_path);
|
||||
}
|
||||
|
||||
@@ -248,24 +252,37 @@ namespace FTEditor.Postprocessors {
|
||||
}
|
||||
}
|
||||
|
||||
static TextureImporterFormat SwfAtlasFormatToImporterFormat(
|
||||
#if UNITY_5_5_OR_NEWER
|
||||
static TextureImporterCompression SwfAtlasFormatToImporterCompression(
|
||||
SwfSettingsData.AtlasFormat format)
|
||||
{
|
||||
switch ( format ) {
|
||||
case SwfSettingsData.AtlasFormat.AutomaticCompressed:
|
||||
return TextureImporterFormat.AutomaticCompressed;
|
||||
case SwfSettingsData.AtlasFormat.Automatic16bit:
|
||||
return TextureImporterFormat.Automatic16bit;
|
||||
return TextureImporterCompression.Compressed;
|
||||
case SwfSettingsData.AtlasFormat.AutomaticTruecolor:
|
||||
return TextureImporterFormat.AutomaticTruecolor;
|
||||
case SwfSettingsData.AtlasFormat.AutomaticCrunched:
|
||||
return TextureImporterFormat.AutomaticCrunched;
|
||||
return TextureImporterCompression.Uncompressed;
|
||||
default:
|
||||
throw new UnityException(string.Format(
|
||||
"incorrect swf atlas format ({0})",
|
||||
format));
|
||||
}
|
||||
}
|
||||
#else
|
||||
static TextureImporterFormat SwfAtlasFormatToImporterFormat(
|
||||
SwfSettingsData.AtlasFormat format)
|
||||
{
|
||||
switch ( format ) {
|
||||
case SwfSettingsData.AtlasFormat.AutomaticCompressed:
|
||||
return TextureImporterFormat.AutomaticCompressed;
|
||||
case SwfSettingsData.AtlasFormat.AutomaticTruecolor:
|
||||
return TextureImporterFormat.AutomaticTruecolor;
|
||||
default:
|
||||
throw new UnityException(string.Format(
|
||||
"incorrect swf atlas format ({0})",
|
||||
format));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -11,10 +11,8 @@ namespace FTRuntime {
|
||||
}
|
||||
|
||||
public enum AtlasFormat {
|
||||
AutomaticCompressed,
|
||||
Automatic16bit,
|
||||
AutomaticTruecolor,
|
||||
AutomaticCrunched
|
||||
AutomaticCompressed = 0,
|
||||
AutomaticTruecolor = 2
|
||||
}
|
||||
|
||||
[SwfPowerOfTwoIfAttribute(5, 13, "AtlasPowerOfTwo")]
|
||||
|
||||
Reference in New Issue
Block a user