#Build Android version with sub scenes

1 messages · Page 1 of 1 (latest)

nimble dagger
#

I am trying to build android version with some subscene. I need to load subscene at runtime depend on current level index, so I created a subscene data base by using the scriptable object like the following image. It worked well on the editor, but didn't work on android device. I got this error when run the game on my device.
Error Unity Loading Entity Scene failed because the entity header file couldn't be resolved: guid=082399be3045c3b488f849cbc3d28ef3.
Does anyone know how to configure those subscenes with the build?

naive carbon
#

subscenes shouldn't be in your build list they will be converted during build stage and the scene is never used again

#

so all you need to include is the root scene the subscenes exist in

#

as for android, i haven't built on it for years so not aware if there are current issues with it sorry

nimble dagger
#

because I load the subscene at runtime so all subscene were not attach to any root scene. That why I have to list them in the build setting

naive carbon
#

you are attaching the scene

#

not the subscene in the build settings

#

the scene is never used in a build

#

so all subscene were not attach to any root scene
i don't even know what you mean by this? to be a subscene it has to have a subscene component and be in a scene

#

otherwise it's just a normal scene ^_^'

nimble dagger
#

so with the api SceneSystem.LoadScene, it is used in what case?

naive carbon
#

SceneSystem.LoadSceneAsync has 3 overrides - none of them take Scene

#

are you using 0.51?

nimble dagger
#

no I'm using 1.0.0-pre.15

nimble dagger
naive carbon
#

yep thats fine

#

was just curious because LoadScene exists in 0.51

#

and in 0.51 if you built with build settings like above you would get your error

naive carbon
nimble dagger
#

but even if I have guid of that scene, I still have to include my level scene as subscene of a scene right?

nimble dagger
naive carbon
#

yes

nimble dagger
#

oh, so the scene system seems useless in my case

naive carbon
#

how so?

#

subscenes really only store their GUID

#
        [HideInInspector]
        Hash128 _SceneGUID;```
#

so opening a subscene is usually done with guid

#

(or you can use the entity which is personally how i do it)

#

but unity still has to know you want it to be a subscene and convert it as such

nimble dagger
#

In my case, I have multiple level maps, each map I store in a scene. When player go to the battle, I will load the scene with the corresponding current level index. but these scenes consist entirely of entities so it must be in the subscene

#

so what I should do in my case? create a normal scene with a subscene inside, and load that normal scene instead of 'subscene' right 😅

naive carbon
#

i'd probably just have 1 scene

#

with every level in it as separate subscenes

nimble dagger
#

so How do manage the subscene? by name or by index. And when you load a scene include all subscenes, is it heavy and redundant with unused levels?

naive carbon
#

the subscene script has only Hash128 _SceneGUID; in it

#

it's light as

#

if you turn off autoload on them it won't do anything when loading subscene

#

the subscene data is not stored in there

#

it's stored in StreamingAssets/EntityScenes

#

and is loaded via guid on demand