- Home /
Possible for one web player to load scenes created in different projects?
I have a multi-level/scene game in which each level of the game was made in a different unity project. So when they finish level 1, load level 2, etc., where levels 1 and 2 are from different projects. I can't figure out now though how to load these scenes dynamically during the game, or if it's even possible. I've tried (from the documentation)
// Build a streamed unity3d file. This contain one scene that can be downloaded // on demand and loaded once it's asset bundle has been loaded. BuildPipeline.BuildPlayer( ["Assets/DynamicallyLoadedScene.unity"], "DynamicallyLoadedScene.unity3d", BuildTarget.WebPlayer, BuildOptions.BuildAdditionalStreamedScenes);
This builds the scenes fine. But when I try to run the main program that will load the dynamic scene, I get the error "Level DynamicallyLoadedScene.unity couldn't be loaded because it is not added to the build settings." which I know is because I don't have the dynamic scene in the build settings (obviously it can't go there because this scene is from a different project). Is there any way to do this?
Answer by Spoiltos · May 12, 2010 at 04:01 PM
Yes it is possible, you just need to call getter function in assetBundle that contains your scene.
void OnSceneBundleLoaded(WWW www) { AssetBundle DammyLocalVariable = www.assetBundle;
Application.LoadLevel("SceneName");
}
I have the same problem, but this is not a valid solution.