Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How do you use SecondarySpriteTexture?

Discussion in 'Editor Workflows' started by ReadyPlayGames, Jun 15, 2019.

  1. ReadyPlayGames

    ReadyPlayGames

    Joined:
    Jan 24, 2015
    Posts:
    49
    In 2019.1, SecondarySpriteTexture was added, but I can't find anything in the editor or any use of it. It sounds intriguing, but how does one use this?

    • TextureImporter.secondarySpriteTextures, which lets you assign secondary textures to a texture asset imported as Sprite

    What does the secondary sprite texture do?
     
  2. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,554
    I guess it is just a way to make multiple sprites related to one main sprite with no specific purpose.. (no even Editor presentation anywhere, I see that the only way to confirm is by looking at the meta file) maybe it's up to you to use the importer to query them back and do something. This could be useful for external tools to express sprite hierarchy to Unity in the case of multiple sheets. (In which that external tools has a custom Unity inspector that knows to read back the secondary textures)

    Screenshot 2019-06-27 04.19.15.png

    (Maybe) all would be included in the build even if they are not used given that your main sprite was used somewhere because the build will scan all GUIDs in the meta? Not sure. EDIT: Yes I confirmed it is the case. I have only used main.png in the scene as Image's Sprite :

    Screenshot 2019-06-27 04.26.42.png
     
    Last edited: Jun 26, 2019
  3. ReadyPlayGames

    ReadyPlayGames

    Joined:
    Jan 24, 2015
    Posts:
    49
    Huh...alright. I'm still pretty confused as to its use, but thank for you the info! Perhaps it's for something down the road.
     
  4. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,554
    I just noticed there is an editor over here (2019.2)

    Screenshot 2019-07-11 20.42.07.png