(changed: ComponentChanged)
| 365 | } |
| 366 | |
| 367 | removeEvent(changed: ComponentChanged) { |
| 368 | const { gameObject } = changed; |
| 369 | const a11y = gameObject.getComponent(A11y) as A11y; |
| 370 | if (!a11y) return; |
| 371 | const event = changed.component; |
| 372 | if (!event) return; |
| 373 | const { a11yId } = a11y; |
| 374 | const func = this.eventCache.get(a11yId); |
| 375 | const element = this.cache.get(a11yId); |
| 376 | element && element.removeEventListener('click', func); |
| 377 | } |
| 378 | |
| 379 | /** |
| 380 | * 设置无障碍属性标签 |
no test coverage detected