Instantiate prefab in editor

Hi,

I need to create/instantiate prefab in editor. I know you can use [ExecuteInEditMode] and then just Instantiate(), but that will create copy of the prefab. So when I change the prefab, this object will not change accordingly.

Imagine you are building many levels, and you place objects into scene in edit mode via code, not just by dragging prefabs into scene.

How can I spawn prefabs in code in edit mode? (So actually spawned object is blue as prefab, not prefab clone as: name(Clone))

Thanks for any help, really.

I think that

PrefabUtility.InstantiatePrefab(object);

is what I`m looking for.

You need this: Unity - Scripting API: PrefabUtility.InstantiatePrefab