- Creator 版本: 3.2.0
目前在做项目的时候发现关闭多点触控有时会影响单点时的触摸事件传递,然后查看了一下引擎源码在
event-manager 发现。
if (!macro.ENABLE_MULTI_TOUCH && eventManager._currentTouch) {
const node = eventManager._currentTouchListener._node;
if (!node || node.activeInHierarchy) {
return false;
}
}
这个在关闭多点触控的时候,会检测传递时的上一个节点吗?
但是他这个检测的逻辑我看不懂,为什么是节点不存在或者节点的activeInHierarchy为true,如果这个是为了检测节点不存在,那后面的activeInHierarchy不是应该为false吗。
如果是为了检测节点存在那前面不是应该检测node && node.activeInHierarchy吗。
能力有限代码就只能看懂这些,但是还是觉得很奇怪。
所以想问一下这里到底是要检测节点的active为true还是false。