Sequine - Scripting API
Calcatz.Sequine.SequinePlayer Class Reference

Sequine Player is a component that can play Animation Clip on demand without relying on Animator Controller. More...

Inheritance diagram for Calcatz.Sequine.SequinePlayer:

Classes

class  LayerRegistry
 

Public Member Functions

bool TryGetCurrentClip (out AnimationClip _clip)
 Try get the clip of the current state in base layer if not null. More...
 
void RemoveState (AnimationClip _clip)
 Remove a state in base layer. More...
 
SequineState PlayAnimationClip (AnimationClip _clip, AnimationConfig _config, bool _restart=false, Action _onComplete=null)
 
SequineState PlayAnimationClip (AnimationClip _clip, AnimationConfig _config, Action _onComplete)
 
SequineState PlayAnimationClip (int _layer, AnimationClip _clip, AnimationConfig _config, bool _restart=false, Action _onComplete=null)
 
SequineState PlayRangedAnimationClip (int _layer, AnimationClip _clip, AnimationConfig _config, float minTimePercentage, float _maxTimePercentage, bool _restart=false, Action _onComplete=null)
 Plays an animation clip, and only play within the percentaged range. More...
 
void Stop ()
 Stop all layers. More...
 
void Pause ()
 
void Resume ()
 
void ExitCurrentState (int _layer)
 
SequineState PlayAction (int _id, AnimationConfig _config, bool _restart=false, Action _onComplete=null)
 
SequineState PlayAction (int _id, AnimationConfig _config, Action _onComplete)
 
SequineState PlayAction (int _layer, int _id, AnimationConfig _config, bool _restart=false, Action _onComplete=null)
 
SequineState PlayActionWithTranslation (int _id, Vector3 _translation, AnimationConfig _config, bool _restart=false, Action _onComplete=null, EasingFunction.Ease _easing=EasingFunction.Ease.Linear)
 
SequineState PlayActionWithTranslation (int _layer, int _id, Vector3 _translation, AnimationConfig _config, bool _restart=false, Action _onComplete=null, EasingFunction.Ease _easing=EasingFunction.Ease.Linear)
 
bool TryGetState (AnimationClip _clip, out SequineState _state)
 Try get state in base layer. More...
 
bool TryGetActionClip (int _actionId, out AnimationClip _clip)
 
void Tick (float _deltaTime)
 
void PauseAnimationClipAtTime (AnimationClip _clip, float _time, bool _useNormalizedTime)
 Pauses an animation (if the clip is currently playing) by specifying the animation clip asset, and sample a certain pose at the specified time. This will also automatically plays the animation clip if it's not yet played. Since AnimationConfig parameter is not specified, the default animation config will be used as the configuration to play when it's not yet played. More...
 
void PauseAnimationClipAtTime (AnimationClip _clip, float _time, bool _useNormalizedTime, AnimationConfig _config)
 Pauses an animation (if the clip is currently playing) by specifying the animation clip asset, and sample a certain pose at the specified time. This will also automatically plays the animation clip if it's not yet played. More...
 

Static Public Member Functions

static SequinePlayer GetInstance (SequineAnimationData _binder)
 
static bool TryGetInstance (SequineAnimationData _binder, out SequinePlayer _sequinePlayer)
 

Protected Member Functions

virtual void OnValidate ()
 
virtual void Awake ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 
virtual void OnDestroy ()
 
virtual void OnActionTranslation (Vector3 _updatedPosition)
 

Properties

static AnimationConfig defaultAnimationConfig [get]
 
SequineAnimationData animationData [get]
 
SequineState currentState [get]
 
IEnumerable< SequineStatestates [get]
 
List< SequineLayerlayers [get]
 Get runtime layers. This will be empty when accessed during edit mode. Use layerCount and layerNames in edit mode instead. More...
 
int layerCount [get]
 
string[] layerNames [get]
 
UpdateMode updateMode [getset]
 
