|
Main problem hear is that the a MenuItem Method has to be static. But if you declare a Transform variable as a static variable then you you can't access it in the editor. Then you can't assign a Prefab to it. e.g. From other questions I think I should us a singleton, but I don't know how to implement that into my code.
(comments are locked)
|
|
Since it is a MenuItem you could use Selection.activeObject to retrieve the currently selected prefab from your project view and instantiate it: Else if you know exactly what is the prefab you want to instantiate, you could put the prefab in the Resources folder and use it:
(comments are locked)
|
