C# Class tk2dAnimatedSprite, Malisse

Inheritance: tk2dSprite
Afficher le fichier Open project: Collegiennes/Malisse Class Usage Examples

Méthodes publiques

Свойство Type Description
anim tk2dSpriteAnimation,
animationCompleteDelegate AnimationCompleteDelegate
animationEventDelegate AnimationEventDelegate,
clipId int
createCollider bool
playAutomatically bool

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
NeedBoxCollider ( ) : bool

Private Methods

Méthode Description
Start ( ) : void
isPlaying ( ) : bool

Method Details

AddComponent() public static méthode

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
Résultat tk2dAnimatedSprite,

GetClipIdByName() public méthode

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 .
Résultat int

LateUpdate() public méthode

public LateUpdate ( ) : void
Résultat void

NeedBoxCollider() protected méthode

protected NeedBoxCollider ( ) : bool
Résultat bool

OnCompleteAnimation() public méthode

public OnCompleteAnimation ( ) : void
Résultat void

Pause() public méthode

Pause the currently playing clip. Will do nothing if the clip is currently paused.
public Pause ( ) : void
Résultat void

Play() public méthode

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
Résultat void

Play() public méthode

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
Résultat void

Play() public méthode

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 ///
Résultat void

Play() public méthode

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.
Résultat void

Play() public méthode

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. ///
Résultat void

Play() public méthode

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.
Résultat void

Play() public méthode

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
Résultat void

Play() public méthode

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
Résultat void

PlayFromFrame() public méthode

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
Résultat void

PlayFromFrame() public méthode

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.
Résultat void

PlayFromFrame() public méthode

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.
Résultat void

ProcessEvents() public méthode

public ProcessEvents ( int start, int last, int direction ) : void
start int
last int
direction int
Résultat void

Resume() public méthode

Resume the currently paused clip. Will do nothing if the clip hasn't been paused.
public Resume ( ) : void
Résultat void

SetFrame() public méthode

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
Résultat void

SetFrame() public méthode

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
Résultat void

SetFrameInternal() public méthode

public SetFrameInternal ( int currFrame ) : void
currFrame int
Résultat void

Stop() public méthode

Stop the currently playing clip.
public Stop ( ) : void
Résultat void

StopAndResetFrame() public méthode

Stops the currently playing animation and reset to the first frame in the animation
public StopAndResetFrame ( ) : void
Résultat void

WarpClipToLocalTime() public méthode

public WarpClipToLocalTime ( tk2dSpriteAnimationClip, clip, float time ) : void
clip tk2dSpriteAnimationClip,
time float
Résultat void

Property Details

anim public_oe property

tk2dSpriteAnimation
public tk2dSpriteAnimation, anim
Résultat tk2dSpriteAnimation,

animationCompleteDelegate public_oe property

Animation complete event. This is called when the animation has completed playing. Will not trigger on looped animations
public AnimationCompleteDelegate animationCompleteDelegate
Résultat AnimationCompleteDelegate

animationEventDelegate public_oe property

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
Résultat AnimationEventDelegate,

clipId public_oe property

Currently playing/active clip
public int clipId
Résultat int

createCollider public_oe property

Interface option to create an animated box collider for this animated sprite
public bool createCollider
Résultat bool

playAutomatically public_oe property

Interface option to play the animation automatically when instantiated / game is started. Useful for background looping animations.
public bool playAutomatically
Résultat bool