C# Класс tk2dAnimatedSprite, Malisse

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

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

Свойство Тип Описание
anim tk2dSpriteAnimation,
animationCompleteDelegate AnimationCompleteDelegate
animationEventDelegate AnimationEventDelegate,
clipId int
createCollider bool
playAutomatically bool

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

Метод Описание
AddComponent ( GameObject go, tk2dSpriteAnimation, anim, int clipId ) : tk2dAnimatedSprite,

Adds a tk2dAnimatedSprite as a component to the gameObject passed in, setting up necessary parameters and building geometry.

GetClipIdByName ( string name ) : int

Resolves an animation clip by name and returns a unique id. This is a convenient alias to tk2dSpriteAnimation.GetClipIdByName

LateUpdate ( ) : void
OnCompleteAnimation ( ) : void
Pause ( ) : void

Pause the currently playing clip. Will do nothing if the clip is currently paused.

Play ( ) : void

Play the active clip. Will restart the clip if called again. Will restart the clip at clipStartTime if called while the clip is playing.

Play ( float clipStartTime ) : void

Play the active clip, starting "clipStartTime" seconds into the clip. Will restart the clip at clipStartTime if called while the clip is playing.

Play ( int id ) : void

Play the clip specified by identifier. Will restart the clip at clipStartTime if called while the clip is playing.

Play ( int clipId, float clipStartTime ) : void

Play the clip specified by identifier. Will restart the clip at clipStartTime if called while the clip is playing.

Play ( string name ) : void

Play the specified clip. Will restart the clip at clipStartTime if called while the clip is playing.

Play ( string name, float clipStartTime ) : void

Play the specified clip, starting "clipStartTime" seconds into the clip. Will restart the clip at clipStartTime if called while the clip is playing.

Play ( tk2dSpriteAnimationClip, clip, float clipStartTime ) : void

Play the clip specified by identifier. Will restart the clip at clipStartTime if called while the clip is playing.

Play ( tk2dSpriteAnimationClip, clip, float clipStartTime, float overrideFps ) : void

Play the clip specified by identifier. Will restart the clip at clipStartTime if called while the clip is playing. No defaults to play nice with default MonoDevelop configuration.

PlayFromFrame ( int frame ) : void

Play the active clip, starting at the frame specified. Will restart the clip at frame if called while the clip is playing.

PlayFromFrame ( int id, int frame ) : void

Play the clip specified by identifier, starting at the specified frame. Will restart the clip at clipStartTime if called while the clip is playing.

PlayFromFrame ( string name, int frame ) : void

Play the specified clip, starting at the frame specified. Will restart the clip at frame if called while the clip is playing.

ProcessEvents ( int start, int last, int direction ) : void
Resume ( ) : void

Resume the currently paused clip. Will do nothing if the clip hasn't been paused.

SetFrame ( int currFrame ) : void

Sets the current frame. The animation will wrap if the selected frame exceeds the number of frames in the clip. This variant WILL trigger an event if the current frame has a trigger defined.

SetFrame ( int currFrame, bool triggerEvent ) : void

Sets the current frame. The animation will wrap if the selected frame exceeds the number of frames in the clip.

SetFrameInternal ( int currFrame ) : void
Stop ( ) : void

Stop the currently playing clip.

StopAndResetFrame ( ) : void

Stops the currently playing animation and reset to the first frame in the animation

WarpClipToLocalTime ( tk2dSpriteAnimationClip, clip, float time ) : void

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

Метод Описание
NeedBoxCollider ( ) : bool

Приватные методы

Метод Описание
Start ( ) : void
isPlaying ( ) : bool

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

AddComponent() публичный статический Метод

Adds a tk2dAnimatedSprite as a component to the gameObject passed in, setting up necessary parameters and building geometry.
public static AddComponent ( GameObject go, tk2dSpriteAnimation, anim, int clipId ) : tk2dAnimatedSprite,
go GameObject
anim tk2dSpriteAnimation,
clipId int
Результат tk2dAnimatedSprite,

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

Resolves an animation clip by name and returns a unique id. This is a convenient alias to tk2dSpriteAnimation.GetClipIdByName
public GetClipIdByName ( string name ) : int
name string Case sensitive clip name, as defined in .
Результат int

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

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

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

protected NeedBoxCollider ( ) : bool
Результат bool

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

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

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

Pause the currently playing clip. Will do nothing if the clip is currently paused.
public Pause ( ) : void
Результат void

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

Play the active clip. Will restart the clip if called again. Will restart the clip at clipStartTime if called while the clip is playing.
public Play ( ) : void
Результат void

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

