Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Feature Request Exposing Secondary Textures at runtime

Discussion in '2D Experimental Preview' started by Lo-renzo, Sep 24, 2020.

  1. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,514
    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.
     
    theforgot3n1 and NotaNaN like this.
  2. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,514
    Last edited: Oct 2, 2020
    theforgot3n1 likes this.
  3. mseithe

    mseithe

    Joined:
    Feb 17, 2017
    Posts:
    19
    +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!
     
    theforgot3n1 and RyhorKorneu like this.
  4. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,514
    2022.2 https://unity3d.com/unity/alpha/2022.2.0a9
    Thank you, Unity!
     
    Leo-Yaik likes this.
  5. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    436
    Ah you beat me in getting back on this thread :D
    Do let us know how it goes when you manage to try it out.
     
    Lo-renzo likes this.