I just noticed that in my posting above I have incorrectly stated that disabling the SkeletonMecanim
component leaves Timeline updates active - actually these are disabled as well, so no Spine-animation related task remains.
Regarding your measurements:
CarrotPie a écritFully idle - there's 108 units in the scene. 8 units are not touched, 100 - is.
What do you mean by this sentence? What does "touched" mean?
CarrotPie a écritTried out in two modes, when minimum units are animated (idle) and when maximum.
What are "minimum" and "maximum" units? To me this means 0=minimum, and 108=all=maximum.
I assume that you mean that the units are animated in a minimal way (idle), vs animated in a more active way.
CarrotPie a écritAt first I used lists, but then as they are not needed moved on to an array of HashSets for a considerable improvement.
What do you use these Lists
and HashSets
for? It seems as if you've got some general problems going on with your activation/deactivation implementation if you gain 15fps from switching containers at such a small element count.
In general it would be helpful if you could phrase your sentences in a way that does not need to be interpreted.
What you could also do in your case instead of distributing the update across multiple frames is using the RenderExistingMesh
example component, found in Spine Examples\Scripts\Sample Components
. While it was created to re-render an existing mesh with an outlines-only shader, it should be very suitable for rendering identical idle animations.
If you have 108 units on screen and want to not move all of them in perfect sync, you could have e.g. 3-5 different master
animation objects and copy random ones to have 3-5 identical groups to break up repetition and feel more natural.
This would be the most cost-effective solution that I can currently think of for your scenario.