Destroying a Game Object will now call destroy on its physics body.

This commit is contained in:
Richard Davey 2018-02-14 19:33:13 +00:00
parent a0ec4c6d2a
commit d72c7d501a

View file

@ -342,11 +342,9 @@ var GameObject = new Class({
this.data = undefined;
}
// TODO Keep a reference to the manager in Body, so body can remove itself, not via System
if (this.body)
{
// sys.physicsManager.remove(this);
this.body.destroy();
this.body = undefined;
}