Closed kodra-dev closed 11 months ago
You could iterate through all the states on that layer like this:
var layer = Animancer.Layers[0];
var count = layer.ChildCount;
for (int i = 0; i < count; i++)
{
var state = layer.GetChild(i);
state.Weight = state.TargetWeight;
}
I see. Works like a charm!
For example:
var stateB = Play(another_clip, fade_duration=10)
, so now it's fading out state A and fading in state B.I tried to set
But then A and B both have weight of 1 and I don't want that. I'd like to set B's "normalize weight" to 1, in other words all the other states should adjust their weights accordingly.
Of course in this simple case I could do:
But what if I don't have a reference to state A? What if there are more than one existing states?