Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix spine cache mode event type bug #209

Conversation

@sunnylanwanjun
Copy link
Contributor

sunnylanwanjun commented Nov 19, 2019

https://forum.cocos.org/t/cocos-creator-v2-2-1/85555/369?u=sunnylanwanjun
修复spine原生平台 在 cache 模式下的事件回调与web参数不一至的问题。

this._nativeSkeleton.setCompleteListener(function (animationName) {
let self = this._comp;
self._endEntry.animation.name = animationName;
self._completeListener && self._completeListener(self._endEntry);

This comment has been minimized.

Copy link
@holycanvas

holycanvas Nov 19, 2019

Collaborator

complete事件使用的是endEntry么

This comment has been minimized.

Copy link
@sunnylanwanjun

sunnylanwanjun Nov 19, 2019

Author Contributor

是,complete和end是同一个事件,在cache模式下。

this._nativeSkeleton.setStartListener(listener);
if (this.isAnimationCached()) {
this._nativeSkeleton.setStartListener(function (animationName) {
let self = this._comp;

This comment has been minimized.

Copy link
@holycanvas

holycanvas Nov 19, 2019

Collaborator

self 需要放在外面定义么,这几个 this 都是指向调用者哦

This comment has been minimized.

Copy link
@sunnylanwanjun

sunnylanwanjun Nov 19, 2019

Author Contributor

这个this是指向 _nativeSkeleton,_comp在初始化 _nativeSkeleton的时候,把Skeleton组件赋值给了_nativeSkeleton

@holycanvas holycanvas merged commit e77cfaa into cocos-creator-packages:v2.2.1-release Nov 20, 2019
linguitang added a commit to linguitang/jsb-adapter that referenced this pull request Nov 21, 2019
fix spine cache mode event type bug (cocos-creator-packages#209)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.