warmanw

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?
Аватара пользователя
warmanw

Kickstarter Backer
  • Сообщения: 341

Pharan

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.
Аватара пользователя
Pharan
  • Сообщения: 5366

rkamalya1

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!
rkamalya1
  • Сообщения: 5

Pharan

@rkamalya1
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.
Аватара пользователя
Pharan
  • Сообщения: 5366

rkamalya1

Thanks Pharan. I'll be glad to get the things done right! The new topic is http://esotericsoftware.com/forum/Disabling-SkeletonRenderer-or-SkeletonAnimation-component-4851
rkamalya1
  • Сообщения: 5


Вернуться в Unity