How to load prefabs to config via ID?

Hi,

I managed to bound my Unity-Project configs witwh Excel to make some sort of database. Sadly I found out that doing this with prefabs is too hard for me knownledge.

I Wonder if someone know’s how to make a system in Unity that will get use of ID’s pasted from excel right into Scriptable Objects and add ealier done prefabs to SO just by interpreting ID’s that I passed to tchem?

Thanks.

I did make a straight hook for Excel / CSV data. Specifically for Excel I wrote a macro that, whenever I save, it also exports all worksheets as CSV files straight into my project. In the project I had a custom importer or rather I was monitoring the importer events and processed the CSV files, turning them into a SQLite database or just a scriptable object including code generation (but only if the table layout changed).

From there it’s just a matter of determining what each row means, typically rows have either sequentially or manually numbered IDs and those could be assigned to a specific prefab, so that the prefab scripts know which row of the data to load and use.

You can also make it so that a prefab has an assigned ID and on import into the SO it looks up all scripts identifying prefabs by ID and picks the right one.

Hi, thanks for answering! I wonder how can I assign an ID to prefab and pass it into SO while creating it? Could you please elaborate more on that?

You’d just need a script, ie a MonoBehaviour with a public int Id field where you enter the prefab’s id. You could also name the prefabs with numbered prefixes/suffixes if you prefer.

Thanks! Got it working right now.