float weight [getset]
 
Animator animator [get]
 
RuntimeAnimatorController animatorController [getset]
 

Detailed Description

Sequine Player is a component that can play Animation Clip on demand without relying on Animator Controller.

Member Function Documentation

◆ Awake()

virtual void Calcatz.Sequine.SequinePlayer.Awake ( )
protectedvirtual

◆ ExitCurrentState()

void Calcatz.Sequine.SequinePlayer.ExitCurrentState ( int  _layer)

◆ GetInstance()

static SequinePlayer Calcatz.Sequine.SequinePlayer.GetInstance ( SequineAnimationData  _binder)
static

◆ OnActionTranslation()

virtual void Calcatz.Sequine.SequinePlayer.OnActionTranslation ( Vector3  _updatedPosition)
protectedvirtual

◆ OnDestroy()

virtual void Calcatz.Sequine.SequinePlayer.OnDestroy ( )
protectedvirtual

◆ OnDisable()

virtual void Calcatz.Sequine.SequinePlayer.OnDisable ( )
protectedvirtual

◆ OnEnable()

virtual void Calcatz.Sequine.SequinePlayer.OnEnable ( )
protectedvirtual

◆ OnValidate()

virtual void Calcatz.Sequine.SequinePlayer.OnValidate ( )
protectedvirtual

◆ Pause()

void Calcatz.Sequine.SequinePlayer.Pause ( )

◆ PauseAnimationClipAtTime() [1/2]

void Calcatz.Sequine.SequinePlayer.PauseAnimationClipAtTime ( AnimationClip  _clip,
float  _time,
bool  _useNormalizedTime 
)

Pauses an animation (if the clip is currently playing) by specifying the animation clip asset, and sample a certain pose at the specified time. This will also automatically plays the animation clip if it's not yet played. Since AnimationConfig parameter is not specified, the default animation config will be used as the configuration to play when it's not yet played.

Parameters
_clip
_time
_useNormalizedTime

◆ PauseAnimationClipAtTime() [2/2]

void Calcatz.Sequine.SequinePlayer.PauseAnimationClipAtTime ( AnimationClip  _clip,
float  _time,
bool  _useNormalizedTime,
AnimationConfig  _config 
)

Pauses an animation (if the clip is currently playing) by specifying the animation clip asset, and sample a certain pose at the specified time. This will also automatically plays the animation clip if it's not yet played.

Parameters
_clip
_time
_useNormalizedTime
_config

◆ PlayAction() [1/3]

SequineState Calcatz.Sequine.SequinePlayer.PlayAction ( int  _id,
AnimationConfig  _config,
Action  _onComplete 
)

◆ PlayAction() [2/3]

SequineState Calcatz.Sequine.SequinePlayer.PlayAction ( int  _id,
AnimationConfig  _config,
bool  _restart = false,
Action  _onComplete = null 
)

◆ PlayAction() [3/3]

SequineState Calcatz.Sequine.SequinePlayer.PlayAction ( int  _layer,
int  _id,
AnimationConfig  _config,
bool  _restart = false,
Action  _onComplete = null 
)

◆ PlayActionWithTranslation() [1/2]

SequineState Calcatz.Sequine.SequinePlayer.PlayActionWithTranslation ( int  _id,
Vector3  _translation,
AnimationConfig  _config,
bool  _restart = false,
Action  _onComplete = null,
EasingFunction.Ease  _easing = EasingFunction.Ease.Linear 
)

◆ PlayActionWithTranslation() [2/2]

SequineState Calcatz.Sequine.SequinePlayer.PlayActionWithTranslation ( int  _layer,
int  _id,
Vector3  _translation,
AnimationConfig  _config,
bool  _restart = false,
Action  _onComplete = null,
EasingFunction.Ease  _easing = EasingFunction.Ease.Linear 
)

◆ PlayAnimationClip() [1/3]

