C# Class PackedSprite, urban-survivors

This implements SpriteBase and adds animation functionality allowing the user to define their sprite animations using individual, non-uniform sprite textures which will then be compiled into a sprite atlas automatically.
Inheritance: AutoSpriteBase
Show file Open project: exdev/urban-survivors Class Usage Examples

Public Properties

Property Type Description
textureAnimations TextureAnim[],

Public Methods

Method Description
AddAnimation ( UVAnimation, anim ) : void

Adds an animation to the sprite for its use.

Aggregate ( PathFromGUIDDelegate guid2Path, LoadAssetDelegate load, GUIDFromPathDelegate path2Guid ) : void

Collects all textures intended for packing, as well as sprite frames, together into a standard form for processing.

Copy ( SpriteRoot, s ) : void

Copies all the attributes of another sprite.

Create ( string name, Vector3 pos ) : PackedSprite,

Creates a GameObject and attaches this component type to it.

Create ( string name, Vector3 pos, Quaternion rotation ) : PackedSprite,

Creates a GameObject and attaches this component type to it.

GetDefaultPixelSize ( PathFromGUIDDelegate guid2Path, AssetLoaderDelegate loader ) : Vector2
InitUVs ( ) : void
Start ( ) : void

Protected Methods

Method Description
Awake ( ) : void
Init ( ) : void

Method Details

AddAnimation() public method

Adds an animation to the sprite for its use.
public AddAnimation ( UVAnimation, anim ) : void
anim UVAnimation, The animation to add
return void

Aggregate() public method

Collects all textures intended for packing, as well as sprite frames, together into a standard form for processing.
public Aggregate ( PathFromGUIDDelegate guid2Path, LoadAssetDelegate load, GUIDFromPathDelegate path2Guid ) : void
guid2Path PathFromGUIDDelegate
load LoadAssetDelegate
path2Guid GUIDFromPathDelegate
return void

Awake() protected method

protected Awake ( ) : void
return void

Copy() public method

Copies all the attributes of another sprite.
public Copy ( SpriteRoot, s ) : void
s SpriteRoot, A reference to the sprite to be copied.
return void

Create() static public method

Creates a GameObject and attaches this component type to it.
static public Create ( string name, Vector3 pos ) : PackedSprite,
name string Name to give to the new GameObject.
pos Vector3 Position, in world space, where the new object should be created.
return PackedSprite,

Create() static public method

Creates a GameObject and attaches this component type to it.
static public Create ( string name, Vector3 pos, Quaternion rotation ) : PackedSprite,
name string Name to give to the new GameObject.
pos Vector3 Position, in world space, where the new object should be created.
rotation Quaternion Rotation of the object.
return PackedSprite,

GetDefaultPixelSize() public method

public GetDefaultPixelSize ( PathFromGUIDDelegate guid2Path, AssetLoaderDelegate loader ) : Vector2
guid2Path PathFromGUIDDelegate
loader AssetLoaderDelegate
return Vector2

Init() protected method

protected Init ( ) : void
return void

InitUVs() public method

public InitUVs ( ) : void
return void

Start() public method

public Start ( ) : void
return void

Property Details

textureAnimations public property

The animations as defined using individual textures. See TextureAnim
public TextureAnim[], textureAnimations
return TextureAnim[],