Animation Events
In games, it is often necessary to execute some function at the end of an animation or at a specific moment in a certain frame. At this time, it can be achieved by adding Animation Events. After adding an event function on to a key frame, the animation system will match the corresponding function methods on the animation root node and execute them when the animation reaches the key frame.
Please refer to the frame events documentation before continuing.
Adding an event frame
First, move the time control line to the position where the event needs to be added, and then click the button in the toolbar area. The same golden icon , this is the event we added.
Deleting an event frame
At the added time frame position, right-click and select Delete. Deleting here will delete all time frame functions at that time position.
Add an event frame function
Click the +
button on the upper left of the Event Function Editor to add a new event frame function.
Delete time frame function
To delete a frame function at the corresponding time position separately, you can click the delete button next to the function name in the Event Function Editor.
Editing a specified event trigger function
Double-click the event frame just added to open the Event Editor. In the editor, we can manually enter the name of the function that needs to be triggered. When the event is triggered, animation system will execute all corresponding method with the same name in each component of the animation root node.
If you need to add the incoming parameters, click +
or -
next to Params. Currently, only three types of parameters are supported: Boolean, String, and Number.
After the modification occurs, a red asterisk will appear next to the title of the Event Function Editor. The modification of the event function needs to be manually saved. After the modification, click the save button above to save. If not saved, there will be a pop-up box prompting to save when closing the Event Editor.