Pictures, Atlas into the dependencies of the ab package, Include in build

After we unpacked the ab package, we found that a picture was packaged into an ab package, which contained 1 sprite and a texture2d. This is because we did not make an atlas, and unity automatically generated an atlas of a single picture for us, so It is not conducive to ui batching.

pack pictures

  1. Atlas not printed. A folder, n pictures, typed into an ab package, which contains n sprites and n atlas texture2d.

  1. Atlas not printed. Multiple folders, n pictures, typed into an ab package, there are n sprites and n atlas texture2d in the package.

  1. Create an atlas, a folder, n pictures, and enter an ab package, which contains n sprites and 1 atlas texture2d.

  1. Create an atlas, multiple folders, n pictures, and enter an ab package, which contains n sprites and 1 atlas texture2d.

[The sprite records the width and height of the small image and its position in the texture atlas]

AtlasInclude in build

  1. This option is actually the reference relationship between the sprite and the atlas. If you don’t check it, there will be no reference relationship. You need to manually bind the relationship to display it correctly.

  1. Uncheck Include in build, you need to manually bind SpriteAtlasManager.atlasRequested += OnAtlasRequested

  1. Check Include in build, you need to load the ab package where atlas is located in the memory first , and automatically bind it. If it is not loaded into the memory first, you also need to manually bind SpriteAtlasManager.atlasRequested += OnAtlasRequested

  1. For hot update, the solution is: sprite source files are packaged separately, atlas is packaged separately, and prefab is packaged separately. When updating pictures, just replace the sprite and atlas packages.

Guess you like

Origin blog.csdn.net/Ling_SevoL_Y/article/details/128780313