The issue you're experiencing with duplicate mesh assets in your Unity bundle when using nested prefabs is related to how the spine-unity runtime handles mesh data. In spine-unity 4.0 and later, the generated skeleton mesh is added to the prefab to provide preview images and thumbnails in the Unity Editor. This can lead to multiple instances of the mesh being included in the bundle if the prefabs are nested. To address this, you can configure the behavior via the Unity Preferences under Edit - Preferences - Spine
, specifically in the Prefabs
section. Additionally, ensure that the meshes are automatically removed before building the executable via a pre-build step, which should prevent them from increasing the build size or load time.
For more detailed information, you can refer to the Spine Preferences documentation and the related GitHub issue.