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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How can I import images as a group

Discussion in 'Editor & General Support' started by Nervly, Jul 7, 2017.

  1. Nervly

    Nervly

    Joined:
    Mar 15, 2016
    Posts:
    19
    Greetings!

    I'd like to know if it is possible to import images to Unity as "groups". To explain better what I mean, here:



    Inside the black square you can see a bunch of card pictures. The way I got them this way was by using the Sprite Editor > Slice feature on the original image (the very first one, to the left of the red circle and that I got from the internet) and then drag the original image (so the whole group) into the Sprite field in the green rectangle to the right. However, I need to import different pictures but I can't get them to be imported in a way that would look just like the first picture. Here's a screenshot of what I'm seeing right now with the other pictures I need:



    As you can see, inside the black rectangle (and the ones outsides), are all the pictures I need to be imported inside one whole group, but as I import them, they're all presented that way and each one is a group of its own picture (as you can tell by the red circles). I thought of merging all the pictures together into a grid and then using the Sprite Editor to slice them, but they're way too many to do that. So I'd like to know if there's anyway to import them into a group (not a folder, something that looks exactly like the first screenshot) so I could then put them as a whole into the Sprite field (the one in the green rectangle) just like I did with the normal cards.

    Thank you in advance,
    - Nervly
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,876
    If I understand you correctly it sounds like you want Unity to generate atlases for your from your many sprites. Yes this is possible. You need to give them the same packing tag in the Sprite asset settings. Then you can use the sprite packer: https://docs.unity3d.com/Manual/SpritePacker.html
     
  3. Nervly

    Nervly

    Joined:
    Mar 15, 2016
    Posts:
    19
    Thank you for your reply! I'm sorry for the late answer, but I haven't had internet for the past couple weeks.

    I did as you suggested and I got to this:


    Is there anyway I can put this packed sprite into the Sprite Editor so I can then use the Slice function to separate all the cards?

    Thank you!
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,876
    Im not sure what you mean? You should be able to continue using the sprites as before but when they are rendered Unity will combine them into an atlas and adjust the UVs so that they are all on a single atlas and provide better batching.