C# Class SpriteBase, urban-survivors

Inheritance: SpriteRoot, ISpriteAnimatable
Afficher le fichier Open project: exdev/urban-survivors Class Usage Examples

Méthodes publiques

Свойство Type Description
defaultAnim int
playAnimOnStart bool

Protected Properties

Свойство Type Description
animCompleteDelegate AnimCompleteDelegate
animFrameDelegate AnimFrameDelegate
animating bool
curAnimIndex int
framesToAdvance int
timeBetweenAnimFrames float
timeSinceLastFrame float

Méthodes publiques

Méthode Description
AddSpriteResizedDelegate ( SpriteResizedDelegate del ) : void

Adds the delegate to be called when the sprite is resized.

Clear ( ) : void

Resets important sprite values to defaults for reuse.

Copy ( SpriteRoot, s ) : void
Delete ( ) : void
Hide ( bool tf ) : void
IsAnimating ( ) : bool

Returns whether the sprite is currently animating.

PauseAnim ( ) : void

Pauses the currently-playing animation.

PlayAnim ( int index ) : void
PlayAnim ( string name ) : void
PlayAnimInReverse ( int index ) : void
PlayAnimInReverse ( string name ) : void
RemoveSpriteresizedDelegate ( SpriteResizedDelegate del ) : void

Removes the specified delegate from the list of those to be called when the sprite is resized.

RevertToStatic ( ) : void

Reverts the sprite to its static (non-animating) default appearance.

SetAnimCompleteDelegate ( AnimCompleteDelegate del ) : void

Sets the delegate to be called upon animation completion.

SetAnimFrameDelegate ( AnimFrameDelegate del ) : void

Sets the delegate to be called each frame of animation.

SetFramerate ( float fps ) : void

Changes the framerate at which the current animation plays. NOTE: This only has effect if called AFTER PlayAnim() is called. Otherwise, PlayAnim() sets the framerate to whatever is specified in the animation itself.

SetSpriteResizedDelegate ( SpriteResizedDelegate del ) : void

Sets the delegate to be called when the sprite is resized.

StepAnim ( float time ) : bool
StopAnim ( ) : void

Stops the current animation from playing and resets it to the beginning for playing again. The sprite then reverts to the static image.

Méthodes protégées

Méthode Description
AddToAnimatedList ( ) : void
Awake ( ) : void
OnDisable ( ) : void
OnEnable ( ) : void
RemoveFromAnimatedList ( ) : void

Method Details

AddSpriteResizedDelegate() public méthode

Adds the delegate to be called when the sprite is resized.
public AddSpriteResizedDelegate ( SpriteResizedDelegate del ) : void
del SpriteResizedDelegate A delegate to be called when the sprite is resized.
Résultat void

AddToAnimatedList() protected méthode

protected AddToAnimatedList ( ) : void
Résultat void

Awake() protected méthode

protected Awake ( ) : void
Résultat void

Clear() public méthode

Resets important sprite values to defaults for reuse.
public Clear ( ) : void
Résultat void

Copy() public méthode

public Copy ( SpriteRoot, s ) : void
s SpriteRoot,
Résultat void

Delete() public méthode

public Delete ( ) : void
Résultat void

Hide() public méthode

public Hide ( bool tf ) : void
tf bool
Résultat void

IsAnimating() public méthode

Returns whether the sprite is currently animating.
public IsAnimating ( ) : bool
Résultat bool

OnDisable() protected méthode

protected OnDisable ( ) : void
Résultat void

OnEnable() protected méthode

protected OnEnable ( ) : void
Résultat void

PauseAnim() public méthode

Pauses the currently-playing animation.
public PauseAnim ( ) : void
Résultat void

PlayAnim() public méthode

public PlayAnim ( int index ) : void
index int
Résultat void

PlayAnim() public méthode

public PlayAnim ( string name ) : void
name string
Résultat void

PlayAnimInReverse() public méthode

public PlayAnimInReverse ( int index ) : void
index int
Résultat void

PlayAnimInReverse() public méthode

public PlayAnimInReverse ( string name ) : void
name string
Résultat void

RemoveFromAnimatedList() protected méthode

protected RemoveFromAnimatedList ( ) : void
Résultat void

RemoveSpriteresizedDelegate() public méthode

Removes the specified delegate from the list of those to be called when the sprite is resized.
public RemoveSpriteresizedDelegate ( SpriteResizedDelegate del ) : void
del SpriteResizedDelegate The delegate to be removed.
Résultat void

RevertToStatic() public méthode

Reverts the sprite to its static (non-animating) default appearance.
public RevertToStatic ( ) : void
Résultat void

SetAnimCompleteDelegate() public méthode

Sets the delegate to be called upon animation completion.
public SetAnimCompleteDelegate ( AnimCompleteDelegate del ) : void
del AnimCompleteDelegate The delegate to be called when an animation finishes playing.
Résultat void

SetAnimFrameDelegate() public méthode

Sets the delegate to be called each frame of animation.
public SetAnimFrameDelegate ( AnimFrameDelegate del ) : void
del AnimFrameDelegate The delegate to be called each frame of animation.
Résultat void

SetFramerate() public méthode

Changes the framerate at which the current animation plays. NOTE: This only has effect if called AFTER PlayAnim() is called. Otherwise, PlayAnim() sets the framerate to whatever is specified in the animation itself.
public SetFramerate ( float fps ) : void
fps float The new framerate, in frames per second.
Résultat void

SetSpriteResizedDelegate() public méthode

Sets the delegate to be called when the sprite is resized.
public SetSpriteResizedDelegate ( SpriteResizedDelegate del ) : void
del SpriteResizedDelegate The delegate to be called when the sprite is resized.
Résultat void

StepAnim() public méthode

public StepAnim ( float time ) : bool
time float
Résultat bool

StopAnim() public méthode

Stops the current animation from playing and resets it to the beginning for playing again. The sprite then reverts to the static image.
public StopAnim ( ) : void
Résultat void

Property Details

animCompleteDelegate protected_oe property

protected AnimCompleteDelegate animCompleteDelegate
Résultat AnimCompleteDelegate

animFrameDelegate protected_oe property

protected AnimFrameDelegate animFrameDelegate
Résultat AnimFrameDelegate

animating protected_oe property

protected bool animating
Résultat bool

curAnimIndex protected_oe property

protected int curAnimIndex
Résultat int

defaultAnim public_oe property

Index of the animation to play by default.
public int defaultAnim
Résultat int

framesToAdvance protected_oe property

protected int framesToAdvance
Résultat int

playAnimOnStart public_oe property

When set to true, the sprite will play the default animation (see defaultAnim) when the sprite is instantiated.
public bool playAnimOnStart
Résultat bool

timeBetweenAnimFrames protected_oe property

protected float timeBetweenAnimFrames
Résultat float

timeSinceLastFrame protected_oe property

protected float timeSinceLastFrame
Résultat float