C# Class UVAnimation_Multi, urban-survivors

Mostra file Open project: exdev/urban-survivors Class Usage Examples

Public Properties

Property Type Description
clips UVAnimation_Auto[],
framerate float
loopCycles int
loopReverse bool
name string
onAnimEnd UVAnimation.ANIM_END_ACTION

Protected Properties

Property Type Description
curClip int
duration float
framePos int
i int
numLoops int
ret bool
stepDir int

Public Methods

Method Description
AppendAnim ( int index, SPRITE_FRAME anim ) : void

Appends UV animation to the clip specified by index.

AppendClip ( UVAnimation, clip ) : void

Appends UV animation clip to the end of the animation sequence.

BuildUVAnim ( SpriteRoot, s ) : UVAnimation_Auto[],

Builds the UV animations for all animation clips that are a part of this animation sequence.

Clone ( ) : UVAnimation_Multi,
GetCurPosition ( ) : int

Returns the (zero-based) frame number of the current position in the over all animation. Example: If the multi contains a total of 100 frames and 25 frames have played so far, then 24 will be returned (because it is zero-based). If the multi is playing backwards, this number will count down from 100 as well.

GetCurrentClip ( ) : UVAnimation_Auto,

Gets a reference to the currently-playing clip.

GetCurrentFrame ( ) : SPRITE_FRAME

Returns the SPRITE_FRAME of the current frame without advancing to the next frame.

GetDuration ( ) : float

Returns the duration, in seconds, of the animation. NOTE: This takes into account loop cycles and loop reverse. Ex: If an animation has a framerate of 30fps, consists of 60 frames, and is set to loop once, the duration will be 4 seconds.

GetFrameCount ( ) : int

Returns the total number of frames displayed by this animation.

GetNextFrame ( SPRITE_FRAME &nextFrame ) : bool
PlayInReverse ( ) : void
Reset ( ) : void

Resets the animation sequence for playing anew.

SetAnim ( int index, SPRITE_FRAME frames ) : void

Replaces the contents of the specified clip.

SetAnimPosition ( float pos ) : void

Sets the current playing position of the animation. NOTE: This method does NOT take loop cycles and loop reversing into account. To set the position taking loop cycles and loop reversing into account, use SetPosition().

SetPosition ( float pos ) : void

Sets the current playing position of the animation. NOTE: This method takes loop cycles and loop reversing into account. To set the position without regard to loop cycles or loop reversing, use SetAnimPosition().

UVAnimation_Multi ( ) : UnityEngine
UVAnimation_Multi ( UVAnimation_Multi, anim ) : UnityEngine

Protected Methods

Method Description
CalcDuration ( ) : void

Method Details

AppendAnim() public method

Appends UV animation to the clip specified by index.
public AppendAnim ( int index, SPRITE_FRAME anim ) : void
index int The animation clip to append to.
anim SPRITE_FRAME Array of ANIM_FRAMEs that define the animation to be appended.
return void

AppendClip() public method

Appends UV animation clip to the end of the animation sequence.
public AppendClip ( UVAnimation, clip ) : void
clip UVAnimation, Animation clip to append.
return void

BuildUVAnim() public method

Builds the UV animations for all animation clips that are a part of this animation sequence.
public BuildUVAnim ( SpriteRoot, s ) : UVAnimation_Auto[],
s SpriteRoot, The sprite for which to build the animation.
return UVAnimation_Auto[],

CalcDuration() protected method

protected CalcDuration ( ) : void
return void

Clone() public method

public Clone ( ) : UVAnimation_Multi,
return UVAnimation_Multi,

GetCurPosition() public method

Returns the (zero-based) frame number of the current position in the over all animation. Example: If the multi contains a total of 100 frames and 25 frames have played so far, then 24 will be returned (because it is zero-based). If the multi is playing backwards, this number will count down from 100 as well.
public GetCurPosition ( ) : int
return int

GetCurrentClip() public method

Gets a reference to the currently-playing clip.
public GetCurrentClip ( ) : UVAnimation_Auto,
return UVAnimation_Auto,

GetCurrentFrame() public method

Returns the SPRITE_FRAME of the current frame without advancing to the next frame.
public GetCurrentFrame ( ) : SPRITE_FRAME
return SPRITE_FRAME

GetDuration() public method

Returns the duration, in seconds, of the animation. NOTE: This takes into account loop cycles and loop reverse. Ex: If an animation has a framerate of 30fps, consists of 60 frames, and is set to loop once, the duration will be 4 seconds.
public GetDuration ( ) : float
return float

GetFrameCount() public method

Returns the total number of frames displayed by this animation.
public GetFrameCount ( ) : int
return int

GetNextFrame() public method

public GetNextFrame ( SPRITE_FRAME &nextFrame ) : bool
nextFrame SPRITE_FRAME
return bool

PlayInReverse() public method

public PlayInReverse ( ) : void
return void

Reset() public method

Resets the animation sequence for playing anew.
public Reset ( ) : void
return void

SetAnim() public method

Replaces the contents of the specified clip.
public SetAnim ( int index, SPRITE_FRAME frames ) : void
index int Index of the clip the contents of which you wish to replace.
frames SPRITE_FRAME Array of ANIM_FRAMEs that define the content of an animation clip.
return void

SetAnimPosition() public method

Sets the current playing position of the animation. NOTE: This method does NOT take loop cycles and loop reversing into account. To set the position taking loop cycles and loop reversing into account, use SetPosition().
public SetAnimPosition ( float pos ) : void
pos float Desired position in the animation (0-1).
return void

SetPosition() public method

Sets the current playing position of the animation. NOTE: This method takes loop cycles and loop reversing into account. To set the position without regard to loop cycles or loop reversing, use SetAnimPosition().
public SetPosition ( float pos ) : void
pos float Desired position in the animation (0-1).
return void

UVAnimation_Multi() public method

public UVAnimation_Multi ( ) : UnityEngine
return UnityEngine

UVAnimation_Multi() public method

public UVAnimation_Multi ( UVAnimation_Multi, anim ) : UnityEngine
anim UVAnimation_Multi,
return UnityEngine

Property Details

clips public_oe property

The actual sprite animation clips that make up the animation sequence.
public UVAnimation_Auto[], clips
return UVAnimation_Auto[],

curClip protected_oe property

protected int curClip
return int

duration protected_oe property

protected float duration
return float

framePos protected_oe property

protected int framePos
return int

framerate public_oe property

The rate in frames per second at which to play the animation.
public float framerate
return float

i protected_oe property

protected int i
return int

loopCycles public_oe property

How many times to loop the animation IN ADDITION TO the initial play-through. (-1 to loop infinitely, 0 not to loop at all, 1 to repeat once before stopping, etc.)
public int loopCycles
return int

loopReverse public_oe property

Reverse the play direction when the end of the animation is reached? If true, a loop iteration isn't counted until the animation returns to the beginning.
public bool loopReverse
return bool

name public_oe property

The name of the animation sequence
public string name
return string

numLoops protected_oe property

protected int numLoops
return int

onAnimEnd public_oe property

What the sprite should do when the animation is done playing. The options are to: 1) Do nothing, 2) return to the static image, 3) play the default animation.
public UVAnimation.ANIM_END_ACTION onAnimEnd
return UVAnimation.ANIM_END_ACTION

ret protected_oe property

protected bool ret
return bool

stepDir protected_oe property

protected int stepDir
return int