The Physics Manager now has a new reset method which will reset the active physics systems. This is called automatically on a State swap (thanks @englercj #1691)

This commit is contained in:
photonstorm 2015-03-24 10:21:12 +00:00
parent 7aa4d0ad0d
commit ebdb6d028f

View file

@ -316,6 +316,26 @@ Phaser.Physics.prototype = {
},
/**
* Resets the active physics system. Called automatically on a Phaser.State swap.
*
* @method Phaser.Physics#reset
* @protected
*/
reset: function () {
if (this.p2)
{
this.p2.reset();
}
if (this.box2d)
{
this.box2d.reset();
}
},
/**
* Destroys all active physics systems. Usually only called on a Game Shutdown, not on a State swap.
*