| | |
| | | public const string TARGET_FOLDER = "Assets/ResourcesOut"; |
| | | |
| | | // ---- 图集固定尺寸 ---- |
| | | public const int ATLAS_MAX_SIZE = 2048; |
| | | public const int ATLAS_MAX_SIZE = 1024; |
| | | |
| | | // ---- 压缩质量 ---- |
| | | public const int COMPRESSION_QUALITY = 50; |
| | |
| | | /// </summary> |
| | | public static bool ApplyAtlasPlatformSettings(SpriteAtlasImporter importer) |
| | | { |
| | | bool changed = false; |
| | | bool changed = ApplyAtlasMaxTextureSize(importer); |
| | | |
| | | // Android → ETC2_RGBA8(图集始终含 Alpha) |
| | | { |
| | |
| | | return changed; |
| | | } |
| | | |
| | | public static bool ApplyAtlasMaxTextureSize(SpriteAtlasImporter importer) |
| | | { |
| | | bool changed = false; |
| | | foreach (var platform in new[] { "Standalone", "Android", "iPhone", "WebGL", "DefaultTexturePlatform" }) |
| | | { |
| | | var settings = importer.GetPlatformSettings(platform); |
| | | if (settings.maxTextureSize == ATLAS_MAX_SIZE) |
| | | continue; |
| | | |
| | | settings.maxTextureSize = ATLAS_MAX_SIZE; |
| | | importer.SetPlatformSettings(settings); |
| | | changed = true; |
| | | } |
| | | |
| | | return changed; |
| | | } |
| | | |
| | | // ============================================================ |
| | | // 工具方法 |
| | | // ============================================================ |