- Home /
How to automatically create prefabs/gameobjects from assets?
Hi there,
I have a load of 2D sprites which I want to turn into 2D gameobjects with different front and back images. I have figured out that bit (two quads back to back) but have gotten stuck. I don't want to have to make 800 of these objects by hand and would like to make a script to assemble them for me except I don't know where to start :/
The procedure I think is what I want is so:
Create a duplicate of the mastercopy
Find the image to put on the front and apply it
Find and apply the back image
Save the result in my prefab folder
Repeat for the next pair.
Luckily my images have sequential numerical names so incrementing them is easy.
If someone could point me in the direction I need to go it would be very much appreciated, ATM I just don't what to search for.
Answer by iabulko · Sep 21, 2016 at 01:38 PM
Check this out: http://answers.unity3d.com/questions/27626/how-to-create-prefabs-from-editor-scripts.html
Your answer
Follow this Question
Related Questions
Changing a script inside a prefab 1 Answer
Dynamic batching - different vertices 0 Answers
Initiate Prefab/GameObject when game start without writing code 0 Answers
How do I import packages with Prefabs to Update my package automatically? 1 Answer
Can a prefab script access a script of the object that created the prefab? 2 Answers