mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 09:48:18 +00:00
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:
parent
7aa4d0ad0d
commit
ebdb6d028f
1 changed files with 20 additions and 0 deletions
|
@ -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.
|
* Destroys all active physics systems. Usually only called on a Game Shutdown, not on a State swap.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue