Getting scene numbers through script

Hello Team,

Is there any script available to get the scene numbers of all the experiment in a particular project?

Ex: PlayCanvas | HTML5 Game Engine

Here 411256 is scene number

It is sufficient if i get the current loaded scene number

Hey Suraj have you got the solution? I am also searching for the function/API which can give me the current scene number.

Hi Pramod,

I havent got the solution yet. Looking forward to get the solution from the playcanvas team soon.

Hello Team,

Please update on the above issue…

Parsing of loaded scene data is handled by scene parser: https://github.com/playcanvas/engine/blob/master/src/resources/parser/scene.js#L10

If you breakpoint where this is called from you can see it has ID in it’s data, and going through call stack, can see where this data goes through. But it seems like the scene ID is never saved to anywhere. Perhaps overloading some function like parser to save that data could do the trick, but this would be a hack.

I personally do not use scenes functionality as they are missing a lot from design point of view. If you can structure your project with entities and hiding/showing entities - this might work much better for most cases.