mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
Improve visible children performance
This commit is contained in:
parent
3c97cd9a46
commit
272f61eda2
1 changed files with 1 additions and 13 deletions
|
@ -624,19 +624,7 @@ var CameraManager = new Class({
|
|||
*/
|
||||
getVisibleChildren: function (children, camera)
|
||||
{
|
||||
var visible = [];
|
||||
|
||||
for (var i = 0; i < children.length; i++)
|
||||
{
|
||||
var child = children[i];
|
||||
|
||||
if (child.willRender(camera))
|
||||
{
|
||||
visible.push(child);
|
||||
}
|
||||
}
|
||||
|
||||
return visible;
|
||||
return children.filter(function(child) { return child.willRender(camera); });
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue