C# 클래스 Spine.Unity.Modules.AttachmentTools.SpriteAtlasRegionExtensions

파일 보기 프로젝트 열기: EsotericSoftware/spine-runtimes

공개 메소드들

메소드 설명
GetRepackedSkin ( this o, string newName, Shader shader, Material &m, Texture2D &t, int maxAtlasSize = 1024, int padding = 2 ) : Skin

Creates and populates a duplicate skin with cloned attachments that are backed by a new packed texture atlas comprised of all the regions from the original skin.

No Spine.Atlas object is created so there is no way to find AtlasRegions except through the Attachments using them.

ToAtlasRegion ( this s, AtlasPage page ) : AtlasRegion

Creates a Spine.AtlasRegion from a UnityEngine.Sprite.

ToAtlasRegion ( this s, Material material ) : AtlasRegion

Creates a Spine.AtlasRegion from a UnityEngine.Sprite. This creates a new AtlasPage object for every AtlasRegion you create. You can centralize Material control by creating a shared atlas page using Material.ToSpineAtlasPage and using the sprite.ToAtlasRegion(AtlasPage) overload.

ToAtlasRegionPMAClone ( this s, Shader shader ) : AtlasRegion

Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate of the Sprite's texture data.

ToSpineAtlasPage ( this m ) : AtlasPage

Creates a new Spine.AtlasPage from a UnityEngine.Material. If the material has a preassigned texture, the page width and height will be set.

ToSprite ( this ar, float pixelsPerUnit = 100 ) : Sprite

비공개 메소드들

메소드 설명
ApplyPMA ( this texture, bool applyImmediately = true ) : void
GetAtlasRegion ( this a ) : AtlasRegion

Tries to get the backing AtlasRegion of an attachment if it is renderable. Returns null for non-renderable attachments.

GetMainTexture ( this region ) : Texture2D

Convenience method for getting the main texture of the material of the page of the region.

GetSpineAtlasRect ( this region, bool includeRotate = true ) : Rect

Returns a Rect of the AtlasRegion according to Spine texture coordinates. (x-right, y-down)

GetUnityRect ( this region ) : Rect

Gets the Rect of an AtlasRegion according to Unity texture coordinates (x-right, y-up). This overload relies on region.page.height being correctly set.

GetUnityRect ( this region, int textureHeight ) : Rect

Gets the Rect of an AtlasRegion according to Unity texture coordinates (x-right, y-up).

InverseLerp ( float a, float b, float value ) : float
IsRenderable ( Attachment a ) : bool
SpineUnityFlipRect ( this rect, int textureHeight ) : Rect

Get a rect with flipped Y so that a Spine atlas rect gets converted to a Unity Sprite rect and vice versa.

TextureRectToUVRect ( Rect textureRect, int texWidth, int texHeight ) : Rect

Normalize a texture Rect into UV coordinates.

ToAtlasRegion ( this s, bool isolatedTexture = false ) : AtlasRegion
ToTexture ( this ar, bool applyImmediately = true ) : Texture2D
UVRectToAtlasRegion ( Rect uvRect, string name, AtlasPage page, float offsetX, float offsetY, bool rotate ) : AtlasRegion

Creates a new Spine AtlasRegion according to a Unity UV Rect (x-right, y-up, uv-normalized).

UVRectToTextureRect ( Rect uvRect, int texWidth, int texHeight ) : Rect

Denormalize a uvRect into a texture-space Rect.

메소드 상세

GetRepackedSkin() 공개 정적인 메소드

Creates and populates a duplicate skin with cloned attachments that are backed by a new packed texture atlas comprised of all the regions from the original skin.
No Spine.Atlas object is created so there is no way to find AtlasRegions except through the Attachments using them.
public static GetRepackedSkin ( this o, string newName, Shader shader, Material &m, Texture2D &t, int maxAtlasSize = 1024, int padding = 2 ) : Skin
o this
newName string
shader UnityEngine.Shader
m UnityEngine.Material
t UnityEngine.Texture2D
maxAtlasSize int
padding int
리턴 Skin

ToAtlasRegion() 공개 정적인 메소드

Creates a Spine.AtlasRegion from a UnityEngine.Sprite.
public static ToAtlasRegion ( this s, AtlasPage page ) : AtlasRegion
s this
page AtlasPage
리턴 AtlasRegion

ToAtlasRegion() 공개 정적인 메소드

Creates a Spine.AtlasRegion from a UnityEngine.Sprite. This creates a new AtlasPage object for every AtlasRegion you create. You can centralize Material control by creating a shared atlas page using Material.ToSpineAtlasPage and using the sprite.ToAtlasRegion(AtlasPage) overload.
public static ToAtlasRegion ( this s, Material material ) : AtlasRegion
s this
material UnityEngine.Material
리턴 AtlasRegion

ToAtlasRegionPMAClone() 공개 정적인 메소드

Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate of the Sprite's texture data.
public static ToAtlasRegionPMAClone ( this s, Shader shader ) : AtlasRegion
s this
shader UnityEngine.Shader
리턴 AtlasRegion

ToSpineAtlasPage() 공개 정적인 메소드

Creates a new Spine.AtlasPage from a UnityEngine.Material. If the material has a preassigned texture, the page width and height will be set.
public static ToSpineAtlasPage ( this m ) : AtlasPage
m this
리턴 AtlasPage

ToSprite() 공개 정적인 메소드

public static ToSprite ( this ar, float pixelsPerUnit = 100 ) : Sprite
ar this
pixelsPerUnit float
리턴 UnityEngine.Sprite