- Home /
Any way to play from a scene which isn't the one currently loaded?
I have a scene where I preload a few things and use DontDestroyOnLoad, so I can then reload my main scene without the extra overhead.
The thing is, I'm usually working in the main scene, but the preloader scene needs to run first for it to actually work. I can add something in that checks if the preloader scene ran and run it if not - Just wondering if there's a way to have the play button (or Ctrl-P) in Unity load a scene which isn't the currently active one.
Answer by Default117 · Aug 15, 2012 at 04:35 AM
Is your question "have the play button (or Ctrl-P) in Unity load a scene which isn't the currently active one." because that's what i'm taking from this. And your answer is yes, yes you can. I did this with our book apps where there are different scenes and you can play the app while any scene is loaded. You'll need to write an editor script, which keeps track of when you press play, either by assigning a script to the CTRL+ P shortcut, or listening to when the player goes into play mode. You can then use the Editor Application class to check what scene you're in, load any other scene, and so forth. http://docs.unity3d.com/Documentation/ScriptReference/EditorApplication.html
Answer by DaveA · Aug 15, 2012 at 03:02 AM
I don't think so, but you can load a scene, play it, and add to it without changing to another scene with http://docs.unity3d.com/Documentation/ScriptReference/Application.LoadLevelAdditive.html
Your answer
Follow this Question
Related Questions
Loading player location in a scene 2 Answers
obb apk scene load fail 1 Answer
My life counter is not updating 1 Answer
Random level select 1 Answer
Load Scene 1 Answer