- Home /
Question by
GiViZed · Jan 27, 2021 at 09:02 AM ·
instantiateprefabinstantiate prefab
How to add gameobjects to opened prefab with EditorWIndow?
Hello, I have a map as a prefab that I want to edit. My goal is to be able to open the prefab, open my custom EditorWindow, and, by pressing the buttons in it instantiate prefabs into the opened prefabs, modify them and so on.
I`ve tried instantiating the prefabs into the prefab like so: var newNode = PrefabUtility.InstantiatePrefab(nodePrefab, _prefabScene) as GameObject;
But it seems that when you open a prefab, the scene does not change, only SceneView does. So PrefabUtility.InstantiatePrefab(prefab) instantiates a prefab into the main scene, not the prefab.
Comment