SequineState Calcatz.Sequine.SequinePlayer.PlayAnimationClip ( AnimationClip  _clip,
AnimationConfig  _config,
Action  _onComplete 
)

◆ PlayAnimationClip() [2/3]

SequineState Calcatz.Sequine.SequinePlayer.PlayAnimationClip ( AnimationClip  _clip,
AnimationConfig  _config,
bool  _restart = false,
Action  _onComplete = null 
)

◆ PlayAnimationClip() [3/3]

SequineState Calcatz.Sequine.SequinePlayer.PlayAnimationClip ( int  _layer,
AnimationClip  _clip,
AnimationConfig  _config,
bool  _restart = false,
Action  _onComplete = null 
)

◆ PlayRangedAnimationClip()

SequineState Calcatz.Sequine.SequinePlayer.PlayRangedAnimationClip ( int  _layer,
AnimationClip  _clip,
AnimationConfig  _config,
float  minTimePercentage,
float  _maxTimePercentage,
bool  _restart = false,
Action  _onComplete = null 
)

Plays an animation clip, and only play within the percentaged range.

Note that you can't get this state using TryGetState method as they're not bound to clip. One clip might have multiple SequineRangedStates to enable blending between the same clip at different time.

Parameters
_layer
_clip
_config
minTimePercentage
_maxTimePercentage
_restart
_onComplete
Returns
Returns a SequineRangedState.

◆ RemoveState()

void Calcatz.Sequine.SequinePlayer.RemoveState ( AnimationClip  _clip)

Remove a state in base layer.

Parameters
_clip

◆ Resume()

void Calcatz.Sequine.SequinePlayer.Resume ( )

◆ Stop()

void Calcatz.Sequine.SequinePlayer.Stop ( )

Stop all layers.

◆ Tick()

void Calcatz.Sequine.SequinePlayer.Tick ( float  _deltaTime)

◆ TryGetActionClip()

bool Calcatz.Sequine.SequinePlayer.TryGetActionClip ( int  _actionId,
out AnimationClip  _clip 
)

◆ TryGetCurrentClip()

bool Calcatz.Sequine.SequinePlayer.TryGetCurrentClip ( out AnimationClip  _clip)

Try get the clip of the current state in base layer if not null.

Parameters
_clip
Returns

◆ TryGetInstance()

static bool Calcatz.Sequine.SequinePlayer.TryGetInstance ( SequineAnimationData  _binder,
out SequinePlayer  _sequinePlayer 
)
static

◆ TryGetState()

bool Calcatz.Sequine.SequinePlayer.TryGetState ( AnimationClip  _clip,
out SequineState  _state 
)

Try get state in base layer.

Parameters
_clip
_state
Returns

Property Documentation

◆ animationData

SequineAnimationData Calcatz.Sequine.SequinePlayer.animationData
get

◆ animator

Animator Calcatz.Sequine.SequinePlayer.animator
get

◆ animatorController

RuntimeAnimatorController Calcatz.Sequine.SequinePlayer.animatorController
getset

◆ currentState

SequineState Calcatz.Sequine.SequinePlayer.currentState
get

◆ defaultAnimationConfig

AnimationConfig Calcatz.Sequine.SequinePlayer.defaultAnimationConfig
staticget

◆ layerCount

int Calcatz.Sequine.SequinePlayer.layerCount
get

◆ layerNames

string [] Calcatz.Sequine.SequinePlayer.layerNames
get

◆ layers

List<SequineLayer> Calcatz.Sequine.SequinePlayer.layers
get

Get runtime layers. This will be empty when accessed during edit mode. Use layerCount and layerNames in edit mode instead.

◆ states

IEnumerable<SequineState> Calcatz.Sequine.SequinePlayer.states
get

◆ updateMode

UpdateMode Calcatz.Sequine.SequinePlayer.updateMode
getset

◆ weight

float Calcatz.Sequine.SequinePlayer.weight
getset