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

运行时修改添加 PhysicsCollider 组件的 Node 的 group 属性,报错。 #4942

Closed
HengHuH opened this issue Jul 23, 2019 · 3 comments

Comments

@HengHuH
Copy link

HengHuH commented Jul 23, 2019

Creator version?(版本号)

2.0.10

Affected platform?(受影响的平台)

Web, maybe ALL

How to reproduce?(如何重现)

为 node 添加 PhysicsCollider 组件
运行时修改 node 的 group 属性

JavaScript output or error produced?(报错信息和调用栈)

collider not added or already removed
Can't find testFunc for (cc.PhysicsBoxCollider, $s). cc.BoxCollider

Demo project?(demo 项目)

@HengHuH HengHuH changed the title Collider 运行时修改添加 PhysicsCollider 组件的 Node 的 group 属性,报错。 Jul 23, 2019
@HengHuH
Copy link
Author

HengHuH commented Jul 23, 2019

原因: PhysicsCollider 组件并没有交给 CollisionManager 管理。
NodeEvent.GROUP_CHANGED 触发后,获取 Node 上所有 Collider 组件(包含 PhysicsCollider)用来删除。

@knoxHuang
Copy link
Contributor

未能重现,能否用 2.1.2 版本在测试一次呢?

2youyou2 pushed a commit that referenced this issue Jul 31, 2019
2youyou2 pushed a commit to 2youyou2/engine that referenced this issue Jul 31, 2019
2youyou2 added a commit that referenced this issue Jul 31, 2019
jareguo added a commit that referenced this issue Aug 2, 2019
* commit 'a3de003db47b4afa537a97b829ad75069f48be95':
  fix browser breaking when playing audio on uc browser (#5048)
  fix vec2、vec3、vec4 parameters type error (#5064)
  Fix call node targetOff func has not remove node from target.__eventTargets array (#5052)
  add play and stop sub particle for editor mode (#5031)
  fix IE11's not supporting to Array.includes (#5033)
  fix issue #4942
  BUG FIX: audio fail to register touch event listener && fix audio loading (#4991)
  fix ecScene null (#5000)
  Lifecycle: always call start, update, lateUpdate in try catch (#4941)
  Fix a memory leak caused by the render-data not being properly released! (#5025)
  avoid releasing builtin asset (#4915)
  fix auto sync prefab rotation and z invalid (#4975)
  revert fix pageview inertia invalid (#4945) (#4968)
  refine code (#4964)
  fix pageview inertia invalid (#4945)

# Conflicts:
#	cocos2d/audio/CCAudio.js
#	cocos2d/core/graphics/graphics.js
#	cocos2d/core/load-pipeline/audio-downloader.js
#	cocos2d/core/platform/CCSys.js
#	cocos2d/core/renderer/index.js
#	cocos2d/core/utils/prefab-helper.js
#	cocos2d/renderer/render-data/render-data.js
#	cocos2d/tilemap/CCTiledMap.js
@knoxHuang
Copy link
Contributor

该问题已经修复

jareguo added a commit that referenced this issue Aug 6, 2019
* commit 'ebf0d5f651ffe9521af0efafb460f84990aa2076':
  fix issue #4942 (#4949)
  valueType add rotateAround func (#4642)
  Improve localization (#4450)
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

No branches or pull requests

2 participants