Im not sure the best way to do this.
basically i’d like to have an editor where a GUI element has a list of objects you can spawn
but if i decide later to add a new object you can spawn i dont want it to be a huge pain.
So what i’d like to do is basically have code where i have a gameobject list variable
and add every object in a folder.
That way later when i want to add a new object I just drop the object into a prefab spawn folder and the code automagically adds it to the list of spawnable objects in the GUI.
So basically when i write
List MyList;
MyList.add(x);
how can i make x iterate through objects in a folder.
is there some kind of way to do
foreach (gameobject in “directory”)
Unless you're planning on building your project out with all of those resources then I'd go a different route then using the Resources folder. Everything in there gets put into the build whether its used or not.
– iwaldropi don't quite understand this. You mean like even if i load a scene where none of it's used it's still like cached i ram? or you just talking about the size of the install or what? I mean these items are basically different shapes you use in an editor. Though not all shapes will be used all shapes will be available to be used anytime you run the editor. So for the purpose of the scene it's perfectly fine to have all the objects in memory for that scene.
– sparkzbarcaThe assets aren't stored in memory, but they are included in the build. Considering that these assets are for editor use only, and assuming that they'll never be available in a build, then the resources folder wouldn't be where you want them. I'm not sure if there is an editor only version of the resources folder or not...if there is then just update your project accordingly. Something for me to investigate too, that.
– iwaldropoh i'm sorry i made that unclear. I meant an editor in game. (like for a player to use to build stuff) Not as in unity editor objects but like halo 4 kind of editor editor. Built into the game.
– sparkzbarca