Find all the objects of type X in the game

#1

Hi,
I have a lot of custom objects that are in different types and they are hard to find when a particular problem happens!
I try to list all the objects present in game, so I can perform a dynamic type check on them.
What do you recommend?

0 Likes

#2

Check out https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof

0 Likes

#3

Thanks, but my main question is how to find the list of all the objects on the game(or maybe window!), I have no problems with the dynamic type checking stage.

0 Likes

#4

Per scene, they are in this.sys.displayList or this.sys.updateList.

0 Likes

#5

Thanks
But a question came up to me! When shutdown called and we handle the event, all the objects have been erased before event get catch? Or should garbage collector will remove them after shutdown?
If I read the objects at the start of shutdown , it returns an empty list !

0 Likes