- Home /
Question by
liszto · Aug 31, 2012 at 08:07 AM ·
editorprefabsceneeditorwindow
Open scene and load prefab
Hi, I want open a scene with an editor window and load some prefab from my resources folder in it. I can do this easily ?
I know I can :
EditorApplication.OpenScene( sPathScene );
but after will 'Instantiate command' work with a gameObject load from my editor window ?
Comment
Best Answer
Answer by liszto · Aug 31, 2012 at 09:42 AM
private void InitScene()
{
//Made this dynamic after to generic usage, user choose his scene name in Wizard window and create it for all others baking
string sPathScene = "Assets/Scenes/BakingScene";
EditorApplication.OpenScene( sPathScene );
//Init all the gameobject from our window in the scene (Transform must be set in the prefab before import them in editor window )
foreach( GameObject go in LightMapUvMeshsToGenerate )
Instantiate(go);
}
Your answer
Follow this Question
Related Questions
Hold Right-Click + "W" or "S" in Scene Editor not working properly!! 1 Answer
reconnect programmatically instantiated prefab 1 Answer
Move objects in scene view before running the game 0 Answers
Referencing / linking a .asset / .prefab file in another .asset / .prefab file programmatically. 2 Answers
Need of having prefab in Scene 1 Answer