Exposing Secondary Textures at runtime

From what I can tell, the ability to set Secondary Textures from script now only exists in Editor on the TextureImporter. Yet SecondarySpriteTexture looks like it exists in the engine itself, so I am wondering if it is possible to expose a setter so I may assign them at runtime.

Context: I’m generating spritesheets out of vanilla and mod sprites on startup. Secondary Textures are super-nifty for avoiding material swaps or thinking about materials at all. It would simplify a lot.

2 Likes

And a getter. Similar request: How to get SecondaryTexture at runtime?

1 Like

+1
Yeah, this would be really useful!
I’m making a game where the textures are loaded in at runtime (since I want to allow modding later on). Exposing the secondary textures is the only way I could get normal map effects. Thanks!

2 Likes

2022.2 Unity 2022.2.0a9

Thank you, Unity!

1 Like

Ah you beat me in getting back on this thread :smile:
Do let us know how it goes when you manage to try it out.

1 Like