-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
avoid cc.game.once multiple triggers. #6055
Conversation
@@ -396,7 +396,7 @@ let CollisionManager = cc.Class({ | |||
|
|||
for (let i = 0, l = colliders.length; i < l; i++) { | |||
let collider = colliders[i]; | |||
if(collider instanceof cc.PhysicsCollider) { | |||
if(cc.PhysicsCollider && collider instanceof cc.PhysicsCollider) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个判断是做什么的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
模块裁剪吧,如果把物理剔除了,instanceof 就会报错
@@ -429,14 +429,14 @@ var game = { | |||
* @typescript | |||
* on<T extends Function>(type: string, callback: T, target?: any, useCapture?: boolean): T | |||
*/ | |||
on (type, callback, target) { | |||
on (type, callback, target, once) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不是once有问题么,怎么改on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
once 是通过 on + 参数实现的
提到2.3或者2.3.1? |
fix issue, see https://forum.cocos.org/t/cc-gamme-once/88132