Skip to content
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.

Merged
merged 2 commits into from Jan 10, 2020

Conversation

xianyinchen
Copy link
Contributor

@xianyinchen xianyinchen commented Jan 8, 2020

@@ -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) {
Copy link
Contributor

@holycanvas holycanvas Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个判断是做什么的?

Copy link
Member

@jareguo jareguo Jan 10, 2020

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) {
Copy link
Contributor

@holycanvas holycanvas Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不是once有问题么,怎么改on

Copy link
Member

@jareguo jareguo Jan 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once 是通过 on + 参数实现的

@holycanvas
Copy link
Contributor

holycanvas commented Jan 8, 2020

提到2.3或者2.3.1?

@jareguo jareguo changed the base branch from master to v2.3.0 Jan 10, 2020
@holycanvas holycanvas merged commit 94c6ee5 into cocos:v2.3.0 Jan 10, 2020
1 check passed
@holycanvas
Copy link
Contributor

holycanvas commented Jan 10, 2020

cocos/2d-tasks#2347

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants