- Home /
Import assets, linking their components automaticly.
I have a collection of multiple folders, made up of assets. How to import an object and link components automaticly? The folders are something like this: There is a main folder that names the object . Inside, there are Prefabs folder, Materials folder, Textures folder and fbx file of the object. How to load all these objects automaticly and make the object seen in the scene, completely textured? Ah...in textures folder, there are multiple textures, with name, dif, normal and spec definitions in the file names. How to link all of these automaticly?
I just converted to a comment for you.
Just create prefabs with all the components attached. Load the prefabs using Resources.Load. This is how you should be doing it, you are making this waaay harder than it is to do this.
Or load all your assets into an array, Loop through the array, check the name of the object, then use a switch based on that name, and AddComponent depending on the name.
Again, you should just make prefabs.
Thanks. This time I wrote it right. I will try to follow your tip.
Your answer
Follow this Question
Related Questions
Ref to Texture Missing when Creating Sprite by Script during Asset Postprocessing 1 Answer
Missing water textures for water assets (Basic Water) 0 Answers
Creating multiple assets from the same texture 0 Answers
Prefab Sharing Textures 1 Answer
Help stopping texturing one model in editor from texturing all models loaded into project? 1 Answer