Unity4.6 Ugui Picture Packaging settings (small images packaged into Atlas Spritepacker)

Source: Internet
Author: User

In the process of learning Ugui, have been using a small map is a scatter, a button a picture, an icon of a picture, so that each picture has a drawcall.

Before the company's games are used Unity4.3+ngui, in the NGUI can use the Texturepacker, first the small picture into a large picture, and then set in the NGUI to refer to the large image of which piece as a picture, this can reduce a lot of drawcall.

But in the Ugui there is no way to use Texturepacker, but also confused for a few days.

After the Baidu Google has been looking for, only to find that the original Unity4.6 with the Atlas packaging tools Spritepacker.


In Unity4.6, we drag a picture into project and can set its purpose, texture or 2DUI. And notice that there is one more Packing tag set item. This setting is the name of the atlas that you set up a small image to package into a larger image!


Attention:

Images placed in resources, unity will not be packaged in a collection!


Consider the following example:

I put 7 images in the interface, each image is a different picture



Loved the 7 drawcall,7 a picture of 7 Drawcall, well, the boss let me go tomorrow.


Then let's look at how to open the Automatic Atlas package that comes with unity.


First, Unity does not open the Atlas Packaging tool in the editor environment by default, and the auto-packaged atlas is performed only when the build is set.


Edit-project Setting-editor

Default settings:



We modified to:


Always enable Sprite Packer so that we can also use auto-packaged atlas in an editor environment.

Again to run look under:



Well? or 7 drawcall,unity pits us?


Actually not, carefully think again, above mentioned Packing Tag This parameter, is set.


Since the Packing Tag is not set, unity should not know how to pack the atlas ... because there is no name.


Let's set a name for these 7 images, like test, then save apply and run the test again


Why are there two? Unity Pits us!!


Actually not, because of these 7 pictures, there is a picture I put in the resources folder inside, said, theresources in the picture unity is not packaged Oh!


So, where does unity pack our little pictures, we can't find them, eat them? I want to look at the effect of what to do!


In the Unity menu window there is a Sprite Packer, we open it



Here you can see the packaged atlas.


The red box on the left is the Atlas name, which is the Packing Tag we set.

The second one is packaged, packaged by default, and packaged in a compact form, with no big difference between the two. The above 7 pictures with Texturepacker packaging only 512x512 size, but with Unity's sprite Packer packaging is 1024x512 ... This is confusing.



Unity4.6 Ugui Picture Packaging settings (small images packaged into Atlas Spritepacker)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.