Play the active clip, starting "clipStartTime" seconds into the clip. Will restart the clip at clipStartTime if called while the clip is playing.
public Play ( float clipStartTime ) : void
clipStartTime float
Результат void

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

Play the clip specified by identifier. Will restart the clip at clipStartTime if called while the clip is playing.
public Play ( int id ) : void
id int /// Use to resolve a named clip id ///
Результат void

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

Play the clip specified by identifier. Will restart the clip at clipStartTime if called while the clip is playing.
public Play ( int clipId, float clipStartTime ) : void
clipId int
clipStartTime float Clip start time in seconds.
Результат void

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

Play the specified clip. Will restart the clip at clipStartTime if called while the clip is playing.
public Play ( string name ) : void
name string /// Name of clip. Try to cache the animation clip Id and use that instead for performance. ///
Результат void

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

Play the specified clip, starting "clipStartTime" seconds into the clip. Will restart the clip at clipStartTime if called while the clip is playing.
public Play ( string name, float clipStartTime ) : void
name string Name of clip. Try to cache the animation clip Id and use that instead for performance.
clipStartTime float Clip start time in seconds.
Результат void

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

Play the clip specified by identifier. Will restart the clip at clipStartTime if called while the clip is playing.
public Play ( tk2dSpriteAnimationClip, clip, float clipStartTime ) : void
clip tk2dSpriteAnimationClip, The clip to play.
clipStartTime float Clip start time in seconds. A value of DefaultFps will start the clip from the beginning
Результат void

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

Play the clip specified by identifier. Will restart the clip at clipStartTime if called while the clip is playing. No defaults to play nice with default MonoDevelop configuration.
public Play ( tk2dSpriteAnimationClip, clip, float clipStartTime, float overrideFps ) : void
clip tk2dSpriteAnimationClip, The clip to play.
clipStartTime float Clip start time in seconds. A value of DefaultFps will start the clip from the beginning
overrideFps float Overriden framerate of clip. Set to 0 to use default
Результат void

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

Play the active clip, starting at the frame specified. Will restart the clip at frame if called while the clip is playing.
public PlayFromFrame ( int frame ) : void
frame int
Результат void

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

Play the clip specified by identifier, starting at the specified frame. Will restart the clip at clipStartTime if called while the clip is playing.
public PlayFromFrame ( int id, int frame ) : void
id int Use to resolve a named clip id
frame int Frame to start from.
Результат void

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

Play the specified clip, starting at the frame specified. Will restart the clip at frame if called while the clip is playing.
public PlayFromFrame ( string name, int frame ) : void
name string Name of clip. Try to cache the animation clip Id and use that instead for performance.
frame int Frame to start playing from.
Результат void

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

public ProcessEvents ( int start, int last, int direction ) : void
start int
last int
direction int
Результат void

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

Resume the currently paused clip. Will do nothing if the clip hasn't been paused.
public Resume ( ) : void
Результат void

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

Sets the current frame. The animation will wrap if the selected frame exceeds the number of frames in the clip. This variant WILL trigger an event if the current frame has a trigger defined.
public SetFrame ( int currFrame ) : void
currFrame int
Результат void

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

Sets the current frame. The animation will wrap if the selected frame exceeds the number of frames in the clip.
public SetFrame ( int currFrame, bool triggerEvent ) : void
currFrame int
triggerEvent bool
Результат void

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

public SetFrameInternal ( int currFrame ) : void
currFrame int
Результат void

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

Stop the currently playing clip.
public Stop ( ) : void
Результат void

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

Stops the currently playing animation and reset to the first frame in the animation
public StopAndResetFrame ( ) : void
Результат void

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

public WarpClipToLocalTime ( tk2dSpriteAnimationClip, clip, float time ) : void
clip tk2dSpriteAnimationClip,
time float
Результат void

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

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

tk2dSpriteAnimation
public tk2dSpriteAnimation, anim
Результат tk2dSpriteAnimation,

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

Animation complete event. This is called when the animation has completed playing. Will not trigger on looped animations
public AnimationCompleteDelegate animationCompleteDelegate
Результат AnimationCompleteDelegate

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

Animation event. This is called when the frame displayed has tk2dSpriteAnimationFrame.triggerEvent set. The triggering frame is passed to the delegate, and the eventInfo / Int / Float can be extracted from there.
public AnimationEventDelegate, animationEventDelegate
Результат AnimationEventDelegate,

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

Currently playing/active clip
public int clipId
Результат int

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

Interface option to create an animated box collider for this animated sprite
public bool createCollider
Результат bool

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

Interface option to play the animation automatically when instantiated / game is started. Useful for background looping animations.
public bool playAutomatically
Результат bool