llxwd008

Hi,
In my current game, Update() and LateUpdate() of SkeletonAnimation consumes a lot of CPU time. I need to optimize this. Set UnityEngine.Application.targetFrameRate works, but it reduced the quality of the entire game. I need a way to only reduce the call of SkeletonAnimation Update() and LateUpate(), for 30FPS, and the whole game for 60FPS. How to do this?
llxwd008
  • Postovi: 4

Harald

If you want to reduce the number of updates of the skeleton components, please see the example scene Spine Examples/Other Examples/FixedTimestepUpdates. The skeletons in this scene use example components named SkeletonAnimationFixedTimestep which demonstrate custom updates.
Avatar
Harald

Harri
  • Postovi: 4088

llxwd008

Harald je napisao/la:If you want to reduce the number of updates of the skeleton components, please see the example scene Spine Examples/Other Examples/FixedTimestepUpdates. The skeletons in this scene use example components named SkeletonAnimationFixedTimestep which demonstrate custom updates.
mmmmm. Thank you, I checked the code. That's the traditional way. I wrote the same code before...Mybe it's the only way... :think:
llxwd008
  • Postovi: 4

Harald

Basically all that you can do is skip some update calls when Unity calls Update and LateUpdate. BTW: when updating e.g. every second frame, make sure that some skeletons update on odd frames and some on even. I can't think of any other way currently how to achieve a reduced update count.
Avatar
Harald

Harri
  • Postovi: 4088


Natrag na Unity