Demigiant / dotween

A Unity C# animation engine. HOTween v2
http://dotween.demigiant.com
Other
2.29k stars 344 forks source link

DOTween adds 2.7MB to WebGL build #684

Closed kreso22 closed 3 weeks ago

kreso22 commented 1 month ago

WebGL build in Unity 2021.3.37f1 (basic 3d scene), compressed build size = 2.8MB Add DOTween from package manager, compressed build = 5.5MB

I don't understand what is going on, but it seems like something is wrong. For WebGL build, this is a big impact (build size).

If this helps, I narrowed down some of the 2.7MB:

Removing DOTweenModuleUI removes 1.6MB from final build size. Removing DOTweenModuleUtils around 1.2MB. Physics2D 100kb

This happens in other versions of Unity as well (2022, 2023, Unity6).

I drilled down a bit, for example the 'DOTweenModuleUI', if I remove the Image part, and 'using UnityEngine.UI' it will remove all the "extra" 1.6MB from the build.

I have no idea how to fix this, other than transfer to a different tween solution.

Any suggestions?

kreso22 commented 3 weeks ago

Inspecting further - including Unity dependencies (like UI) brings project size up, not Dotween. There is no issue.