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. #6055

Merged
merged 2 commits into from
Jan 10, 2020

Conversation

xianyinchen
Copy link
Contributor

@@ -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

Choose a reason for hiding this comment

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

这个判断是做什么的?

Copy link
Contributor

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

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

once 是通过 on + 参数实现的

@SantyWang
Copy link
Contributor

提到2.3或者2.3.1?

@jareguo jareguo changed the base branch from master to v2.3.0 January 10, 2020 03:50
@SantyWang SantyWang merged commit 94c6ee5 into cocos:v2.3.0 Jan 10, 2020
@SantyWang
Copy link
Contributor

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.

4 participants