• Unity
  • Unity - Disable Update functions for static spine objects

Hi

We have a static spine object. No animations, no meshes only one bone.

We use it as a thumbnail image in dialog which have 40-50 of instances.

We just found out that unity calls these functions for these objects.

SkeletonRenderer.LateUpdate();
SkeletonAnimation.Update();

Is there any way to minimize updates since we only need slots to be drawn?

Related Discussions
...

Disable the SkeletonAnimation or SkeletonRenderer component.
Call its LateUpdate method manually. Call it only once if you only need it to render the first time.

Hi Pharan.
I have the same situation, could you advise please?

My code looks like this :

playerAnim = (SkeletonAnimation)gameObject.AddComponent("SkeletonAnimation");
playerAnim.skeletonDataAsset = playerData;
playerAnim.skeletonDataAsset.atlasAssets[0].Reset();
playerAnim.skeletonDataAsset.Reset();
playerAnim.state = new Spine.AnimationState(playerAnim.skeletonDataAsset.GetAnimationStateData());
playerAnim.calculateNormals = true;
playerAnim.loop = false;
playerAnim.Reset();

Do I have to add the following to disable the SkeletonAnimation component?

playerAnim.enabled = false;
playerAnim.LateUpdate ();

Thanks in advance!

@[supprimé]
That first part of your code is a totally different topic.
I'd be happy to discuss potential problems with it if you open a new thread/topic with it.
I think it will be helpful for other people too.

But yes, that second part of your code is correct.