clear debug draw when disable collision debug draw

This commit is contained in:
2youyouo2
2016-06-29 17:15:11 +08:00
parent 1e8af79ece
commit e6ae96d53e
@@ -385,6 +385,7 @@ cc.js.getset(CollisionManager.prototype, 'enabledDebugDraw',
cc.director.on(cc.Director.EVENT_AFTER_SCENE_LAUNCH, this.onSceneLaunched, this);
}
else if (!value && this._enabledDebugDraw) {
this._debugDrawer.clear();
cc.director.getScene()._sgNode.removeChild(this._debugDrawer);
cc.director.off(cc.Director.EVENT_AFTER_SCENE_LAUNCH, this.onSceneLaunched, this);
}