pub struct SpriteAtlas {
pub m_IsVariant: bool,
pub m_Name: String,
pub m_PackedSpriteNamesToIndex: Vec<String>,
pub m_PackedSprites: Vec<PPtr>,
pub m_RenderDataMap: Vec<((GUID, i64), SpriteAtlasData)>,
pub m_Tag: String,
}Expand description
SpriteAtlas is a class of the Unity engine since version 2017.1.0b1. Exert from Unity’s scripting documentation: Sprite Atlas is an asset created within Unity. It is part of the built-in sprite packing solution. A Sprite Atlas stores a list of packable assets. A packable asset is either a Sprite, Texture2D of TextureImporterType.Sprite or Folder. Before the packing process begins, these packable assets will be grouped and traversed to gather all the sprites from them. These will be used in the packing process. At runtime, these sprites can be enumerated via the Sprite Atlas (See Also: SpriteAtlas.GetSprites).It also provides dedicated texture settings in the inspector for the packed texture. The original texture settings of the sprite will have no effect on the packed texture.By default, Sprite Atlas will be referenced by the sprite and be available at runtime. This means that the sprite will be able to acquire the packed texture from the Sprite Atlas when loaded. A Sprite can be loaded without referencing any Sprite Atlas. A Sprite loaded this way will render as invisible since there is no texture. A reference to a Sprite Atlas can be added later. See Also: SpriteAtlasManager.Sprite Atlas variants can be created by assigning another Sprite Atlas object as the master. Variants will not repack a new texture from the packable list. Instead of this, variants will duplicate the master’s packed texture and downscale it according to a user-defined ratio and save this scaled texture.
Fields§
§m_IsVariant: boolReturn true if this SpriteAtlas is a variant.
m_Name: StringThe name of the object.
m_PackedSpriteNamesToIndex: Vec<String>§m_PackedSprites: Vec<PPtr>Vec<PPtr<Sprite>>: (2017.1.0b1 - 2022.3.2f1)
m_RenderDataMap: Vec<((GUID, i64), SpriteAtlasData)>§m_Tag: StringGet the tag of this SpriteAtlas.