#Find Subscene by Name

1 messages · Page 1 of 1 (latest)

hollow flicker
#

In the context of a Unit Test, I am loading a Unity Scene by path, which then loads several entities scenes via the Subscene MonoBehaviour component.

How can I figure out which Subscenes are which in the standalone player, via the new SceneSystem APIs? They all use GUIDs, but because it's all loaded for me by the Subscene component, I don't have access to the GUIDs. It seems like all remnants of the Subscene names / paths is gone by the time the player is build.

SceneSystem.GetSceneGUID("path") only seems to work for normal GameObject scenes, but not for Subscenes. 😦

mint bronze
#

not sure if there is a way; perhaps it would work if you also add all the subscenes as normal scenes to the build (though that's surely not what you want to do)

we store all our subscenes in a scriptable object and add them to a scene at build time; this scriptable object stores the scene references using GUIDS (via
https://github.com/starikcetin/Eflatun.SceneReference)

this scene reference utility also contains a path to guid map which may be useful for your case