mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
Merge pull request #6890 from ospira/process-callback-fix
Allow ProcessCallback To Work When Dealing With Arcade Bodies That Do Not Have GameObjects
This commit is contained in:
commit
683ae16522
2 changed files with 8 additions and 4 deletions
|
@ -1395,7 +1395,7 @@ var World = new Class({
|
|||
}
|
||||
|
||||
// They overlap. Is there a custom process callback? If it returns true then we can carry on, otherwise we should abort.
|
||||
if (processCallback && processCallback.call(callbackContext, body1.gameObject, body2.gameObject) === false)
|
||||
if (processCallback && processCallback.call(callbackContext, (body1.gameObject || body1), (body2.gameObject || body2)) === false)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
*
|
||||
* For all other cases, `object1` and `object2` match the same arguments in `collide()` or `overlap()`.
|
||||
*
|
||||
* @param {(Phaser.Types.Physics.Arcade.GameObjectWithBody|Phaser.Tilemaps.Tile)} object1 - The first Game Object.
|
||||
* @param {(Phaser.Types.Physics.Arcade.GameObjectWithBody|Phaser.Tilemaps.Tile)} object2 - The second Game Object.
|
||||
*/
|
||||
* Note you can receive back only a body if you passed in a body directly.
|
||||
*
|
||||
* You should only do this if the body intentionally has no associated game object (sprite, .etc).
|
||||
*
|
||||
* @param {(Phaser.Types.Physics.Arcade.GameObjectWithBody|Phaser.Physics.Arcade.Body|Phaser.Tilemaps.Tile)} object1 - The first Game Object.
|
||||
* @param {(Phaser.Types.Physics.Arcade.GameObjectWithBody|Phaser.Physics.Arcade.Body|Phaser.Tilemaps.Tile)} object2 - The second Game Object.
|
||||
*/
|
Loading…
Reference in a new issue