Class: SkeletalAnimation

extend: Animation

Import example:

import { SkeletalAnimation } from "cc";

Skeletal animation component, offers the following features on top of Animation:

  • Choice between baked animation and real-time calculation, to leverage efficiency and expressiveness.
  • Joint socket system: Create any socket node directly under the animation component root node, find your target joint and register both to the socket list, so that the socket node would be in-sync with the joint.

Index

Constructors

Static Properties

Properties
Whether to bake animations. Default to true,
which substantially increases performance while making all animations completely fixed.
Dynamically changing this property will take effect when playing the next animation clip.Note, in editor(not in preview) mode, this option takes no effect: animation is always non-baked.
The joint sockets this animation component maintains.
Sockets have to be registered here before attaching custom nodes to animated joints.

Methods
Rebuild animations to synchronize immediately all sockets to their target node.
Query all socket paths
Create or get the target node from a socket.If a socket haven't been created for the corresponding path, this function will register a new socket.

Inherited Properties
The uuid for editor.
Indicates whether the object is not yet destroyed. (It will not be available after being destroyed)
When an object's destroy is called, it is actually destroyed after the end of this frame.So isValid will return false from the next frame, while isValid in the current frame will still be true.If you want to determine whether the current frame has called destroy, use isValid(obj, true),but this is often caused by a particular logical requirements, which is not normally required.
After inheriting CCObject objects, control whether you need to hide, lock, serialize, and other functions.
Indicates whether this component is enabled and its node is also active in the hierarchy.
Indicates whether this component is enabled or not.
Gets or sets the default clip.Two clips that both have same non-empty UUID are treat as equivalent.
Gets or sets clips this component governs.When set, associated animation state of each existing clip will be stopped.If the existing default clip is not in the set of new clips, default clip will be reset to null.
Whether the default clip should get into playing when this components starts.Note, this field takes no effect if crossFade() or play() has been called before this component starts.
The node this component is attached to. A component is always attached to a node.
  • _id protected
Returns a value which used to indicate the onLoad get called or not.

Inherited Methods
unschedule all scheduled tasks.
Un-schedules a custom task.
Removes all callbacks previously registered with the same target (passed as parameter).This is not for removing all listeners in the current event target,and this is not for removing all listeners the target parameter have registered.It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter.
Use Scheduler system to schedule a task that runs only once, with a delay of 0 or larger.
Use Scheduler system to schedule a custom task.
If the task is already scheduled, then the interval parameter will be updated without scheduling it again.
Called to initialize the component or node’s properties when adding the component the first time or when the Reset command is used.This function is only called in editor.
Stops and removes specified clip.
Remove clip from the animation list. This will remove the clip and any animation states based on it.
If there are animation states depend on the clip are playing or clip is defaultClip, it will not delete the clip.
But if force is true, then will always remove the clip and any animation states based on it. If clip is defaultClip,defaultClip will be reset to null
Removes all callbacks registered in a certain event type or all callbacks registered with a certain target
Switch to play specified animation state, without fading.
  • on public
Register animation event callback.The event arguments will provide the AnimationState which emit the event.When play an animation, will auto register the event callback to the AnimationState,and unregister the event callback from the AnimationState when animation stopped.
Unregister animation event callback.
Checks whether there is correspond event listener registered on the given event.
Get specified animation state.
Returns all components of supplied type in self or any of its children.
Returns all components of supplied type in the node.
Returns the component of supplied type in any of its children using depth first search.
Returns the component of supplied type if the node has one attached, null if it doesn't.
You can also get component in the node by passing in the name of the script.
Trigger an event directly with the event name and necessary arguments.
Smoothly switch to play specified animation state.
Creates a state for specified clip.If there is already a clip with same name, the existing animation state will be stopped and overridden.
Adds a component class to the node. You can also add component to node by passing in the name of the script.
Adds an animation clip into this component and creates a animation state for this clip.
__preload is called before every onLoad.
It is used to initialize the builtin components internally,
to avoid checking whether onLoad is called before every public method calls.
This method should be removed if script priority is supported.
Clear all references in the instance.NOTE: this method will not clear the getter or setter functions which defined in the instance of CCObject.
If the component's bounding box is different from the node's, you can implement this method to supplya custom axis aligned bounding box (AABB), so the editor's scene view can perform hit test properly.
LateUpdate is called every frame, if the Component is enabled.
This is a lifecycle method. It may not be implemented in the super class.
You can only call its super class method inside it. It should not be called manually elsewhere.
onRestore is called after the user clicks the Reset item in the Inspector's context menu or performsan undo operation on this component.

If the component contains the "internal state", short for "temporary member variables which not included
in its CCClass properties", then you may need to implement this function.

The editor will call the getset accessors of your component to record/restore the component's state
for undo/redo operation. However, in extreme cases, it may not works well. Then you should implement
this function to manually synchronize your component's "internal states" with its public properties.
Once you implement this function, all the getset accessors of your component will not be called when
the user performs an undo/redo operation. Which means that only the properties with default value
will be recorded or restored by editor.

Similarly, the editor may failed to reset your component correctly in extreme cases. Then if you need
to support the reset menu, you should manually synchronize your component's "internal states" with its
properties in this function. Once you implement this function, all the getset accessors of your component
will not be called during reset operation. Which means that only the properties with default value
will be reset by editor.This function is only called in editor mode.
Update is called every frame, if the Component is enabled.
This is a lifecycle method. It may not be implemented in the super class.
You can only call its super class method inside it. It should not be called manually elsewhere.

Details

Constructors

public SkeletalAnimation (...args : any []) :
SkeletalAnimation
Inherited from: Animation.constructor
Input Parameters
NameTypeDescription
argsany []-

Static Properties

public Socket : typeof Socket
default: Socket
static

Properties

public useBakedAnimation : boolean
Whether to bake animations. Default to true,
which substantially increases performance while making all animations completely fixed.
Dynamically changing this property will take effect when playing the next animation clip. Note, in editor(not in preview) mode, this option takes no effect: animation is always non-baked.
public sockets : Socket []
The joint sockets this animation component maintains.
Sockets have to be registered here before attaching custom nodes to animated joints.
protected _currentBakedState : null | SkeletalAnimationState
default: null
protected _sockets : Socket []
default: []
protected _useBakedAnimation : boolean
default: true
protected _useBakedEffectively : boolean

Methods

public rebuildSocketAnimations () :
void
Rebuild animations to synchronize immediately all sockets to their target node.
Returns: void
public querySockets () :
string []
Query all socket paths
Returns: string []
public notifySkinnedMeshRemoved (skinnedMeshRenderer : SkinnedMeshRenderer) :
void
Input Parameters
NameTypeDescription
skinnedMeshRendererSkinnedMeshRenderer-
Returns: void
public notifySkinnedMeshAdded (skinnedMeshRenderer : SkinnedMeshRenderer) :
void
Input Parameters
NameTypeDescription
skinnedMeshRendererSkinnedMeshRenderer-
Returns: void
public getUsers () :
Set < SkinnedMeshRenderer >
Get all users.
Returns: Set < SkinnedMeshRenderer >
public createSocket (path : string) :
null | Node
Create or get the target node from a socket. If a socket haven't been created for the corresponding path, this function will register a new socket.
Input Parameters
NameTypeDescription
pathstring Path of the target joint.
Returns: null | Node
protected _applyBakeFlagChange () :
void
Returns: void
protected _removeAllUsers () :
void
Returns: void

Inherited Properties

public uuid : string
Inherited from: Animation.uuid
The uuid for editor.

example

import { log } from 'cc';
log(comp.uuid); 
public name : string
Inherited from: Animation.name
public isValid : boolean
Inherited from: Animation.isValid
Indicates whether the object is not yet destroyed. (It will not be available after being destroyed)
When an object's `destroy` is called, it is actually destroyed after the end of this frame. So `isValid` will return false from the next frame, while `isValid` in the current frame will still be true. If you want to determine whether the current frame has called `destroy`, use `isValid(obj, true)`, but this is often caused by a particular logical requirements, which is not normally required.

example

import { Node, log } from 'cc';
const node = new Node();
log(node.isValid);    // true
node.destroy();
log(node.isValid);    // true, still valid in this frame
// after a frame...
log(node.isValid);    // false, destroyed in the end of last frame 
public hideFlags : Flags
Inherited from: Animation.hideFlags
After inheriting CCObject objects, control whether you need to hide, lock, serialize, and other functions.
public enabledInHierarchy : boolean
Inherited from: Animation.enabledInHierarchy
Indicates whether this component is enabled and its node is also active in the hierarchy.

example

import { log } from 'cc';
log(comp.enabledInHierarchy); 
public enabled : boolean
Inherited from: Animation.enabled
Indicates whether this component is enabled or not.

example

import { log } from 'cc';
comp.enabled = true;
log(comp.enabled); 
public defaultClip : null | AnimationClip
Inherited from: Animation.defaultClip
Gets or sets the default clip. Two clips that both have same non-empty UUID are treat as equivalent.
public clips : ( null | AnimationClip ) []
Inherited from: Animation.clips
Gets or sets clips this component governs. When set, associated animation state of each existing clip will be stopped. If the existing default clip is not in the set of new clips, default clip will be reset to null.
public playOnLoad : boolean
default: false
Inherited from: playOnLoad
Whether the default clip should get into playing when this components starts. Note, this field takes no effect if `crossFade()` or `play()` has been called before this component starts.
public node : Node
default: NullNode
Inherited from: node
The node this component is attached to. A component is always attached to a node.

example

import { log } from 'cc';
log(comp.node); 
protected __editorExtras__ : unknown
Inherited from: __editorExtras__
protected __prefab : null | CompPrefabInfo
default: null
Inherited from: __prefab
protected _clips : ( null | AnimationClip ) []
default: []
Inherited from: _clips
protected _crossFade : CrossFade
Inherited from: _crossFade
protected _defaultClip : null | AnimationClip
default: null
Inherited from: _defaultClip
protected _enabled : boolean
default: true
deprecated
Inherited from: _enabled
Deprecated: since v3.5.0, this is an engine private interface that will be removed in the future.
protected _id : string
deprecated
Inherited from: _id
Deprecated: since v3.5.0, this is an engine private interface that will be removed in the future.
protected _name : string
Inherited from: _name
protected _nameToState : Record < string, AnimationState >
Inherited from: _nameToState
protected _objFlags : number
default: 0
Inherited from: _objFlags
protected _sceneGetter : null | ( )
default: null
Inherited from: _sceneGetter
protected __scriptAsset : null
deprecated
Inherited from: Animation.__scriptAsset
Deprecated: since v3.5.0, this is an engine private interface that will be removed in the future.
protected _isOnLoadCalled : number
deprecated
Inherited from: Animation._isOnLoadCalled
Deprecated: since v3.5.0, this is an engine private interface that will be removed in the future.
Returns a value which used to indicate the onLoad get called or not.

example

import { log } from 'cc';
log(this._isOnLoadCalled > 0); 

Inherited Methods

public unscheduleAllCallbacks () :
void
Inherited from: Animation.unscheduleAllCallbacks
unschedule all scheduled tasks.
Returns: void

example

this.unscheduleAllCallbacks(); 
public unschedule (callback_fn : any) :
void
Inherited from: Animation.unschedule
Un-schedules a custom task.
Input Parameters
NameTypeDescription
callback_fnanyThe callback function of the task
Returns: void

example

this.unschedule(_callback); 
public targetOff (typeOrTarget : any) :
void
Inherited from: Animation.targetOff
Removes all callbacks previously registered with the same target (passed as parameter). This is not for removing all listeners in the current event target, and this is not for removing all listeners the target parameter have registered. It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter.
Input Parameters
NameTypeDescription
typeOrTargetanyThe target to be searched for all related listeners
Returns: void
public stop () :
void
Returns: void
public start () :
void
Returns: void
public scheduleOnce (callback : any, delay ?: number) :
void
Inherited from: Animation.scheduleOnce
Use Scheduler system to schedule a task that runs only once, with a delay of 0 or larger.
Input Parameters
NameTypeDescription
callbackanyThe callback function of the task
delaynumberThe delay time for the first invocation, Unit: s
Returns: void

example

import { log } from 'cc';
this.scheduleOnce((dt) => void log(`time: ${dt}`), 2); 
public schedule (callback : any, interval ?: number, repeat ?: number, delay ?: number) :
void
Inherited from: Animation.schedule
Use Scheduler system to schedule a custom task.
If the task is already scheduled, then the interval parameter will be updated without scheduling it again.
Input Parameters
NameTypeDescription
callbackanyThe callback function of the task
intervalnumberThe time interval between each invocation
repeatnumberThe repeat count of this task, the task will be invoked (repeat + 1) times, use [[24197]] to repeat a task forever
delaynumberThe delay time for the first invocation, Unit: s
Returns: void

example

import { log } from 'cc';
this.schedule((dt) => void log(`time: ${dt}`), 1); 
public resume () :
void
Returns: void
public resetInEditor (didResetToDefault ?: boolean) :
void
Inherited from: Animation.resetInEditor
Called to initialize the component or node’s properties when adding the component the first time or when the Reset command is used. This function is only called in editor.
Input Parameters
NameTypeDescription
didResetToDefaultboolean-
Returns: void
public removeState (name : string) :
void
Inherited from: Animation.removeState
Stops and removes specified clip.
Input Parameters
NameTypeDescription
namestringThe name of the animation state
Returns: void
public removeClip (clip : AnimationClip, force ?: boolean) :
void
Inherited from: Animation.removeClip
Remove clip from the animation list. This will remove the clip and any animation states based on it.
If there are animation states depend on the clip are playing or clip is defaultClip, it will not delete the clip.
But if force is true, then will always remove the clip and any animation states based on it. If clip is defaultClip, defaultClip will be reset to null
Input Parameters
NameTypeDescription
clipAnimationClip-
forcebooleanIf force is true, then will always remove the clip and any animation states based on it.
Returns: void
public removeAll (typeOrTarget : any) :
void
Inherited from: Animation.removeAll
Removes all callbacks registered in a certain event type or all callbacks registered with a certain target
Input Parameters
NameTypeDescription
typeOrTargetanyThe event type or target with which the listeners will be removed
Returns: void
public play (name ?: string) :
void
Inherited from: Animation.play
Switch to play specified animation state, without fading.
Input Parameters
NameTypeDescription
namestringThe name of the animation to be played, if absent, the default clip will be played
Returns: void
public pause () :
void
Returns: void
public once <TFunction extends
(...any : any []) =>
void
>
(type : AnimationStateEventType, callback : TFunction, thisArg ?: any) :
TFunction
Inherited from: TFunction
Input Parameters
NameTypeDescription
typeAnimationStateEventType-
callbackTFunction-
thisArgany-
Returns: TFunction
public onLostFocusInEditor () :
void
Inherited from: Animation.onLostFocusInEditor
Returns: void
public onLoad () :
void
Returns: void
public onFocusInEditor () :
void
Inherited from: Animation.onFocusInEditor
Returns: void
public onEnable () :
void
Returns: void
public onDisable () :
void
Returns: void
public onDestroy () :
void
Returns: void
public on <TFunction extends
(...any : any []) =>
void
>
(type : AnimationStateEventType, callback : TFunction, thisArg ?: any, once ?: boolean) :
TFunction
Inherited from: TFunction
Register animation event callback. The event arguments will provide the AnimationState which emit the event. When play an animation, will auto register the event callback to the AnimationState, and unregister the event callback from the AnimationState when animation stopped.
Input Parameters
NameTypeDescription
typeAnimationStateEventTypeThe event type to listen to
callbackTFunctionThe callback when event triggered
thisArgany-
onceboolean-
Returns: TFunction

example

onPlay: function (type, state) {
   // callback
}

// register event to all animation
animation.on('play', this.onPlay, this); 
public off (type : AnimationStateEventType, callback ?:
(...any : any []) =>
void
, thisArg ?: any) :
void
Inherited from: Animation.off
Unregister animation event callback.
Input Parameters
NameTypeDescription
typeAnimationStateEventTypeThe event type to unregister
callback
(...any : any []) =>
void
The callback to unregister
thisArgany-
Returns: void

example

// unregister event to all animation
animation.off('play', this.onPlay, this); 
public hasEventListener (type : string, callback ?:
(...args : any []) =>
void
, target ?: any) :
boolean
Inherited from: Animation.hasEventListener
Checks whether there is correspond event listener registered on the given event.
Input Parameters
NameTypeDescription
typestringEvent type.
callback
(...args : any []) =>
void
Callback function when event triggered.
targetanyCallback callee.
Returns: boolean
public getState (name : string) :
AnimationState
Inherited from: AnimationState
Get specified animation state.
Input Parameters
NameTypeDescription
namestringThe name of the animation
public getComponentsInChildren <T extends Component> (classConstructor : Constructor < Component > | AbstractedConstructor < Component >) :
Component []
Inherited from: Animation.getComponentsInChildren
Returns all components of supplied type in self or any of its children.
Input Parameters
NameTypeDescription
classConstructorConstructor < Component > | AbstractedConstructor < Component >The class of components to be retrieved
Returns: Component []

example

import { Sprite } from 'cc';
const sprites = node.getComponentsInChildren(Sprite); 
public getComponentsInChildren (className : string) :
Component []
Inherited from: Animation.getComponentsInChildren
Returns all components of supplied type in self or any of its children.
Input Parameters
NameTypeDescription
classNamestringA string for the class name of the components
Returns: Component []

example

const tests = node.getComponentsInChildren("Test"); 
public getComponents <T extends Component> (classConstructor : Constructor < Component > | AbstractedConstructor < Component >) :
Component []
Inherited from: Animation.getComponents
Returns all components of supplied type in the node.
Input Parameters
NameTypeDescription
classConstructorConstructor < Component > | AbstractedConstructor < Component >The class of components to be retrieved
Returns: Component []

example

import { Sprite } from 'cc';
const sprites = node.getComponents(Sprite); 
public getComponents (className : string) :
Component []
Inherited from: Animation.getComponents
Returns all components of supplied type in the node.
Input Parameters
NameTypeDescription
classNamestringA string for the class name of the components
Returns: Component []

example

const tests = node.getComponents("Test"); 
public getComponentInChildren <T extends Component> (classConstructor : Constructor < Component > | AbstractedConstructor < Component >) :
null | Component
Inherited from: Animation.getComponentInChildren
Returns the component of supplied type in any of its children using depth first search.
Input Parameters
NameTypeDescription
classConstructorConstructor < Component > | AbstractedConstructor < Component >The class of component to be retrieved
Returns: null | Component

example

import { Sprite } from 'cc';
const sprite = node.getComponentInChildren(Sprite); 
public getComponentInChildren (className : string) :
null | Component
Inherited from: Animation.getComponentInChildren
Returns the component of supplied type in any of its children using depth first search.
Input Parameters
NameTypeDescription
classNamestringA string for the class name of the component
Returns: null | Component

example

var Test = node.getComponentInChildren("Test"); 
public getComponent <T extends Component> (classConstructor : Constructor < Component > | AbstractedConstructor < Component >) :
null | Component
Inherited from: Animation.getComponent
Returns the component of supplied type if the node has one attached, null if it doesn't.
You can also get component in the node by passing in the name of the script.
Input Parameters
NameTypeDescription
classConstructorConstructor < Component > | AbstractedConstructor < Component >The class of component to be retrieved or to be created
Returns: null | Component

example

import { Sprite } from 'cc';
// get sprite component.
var sprite = node.getComponent(Sprite); 
public getComponent (className : string) :
null | Component
Inherited from: Animation.getComponent
Returns the component of supplied type if the node has one attached, null if it doesn't.
You can also get component in the node by passing in the name of the script.
Input Parameters
NameTypeDescription
classNamestringA string for the class name of the component
Returns: null | Component

example

// get custom test calss.
var test = node.getComponent("Test"); 
public emit (type : EventType, arg0 ?: any, arg1 ?: any, arg2 ?: any, arg3 ?: any, arg4 ?: any) :
void
Inherited from: Animation.emit
Trigger an event directly with the event name and necessary arguments.
Input Parameters
NameTypeDescription
typeEventTypeevent type
arg0any-
arg1any-
arg2any-
arg3any-
arg4any-
Returns: void
public destroy () :
boolean
Inherited from: Animation.destroy
Returns: boolean
public crossFade (name : string, duration ?: number) :
void
Inherited from: Animation.crossFade
Smoothly switch to play specified animation state.
Input Parameters
NameTypeDescription
namestringThe name of the animation to switch to
durationnumberThe duration of the cross fade, default value is 0.3s
Returns: void
public createState (clip : AnimationClip, name ?: string) :
AnimationState
Inherited from: AnimationState
Creates a state for specified clip. If there is already a clip with same name, the existing animation state will be stopped and overridden.
Input Parameters
NameTypeDescription
clipAnimationClipThe animation clip
namestringThe animation state name, if absent, the default clip's name will be used
public addComponent <T extends Component> (classConstructor : Constructor < Component >) :
null | Component
Inherited from: Animation.addComponent
Adds a component class to the node. You can also add component to node by passing in the name of the script.
Input Parameters
NameTypeDescription
classConstructorConstructor < Component >The class of component to be retrieved or to be created
Returns: null | Component

example

import { Sprite } from 'cc';
const sprite = node.addComponent(Sprite); 
public addComponent (className : string) :
null | Component
Inherited from: Animation.addComponent
Adds a component class to the node. You can also add component to node by passing in the name of the script.
Input Parameters
NameTypeDescription
classNamestringA string for the class name of the component
Returns: null | Component

example

const test = node.addComponent("Test"); 
public addClip (clip : AnimationClip, name ?: string) :
AnimationState
Inherited from: AnimationState
Adds an animation clip into this component and creates a animation state for this clip.
Input Parameters
NameTypeDescription
clipAnimationClipThe animation clip
namestringThe animation state name, if absent, the default clip's name will be used
protected __preload () :
void
Inherited from: Animation.__preload
`__preload` is called before every onLoad.
It is used to initialize the builtin components internally,
to avoid checking whether onLoad is called before every public method calls.
This method should be removed if script priority is supported.
Returns: void
protected _createState (clip : AnimationClip, name ?: string) :
SkeletalAnimationState
Input Parameters
NameTypeDescription
clipAnimationClip-
namestring-
protected _destroyImmediate () :
void
deprecated
Inherited from: Animation._destroyImmediate
Returns: void
protected _destruct () :
void
deprecated
Inherited from: Animation._destruct
Deprecated: since v3.5.0, this is an engine private interface that will be removed in the future.
Clear all references in the instance.

NOTE: this method will not clear the getter or setter functions which defined in the instance of CCObject.

Returns: void

example

// You can override the _destruct method if you need, for example:
     _destruct: function () {
         for (var key in this) {
             if (this.hasOwnProperty(key)) {
                 switch (typeof this[key]) {
                     case 'string':
                         this[key] = '';
                         break;
                     case 'object':
                     case 'function':
                         this[key] = null;
                         break;
             }
         }
     } 
protected _doCreateState (clip : AnimationClip, name : string) :
SkeletalAnimationState
Input Parameters
NameTypeDescription
clipAnimationClip-
namestring-
protected _getLocalBounds (out_rect : Rect) :
void
Inherited from: Animation._getLocalBounds
If the component's bounding box is different from the node's, you can implement this method to supply a custom axis aligned bounding box (AABB), so the editor's scene view can perform hit test properly.
Input Parameters
NameTypeDescription
out_rectRectThe rect to store the result bounding rect
Returns: void
protected _getRenderScene () :
RenderScene
deprecated
Inherited from: RenderScene
Returns: RenderScene
protected _instantiate (cloned ?: Component) :
undefined | Component
deprecated
Inherited from: Animation._instantiate
Input Parameters
NameTypeDescription
clonedComponent-
Returns: undefined | Component
protected _onPreDestroy () :
void
deprecated
Inherited from: Animation._onPreDestroy
Returns: void
protected doPlayOrCrossFade (state : AnimationState, duration : number) :
void
Input Parameters
NameTypeDescription
stateAnimationState-
durationnumber-
Returns: void
protected lateUpdate (dt : number) :
void
Inherited from: Animation.lateUpdate
LateUpdate is called every frame, if the Component is enabled.
This is a lifecycle method. It may not be implemented in the super class.
You can only call its super class method inside it. It should not be called manually elsewhere.
Input Parameters
NameTypeDescription
dtnumberthe delta time in seconds it took to complete the last frame
Returns: void
protected onRestore () :
void
Inherited from: Animation.onRestore
onRestore is called after the user clicks the Reset item in the Inspector's context menu or performs an undo operation on this component.

If the component contains the "internal state", short for "temporary member variables which not included
in its CCClass properties", then you may need to implement this function.

The editor will call the getset accessors of your component to record/restore the component's state
for undo/redo operation. However, in extreme cases, it may not works well. Then you should implement
this function to manually synchronize your component's "internal states" with its public properties.
Once you implement this function, all the getset accessors of your component will not be called when
the user performs an undo/redo operation. Which means that only the properties with default value
will be recorded or restored by editor.

Similarly, the editor may failed to reset your component correctly in extreme cases. Then if you need
to support the reset menu, you should manually synchronize your component's "internal states" with its
properties in this function. Once you implement this function, all the getset accessors of your component
will not be called during reset operation. Which means that only the properties with default value
will be reset by editor.

This function is only called in editor mode.

Returns: void

protected update (dt : number) :
void
Inherited from: Animation.update
Update is called every frame, if the Component is enabled.
This is a lifecycle method. It may not be implemented in the super class.
You can only call its super class method inside it. It should not be called manually elsewhere.
Input Parameters
NameTypeDescription
dtnumberthe delta time in seconds it took to complete the last frame
Returns: void