-
Creator 版本: 2.4.3
-
目标平台: 网页
-
重现方式:
我想问一下这个回调函数在哪里声名、怎么触发?
目前我在函数内部定义如下图1

以及外部生命周期定义方法如下图2都不管用

callback will triggered when it place in class has the same of node with cc.Animation component.

No, you don’t need.
May be you has push many call back.
Let try to set : clip.events[0] = {frame : 1, func: “frameEvent”, params : [“xxx”]}
Print clip to see that the callback already exists, but I don’t know how to trigger it now.

let’s show your class here 
Oh, i see 
Let’s try to add event before you addClip 
Tried it, still no effect
Wrap_node must be = this.node.
It works, but I want to add it to different animation container nodes, so this callback feels a bit tasteless
Create a class with callback function, and then add class to that container node.
Yep.I will try it tomorrow. Anyway,thanks so much.
“Add a class to this container node”, can you elaborate on this? I guess it may be necessary to add script components to each container node and then introduce class
node.addComponent(YourClass);
It’s totally fine, just know that you can add classes as node components, thank you so much.
该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。