most prefabs i am trying to export exports close to the entire codebase of the project
if by a miracle it does export it has a 60% fail rate when importing on another project to break all links completely
such a great system…
most prefabs i am trying to export exports close to the entire codebase of the project
if by a miracle it does export it has a 60% fail rate when importing on another project to break all links completely
such a great system…
Are you saying you’re putting most of your project in a prefab, exporting that, and then are shocked when it doesn’t work well? Or are you saying the editor is incorrectly exporting unnecessary parts of the project?
The second part, unity picks a mountain of things to export even with small prefabs.
picking the exported components manually does work but its real time consuming.
It’s true, for scripts Unity just includes more or less everything because we don’t know which scripts the Prefab depends on. We only figure out what to include based on Asset dependencies, not script dependencies. What this means is that we don’t do code analysis to calculate scripts that depend on other scripts etc, and even if we did, it wouldn’t catch certain cases like usage of reflection. So scripts is just some annoyance where you have to know yourself which scripts the Prefab depends on (if you don’t want to include everything), because Unity doesn’t know it.
It’s completely understandable that Unity can’t really figure out code dependencies. The problem is that the interface for export package is useless. Here’s what happens when you select “export package” for a prefab with two simple scripts on it:
Look at that scroll bar!
This means that we have to manually go through that list and deselect every script. Or, we can uncheck “Include Dependencies”, and get nothing. What we’re interested in when exporting a prefab is all the meshes and materials and such attached to it.
A solution that would make this workable would be for “Include Dependencies” to select just the scripts attached to the prefab, and then let us deal with code dependencies manually. The “include every script so we’re sure this will work” approach isn’t a very good idea at all.
Right, fair enough, I’ll pass on the feedback.
Sounds like a good idea to me, usually i know what scripts i need to export (or in most cases i do not even want to export all script dependencies as most of them will be inside the other project anyway (for example something like DoTween)
The most important thing is that i can be assured that all my materials and textures are picked up so my prefab looks the same as it did in my other project.