SpriteManager 2
 All Classes Functions Variables Enumerations Enumerator Properties
SuperSprite Class Reference

Inherits MonoBehaviour.

Public Member Functions

delegate void AnimCompleteDelegate (SuperSprite sprite)
 
void PlayAnim (SuperSpriteAnim anim)
 Plays the specified SuperSprite animation. More...
 
void PlayAnim (int index)
 Plays the specified SuperSprite animation. More...
 
void PlayAnim (string anim)
 Plays the specified SuperSprite animation. More...
 
void DoAnim (SuperSpriteAnim anim)
 Plays the specified SuperSprite animation, but only if it isn't playing already. More...
 
void DoAnim (int index)
 Plays the specified SuperSprite animation, but only if it isn't playing already. More...
 
void DoAnim (string name)
 Plays the specified SuperSprite animation, but only if it isn't playing already. More...
 
void StopAnim ()
 Stops the current animation from playing and resets it to the beginning for playing again. More...
 
void PauseAnim ()
 Pauses the currently playing animation. More...
 
void UnpauseAnim ()
 Resumes an animation from where it left off previously. More...
 
void Hide (bool tf)
 Hides the SuperSprite. More...
 
bool IsHidden ()
 Returns whether the SuperSprite is hidden. More...
 
SuperSpriteAnim GetCurAnim ()
 
SuperSpriteAnim GetAnim (int index)
 Returns the SuperSpriteAnim at the specified index. More...
 
SuperSpriteAnim GetAnim (string name)
 Returns the SuperSpriteAnim with the specified name. More...
 
bool IsAnimating ()
 Returns whether an animation is playing. More...
 
void SetAnimCompleteDelegate (AnimCompleteDelegate del)
 Sets the delegate to be called upon animation completion. More...
 
void SetAnimFrameDelegate (SpriteBase.AnimFrameDelegate del)
 Sets the delegate to be called each frame of animation. More...
 

Public Attributes

bool playDefaultAnimOnStart = false
 Whether or not to play the default animation when the object is started. More...
 
int defaultAnim = 0
 The default animation. More...
 
SuperSpriteAnim[] animations = new SuperSpriteAnim[0]
 The animations that comprise this SuperSprite. More...
 

Properties

SpriteRoot CurrentSprite [get]
 Returns a reference to the sprite that is currently showing for the current animation, if any. More...
 

Detailed Description

Wraps functionality of multiple sprites, allowing you to define animations on multiple sprites, which may use multiple materials/atlases, and then link them together and use them at runtime as though they were a single sprite.

Definition at line 473 of file SuperSprite.cs.

Member Function Documentation

delegate void SuperSprite.AnimCompleteDelegate ( SuperSprite  sprite)

Defines a delegate that can be called upon animation completion. Use this if you want something to happen as soon as an animation reaches the end. Receives a reference to the SuperSprite.

Parameters
spriteA reference to the SuperSprite whose animation has finished.
void SuperSprite.DoAnim ( SuperSpriteAnim  anim)

Plays the specified SuperSprite animation, but only if it isn't playing already.

Parameters
animThe SuperSprite animation to be played.

Definition at line 583 of file SuperSprite.cs.

void SuperSprite.DoAnim ( int  index)

Plays the specified SuperSprite animation, but only if it isn't playing already.

Parameters
indexThe index of the SuperSprite animation to be played.

Definition at line 594 of file SuperSprite.cs.

void SuperSprite.DoAnim ( string  name)

Plays the specified SuperSprite animation, but only if it isn't playing already.

Parameters
animThe name of the SuperSprite animation to be played.

Definition at line 607 of file SuperSprite.cs.

SuperSpriteAnim SuperSprite.GetAnim ( int  index)

Returns the SuperSpriteAnim at the specified index.

Parameters
indexThe index of the desired animation.
Returns
The desired animation, or null if the index is out of range.

Definition at line 720 of file SuperSprite.cs.

SuperSpriteAnim SuperSprite.GetAnim ( string  name)

Returns the SuperSpriteAnim with the specified name.

Parameters
nameThe name of the desired animation.
Returns
The desired animation, or null if no matching animation is found.

Definition at line 733 of file SuperSprite.cs.

SuperSpriteAnim SuperSprite.GetCurAnim ( )

Returns a reference to the currently selected animation. NOTE: This does not mean the animation is currently playing. To determine whether the animation is playing, use IsAnimating

Returns
Reference to the currently selected animation.

Definition at line 694 of file SuperSprite.cs.

void SuperSprite.Hide ( bool  tf)

Hides the SuperSprite.

Parameters
tf

Definition at line 655 of file SuperSprite.cs.

bool SuperSprite.IsAnimating ( )

Returns whether an animation is playing.

Returns
Whether an animation is currently playing.

Definition at line 746 of file SuperSprite.cs.

bool SuperSprite.IsHidden ( )

Returns whether the SuperSprite is hidden.

Returns
True if hidden, false otherwise.

Definition at line 678 of file SuperSprite.cs.

void SuperSprite.PauseAnim ( )

Pauses the currently playing animation.

Definition at line 631 of file SuperSprite.cs.

void SuperSprite.PlayAnim ( SuperSpriteAnim  anim)

Plays the specified SuperSprite animation.

Parameters
animThe SuperSprite animation to be played.

Definition at line 534 of file SuperSprite.cs.

void SuperSprite.PlayAnim ( int  index)

Plays the specified SuperSprite animation.

Parameters
indexThe index of the SuperSprite animation to be played.

Definition at line 556 of file SuperSprite.cs.

void SuperSprite.PlayAnim ( string  anim)

Plays the specified SuperSprite animation.

Parameters
animThe name of the SuperSprite animation to be played.

Definition at line 568 of file SuperSprite.cs.

void SuperSprite.SetAnimCompleteDelegate ( AnimCompleteDelegate  del)

Sets the delegate to be called upon animation completion.

Parameters
delThe delegate to be called when an animation finishes playing.

Definition at line 792 of file SuperSprite.cs.

void SuperSprite.SetAnimFrameDelegate ( SpriteBase.AnimFrameDelegate  del)

Sets the delegate to be called each frame of animation.

Parameters
delThe delegate to be called each frame of animation.

Definition at line 801 of file SuperSprite.cs.

void SuperSprite.StopAnim ( )

Stops the current animation from playing and resets it to the beginning for playing again.

Definition at line 620 of file SuperSprite.cs.

void SuperSprite.UnpauseAnim ( )

Resumes an animation from where it left off previously.

Definition at line 642 of file SuperSprite.cs.

Member Data Documentation

SuperSpriteAnim [] SuperSprite.animations = new SuperSpriteAnim[0]

The animations that comprise this SuperSprite.

Definition at line 498 of file SuperSprite.cs.

int SuperSprite.defaultAnim = 0

The default animation.

Definition at line 493 of file SuperSprite.cs.

bool SuperSprite.playDefaultAnimOnStart = false

Whether or not to play the default animation when the object is started.

Definition at line 488 of file SuperSprite.cs.

Property Documentation

SpriteRoot SuperSprite.CurrentSprite
get

Returns a reference to the sprite that is currently showing for the current animation, if any.

Definition at line 705 of file SuperSprite.cs.


The documentation for this class was generated from the following file: