umasteeringgroup / UMA

Unity Multipurpose Avatar
MIT License
726 stars 167 forks source link

Unused reference resources like textures not being excluded in final building app, which causes huge app size. #401

Closed leegohi04517 closed 3 months ago

leegohi04517 commented 1 year ago

Describe the bug Unused reference resources like textures not being excluded in final building app, which causes huge app size.

Environment (please complete the following information):

To Reproduce Steps to reproduce the behavior: Using flutter unity plugin and an empty scene in build settings. When click build iOS , the output data folder contains almost all uma textures which not being reference by my empty scene. I can convinced that the building output contains uma huge textures, since I unpack it with UnityAssets tools.

Expected behavior Building output not include unreference resources. The final app size remain small.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Marselord commented 3 months ago

Did you find a soluion for this? The AssetIndexer from uma is the file that references all the uma textures and that same file is getting compiled into the final build.

Jaimi commented 3 months ago

This is by design. Everything in the global library is possible to load at runtime, and thus has to be included in the build. You can address this many ways -- cleaning up the library, converting to use addressables (which loads/unloads items as needed), etc. This is a long conversation, and has been touched on many times, it's best to take this to discord where you can see previous conversations and get more help specific to what you are doing.