Version: 2020.2
Methods of distribution
Resolving different Sprite Atlas scenarios

Late Binding

Late Binding is the name of a process in which you load or swap in the desired Sprite Atlas at run time via the Sprite Atlas API. This is necessary when the build does not automatically load a prepared Sprite Atlas at run time (for example, when no Sprite Atlases are included in the build.

Sprites enumeration at run time

To retrieve the contents of a Sprite Atlas at run time, follow these steps:

  1. Create a custom component that takes SpriteAtlasas a public variable.
  2. Assign a Sprite Atlas to the field.
  3. Enter the Editor’s Play Mode.
  4. Access the variable and call the property .GetSprites to retrieve the array of Sprites packed in the selected Atlas.
Methods of distribution
Resolving different Sprite Atlas scenarios
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961