Hello!
I have an automated system (Unity 2020.2.0f1) where I pick a bunch of separated sprites with a secondary Normal Map, and I add them to a generated SpriteAtlas asset. Works good, but the normal map needs to have the sRGB option uncheked.
In the editor, this is done through the Secondary Settings panel:
However, since this is an editor script, I need to add this secondary settings through C#, but I don’t find any method nor documentation to do this.
What I do right now is:
atlas.Add(spriteFiles.ToArray());
//This texture settings are only for the primary texture. Is there a way of doing the same to the secondary Normal Map?
SpriteAtlasTextureSettings newTextSettings = new SpriteAtlasTextureSettings();
newTextSettings.filterMode = FilterMode.Point;
newTextSettings.sRGB = true;
atlas.SetTextureSettings(newTextSettings);
TextureImporterPlatformSettings newPlatformSettings = new TextureImporterPlatformSettings();
newPlatformSettings.textureCompression = TextureImporterCompression.Uncompressed;
atlas.SetPlatformSettings(newPlatformSettings);
AssetDatabase.CreateAsset(atlas, atlasPath);
AssetDatabase.SaveAssets();
Is not the biggest of the deals (the script already lifts a lot of work for me), but I would like to spare me some repetitive clicks.


