mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 18:42:40 +08:00
Merge pull request #2082 from feijing566/master
[dragonbones]miss clone _hasListenerCache
This commit is contained in:
@@ -381,9 +381,10 @@ dragonBones.ArmatureDisplay = cc.Class({
|
||||
var self = this;
|
||||
|
||||
// discard exists sgNode
|
||||
var listenersBefore = null;
|
||||
var listenersBefore = null, listenerCacheBefore = null;
|
||||
if (self._sgNode) {
|
||||
listenersBefore = self._sgNode._bubblingListeners; // get the listeners added before
|
||||
listenerCacheBefore = self._sgNode._hasListenerCache;
|
||||
if ( self.node._sizeProvider === self._sgNode ) {
|
||||
self.node._sizeProvider = null;
|
||||
}
|
||||
@@ -403,6 +404,7 @@ dragonBones.ArmatureDisplay = cc.Class({
|
||||
|
||||
if (listenersBefore) {
|
||||
sgNode._bubblingListeners = listenersBefore; // using the listeners added before
|
||||
sgNode._hasListenerCache = listenerCacheBefore;
|
||||
if (CC_JSB && !sgNode.hasEventCallback()) {
|
||||
// In JSB, should set event callback of the new sgNode
|
||||
// to make the listeners work well.
|
||||
|
||||
Reference in New Issue
Block a user