Hello,
I’ve encountered a very weird problem using ImporterPlatformSettings when I want to set sprite atlas import platform settings inside code (runtime). Code looks like this:
private void CreateAtlas()
{
SpriteAtlas atl = new SpriteAtlas();
SetUpPlatformSetting(atl, BuildTarget.iOS);
SetUpPlatformSetting(atl, BuildTarget.Android);
AssetDatabase.CreateAsset(atl, "Assets/test.spriteatlas");
}
private void SetUpPlatformSetting(SpriteAtlas atl, BuildTarget target)
{
var platformSettings = atl.GetPlatformSettings(target.ToString());
platformSettings.overridden = true;
platformSettings.maxTextureSize = 2048;
platformSettings.format = target == BuildTarget.Android ? TextureImporterFormat.ASTC_12x12 : TextureImporterFormat.PVRTC_RGBA2;
atl.SetPlatformSettings(platformSettings);
atl.SetIncludeInBuild(false);
}
Firstly, I’m creating a sprite atlas (tested empty and not empty) and after that, I want to set specific properties on iOS and Android platform settings. For some reason, the output looks wrong for iOS - the “overriden” flag is still disabled and this setting is not changed. Look at the attached screenshots below:
Android:
iOS:
Unity version - 2020.3.20f1
Am I doing something wrong?

