Ok, what I’ll do first is try to explain what I am trying to accomplish, then I’ll throw out my problem.
What I’m trying to do is while I’m creating my game, I want to do the bulk of my work via scripting. What I mean by bulk of my work is creating hierarchys while instantiating prefabs and dynamically created objects with components added on the fly, etc. This way I don’t really have to mess with the UI of Unity that much aka the Inspector ( I just like having all my work in one place, rather than going between my code and Unity to see what is placed in what variable, what is linked to what, etc ).
Here is my problem. At least from what I can find, one cannot instantiate a prefab that does not already exist in a scene, or is at least referenced in a scene via public variables linked to scripts. I understand that I can create empty GameObjects via “new GameObject()”, but I couldn’t find a way to do this except for already having instances of my prefabs in the scene at the start, which I would like to stay away from. And again, I would prefer to stay away from linking the prefabs to the scripts as I would like the work in one place.
If anybody has any suggestions, they would be much appreciated. Oh, and just for reference, I am using C# for my scripting, but if you know of a JavaScript workaround, I’ll still take it.