I'm trying to get my head around doing more complicated things with baking than just directly turning prefabs into entities. We have a monobehaviour on the root GameObject of the prefab that has a list of links to child objects. I'd like to come out of the other side of the baking process with each of those child objects having a component attached that I can use to find them later. What's the best way to go about doing that?
#Prefab processing.
1 messages · Page 1 of 1 (latest)
I guess another way would be to add a monobehavior to the child objects that need processing. I know there are some default Unity monobehaviours (like particlesystem) that are preserved when a prefab is imported. Is there a way to add user defined monobehaviours to that list?
You can add a baking only tag component to the root gameobject, then make a baking system that iterates all entities that have a parent and check if the parent has the tag component. Or LinkedEntityGroup might be the right one? Forgot which one is used by default
Do you have any example ?
Wops, meant to write baking only buffer component. Let me see if I can find some code where I do it
I found solution. the issue was when I destroy a entity it was not distroy it childs.
thank you for reply.
oh yea, always loop through them manually unfortunately