C# Class tk2dSpriteCollectionData, Malisse

Sprite Collection Data.
Inheritance: MonoBehaviour
Exibir arquivo Open project: Collegiennes/Malisse Class Usage Examples

Public Properties

Property Type Description
allowMultipleAtlases bool
assetName string
buildKey int
dataGuid string
halfTargetHeight float
hasPlatformData bool
invOrthoSize float
managedSpriteCollection bool
material Material
materialIdsValid bool
materials Material[]
needMaterialInstance bool
premultipliedAlpha bool
spriteCollectionGUID string
spriteCollectionName string
spriteCollectionPlatformGUIDs string[]
spriteCollectionPlatforms string[]
spriteDefinitions tk2dSpriteDefinition[],
textures Texture[]
version int

Public Methods

Method Description
CreateFromTexture ( Texture2D texture, tk2dRuntime size, string names, Rect regions, Vector2 anchors ) : tk2dSpriteCollectionData,

Create a sprite collection at runtime from a texture and user specified regions. Please ensure that names, regions & anchor arrays have same dimension. Use tk2dBaseSprite.CreateFromTexture if you need to create only one sprite from a texture.

GetSpriteIdByName ( string name ) : int

Resolves a sprite name and returns a unique id for the sprite.

Init ( ) : void
InitDictionary ( ) : void

Initializes the lookup dictionary

InitMaterialIds ( ) : void

Internal function to make sure all material Ids are valid. Used in the tilemap editor

OnDestroy ( ) : void
ResetPlatformData ( ) : void

Method Details

CreateFromTexture() public static method

Create a sprite collection at runtime from a texture and user specified regions. Please ensure that names, regions & anchor arrays have same dimension. Use tk2dBaseSprite.CreateFromTexture if you need to create only one sprite from a texture.
public static CreateFromTexture ( Texture2D texture, tk2dRuntime size, string names, Rect regions, Vector2 anchors ) : tk2dSpriteCollectionData,
texture UnityEngine.Texture2D
size tk2dRuntime
names string
regions Rect
anchors Vector2
return tk2dSpriteCollectionData,

GetSpriteIdByName() public method

Resolves a sprite name and returns a unique id for the sprite.
public GetSpriteIdByName ( string name ) : int
name string Case sensitive sprite name, as defined in the sprite collection. This is usually the source filename excluding the extension
return int

Init() public method

public Init ( ) : void
return void

InitDictionary() public method

Initializes the lookup dictionary
public InitDictionary ( ) : void
return void

InitMaterialIds() public method

Internal function to make sure all material Ids are valid. Used in the tilemap editor
public InitMaterialIds ( ) : void
return void

OnDestroy() public method

public OnDestroy ( ) : void
return void

ResetPlatformData() public method

public ResetPlatformData ( ) : void
return void

Property Details

allowMultipleAtlases public_oe property

Specifies if sprites span multiple atlases.
public bool allowMultipleAtlases
return bool

assetName public_oe property

Asset Name, used to load the asset
public string assetName
return string

buildKey public_oe property

public int buildKey
return int

dataGuid public_oe property

GUID of this object, used with tk2dIndex
public string dataGuid
return string

halfTargetHeight public_oe property

Target height used to generate the sprite collection.
public float halfTargetHeight
return float

hasPlatformData public_oe property

When true, spriteCollectionPlatforms & PlatformGUIDs are expected to have sensible data.
public bool hasPlatformData
return bool

invOrthoSize public_oe property

The size of the inv ortho size used to generate the sprite collection.
public float invOrthoSize
return float

managedSpriteCollection public_oe property

When true, sprite collection will not be directly selectable
public bool managedSpriteCollection
return bool

material public_oe property

Only exists for backwards compatibility. Do not use or rely on this.
public Material material
return Material

materialIdsValid public_oe property

public bool materialIdsValid
return bool

materials public_oe property

An array of all materials used by this sprite collection.
public Material[] materials
return Material[]

needMaterialInstance public_oe property

public bool needMaterialInstance
return bool

premultipliedAlpha public_oe property

Whether premultiplied alpha is enabled on this sprite collection. This affects how tint colors are computed.
public bool premultipliedAlpha
return bool

spriteCollectionGUID public_oe property

The sprite collection GUI.
public string spriteCollectionGUID
return string

spriteCollectionName public_oe property

The name of the sprite collection.
public string spriteCollectionName
return string

spriteCollectionPlatformGUIDs public_oe property

Returns an array of GUIDs, each referring to an actual tk2dSpriteCollectionData object This object contains the actual sprite collection for the platform.
public string[] spriteCollectionPlatformGUIDs
return string[]

spriteCollectionPlatforms public_oe property

Returns an array of platform names.
public string[] spriteCollectionPlatforms
return string[]

spriteDefinitions public_oe property

An array of sprite definitions.
public tk2dSpriteDefinition[], spriteDefinitions
return tk2dSpriteDefinition[],

textures public_oe property

An array of all textures used by this sprite collection.
public Texture[] textures
return Texture[]

version public_oe property

public int version
return int