• Unity
  • Pass Calls are increased at runtime when using Mask Interact

  • Editado
Related Discussions
...

The same 3 characters were placed in the scene with the SkeletonAnimation Component's Mask Interaction set to "Visible Outside Mask".
Since the 3 characters have the same material, the Pass Call should not increase.
However, when you play the game, your Pass Call will be increased by replacing it with another material.
Is this the correct behavior?

Package version: spine-unity-3.8-2020-09-29.unitypackage

Thanks for reporting and sorry for the trouble.

The clean bugfix will take a bit more effort, so we have created an issue ticket here:
[unity] Mask interaction materials cause unnecessary batches · #1769
We will let you know once the issue is resolved.

If you are in a hurry you can change the lines 466-468 of SkeletonRenderer.cs from this:

if (materialsChanged && (this.maskMaterials.AnyMaterialCreated)) {
   this.maskMaterials = new SpriteMaskInteractionMaterials();
}

to the following:

if (materialsChanged && (this.maskMaterials.AnyMaterialCreated)) {
   if (Application.isPlaying) {
      this.maskMaterials = new SpriteMaskInteractionMaterials();
   }
}

This will solve the problem for most cases.

Thanks for the reply.
I'm waiting for the bug to be fixed so that any changes to Mask Interaction in RunTime will use the cached material and not increase the Pass Call.