Search Unity

Creating prefabs from textures fast

Discussion in 'Immediate Mode GUI (IMGUI)' started by FeastSC2, Apr 17, 2017.

  1. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    Dragging and dropping several textures creates animations in Unity and not prefabs. I would like to create prefabs (they're for a 2d game so I don't need anything fancy on it like meshes and so on).

    I have been using AssetPostProcessor so far to create the prefabs automatically as soon as I had dragged textures into Unity and it was going fine, but now I realize I must actually pack my textures for optimizations which I believe makes this workflow obsolete.

    Is there another way to create prefabs from textures that's easy?
    Thanks for any help!
     
  2. npatch

    npatch

    Joined:
    Jun 26, 2015
    Posts:
    247
    If I may, why do you need prefabs made from textures?
     
  3. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    So yea, to reiterate: it's to create prefabs out of all my textures as soon as I import them into unity.

    Once that's done, a custom tool I made will read them and I can easily place them and make my levels.
     
  4. npatch

    npatch

    Joined:
    Jun 26, 2015
    Posts:
    247
    You could try to use PackingTag in AssetPostProcessor. It still declares your texture as something to be packed. I think after packing the reference to the sprite gets changed to the atlas subtexture.
     
  5. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    Oh great, I'll try that out ;).