无论 node.active 是否为 true , invalidateChildren 总是会被执行, 导致性能出现问题.
Author: finscnCreated Sep 8, 2024Updated Sep 9, 2026
LabelsBugNeeds Triage
Cocos Creator version
3.8.3
System information
all
Issue description
无论 node.active 是否为 true , node.invalidateChildren() 总是会被执行, 导致性能出现问题.
node.acitve 或者 _activeInHierarchy = false 时, 对node 进行一些处理时, 还是会 调用 invalidateChildren , 而 invalidateChildren 是深度全遍历的. 我的实际场景中, 有 20000 (2万) 多个节点, 但是其中大多是 是 active 或者 _activeInHierarchy = false的. 然后 对他们的 父节点 进行某些操作时, invalidateChildren 还是会对 那些隐藏的节点进行处理. 从而影响性能
Relevant error log output
No response
Steps to reproduce
如上所述.
Minimal reproduction project
No response
Source: cocos/cocos-engine