C# Класс UVAnimation_Multi, urban-survivors

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
clips UVAnimation_Auto[],
framerate float
loopCycles int
loopReverse bool
name string
onAnimEnd UVAnimation.ANIM_END_ACTION

Защищенные свойства (Protected)

Свойство Тип Описание
curClip int
duration float
framePos int
i int
numLoops int
ret bool
stepDir int

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
CalcDuration ( ) : void

Описание методов

AppendAnim() публичный Метод

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.
Результат void

AppendClip() публичный Метод

Appends UV animation clip to the end of the animation sequence.
public AppendClip ( UVAnimation, clip ) : void
clip UVAnimation, Animation clip to append.
Результат void

BuildUVAnim() публичный Метод

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.
Результат UVAnimation_Auto[],

CalcDuration() защищенный Метод

protected CalcDuration ( ) : void
Результат void

Clone() публичный Метод

public Clone ( ) : UVAnimation_Multi,
Результат UVAnimation_Multi,

GetCurPosition() публичный Метод

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
Результат int

GetCurrentClip() публичный Метод

Gets a reference to the currently-playing clip.
public GetCurrentClip ( ) : UVAnimation_Auto,
Результат UVAnimation_Auto,

GetCurrentFrame() публичный Метод

Returns the SPRITE_FRAME of the current frame without advancing to the next frame.
public GetCurrentFrame ( ) : SPRITE_FRAME
Результат SPRITE_FRAME

GetDuration() публичный Метод

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
Результат float

GetFrameCount() публичный Метод

Returns the total number of frames displayed by this animation.
public GetFrameCount ( ) : int
Результат int

GetNextFrame() публичный Метод

public GetNextFrame ( SPRITE_FRAME &nextFrame ) : bool
nextFrame SPRITE_FRAME
Результат bool

PlayInReverse() публичный Метод

public PlayInReverse ( ) : void
Результат void

Reset() публичный Метод

Resets the animation sequence for playing anew.
public Reset ( ) : void
Результат void

SetAnim() публичный Метод

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.
Результат void

SetAnimPosition() публичный Метод

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).
Результат void

SetPosition() публичный Метод

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).
Результат void

UVAnimation_Multi() публичный Метод

public UVAnimation_Multi ( ) : UnityEngine
Результат UnityEngine

UVAnimation_Multi() публичный Метод

public UVAnimation_Multi ( UVAnimation_Multi, anim ) : UnityEngine
anim UVAnimation_Multi,
Результат UnityEngine

Описание свойств

clips публичное свойство

The actual sprite animation clips that make up the animation sequence.
public UVAnimation_Auto[], clips
Результат UVAnimation_Auto[],

curClip защищенное свойство

protected int curClip
Результат int

duration защищенное свойство

protected float duration
Результат float

framePos защищенное свойство

protected int framePos
Результат int

framerate публичное свойство

The rate in frames per second at which to play the animation.
public float framerate
Результат float

i защищенное свойство

protected int i
Результат int

loopCycles публичное свойство

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
Результат int

loopReverse публичное свойство

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
Результат bool

name публичное свойство

The name of the animation sequence
public string name
Результат string

numLoops защищенное свойство

protected int numLoops
Результат int

onAnimEnd публичное свойство

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
Результат UVAnimation.ANIM_END_ACTION

ret защищенное свойство

protected bool ret
Результат bool

stepDir защищенное свойство

protected int stepDir
Результат int