Save gameobject from imported mesh (with imported texture) as prefab/resource at runtime.
Hello!
Essentially, my program is supposed to allow players to import .obj files and make them into playable figurines, then instantiate and do stuff with them on a board etc. etc. But I need a way to save them so I can use them in different scenes. And all the importing and saving needs to happend at runtime.
I already got all the importing/gameobject structure/texturing/naming thing properly set up. GIven how little I know of programming, I'm kind of astounded that this works, but now it seems i'm in quite a pickle...
I've seen that the unityEditor utility to save prefabs does not work beyond the editor itself, so I cannot build with it (My what a tease!), but I've heard other people mention something can be done with XML documents.
However, it's still unclear to me if the XML thing might even apply to objects that are not already prefabs or easily instantiateable from script.
I know I could, in theory, knit a script that re-imports and re-builds all needed meshes, textures and gameobjects from scratch each and every time, but I predict this to be an immensely cumbersome (and slow) process in a program like mine since the figurines can grow to be numerous (player customization and all that...).
So basically, to avoid this problem, can anyone tell wether there is, or not, a real option to turn imported meshes into prefabs and save them at runtime?
Thanks you for your time!
Your answer
Follow this Question
Related Questions
How to save and load complete gameobjects 0 Answers
Changing a Prefab's Text component seems to be broken. 1 Answer
Editing prefabs at runtime 0 Answers
How private variable track a GameObj? 1 Answer
Create gameobject in other scene... 0 Answers