I'm aware of how SetAnimatorLayerWeight works, I'm looking for a way to iterate through all layers of my controller at runtime.
I've four layers and expect more, and need to update them at once, in essence, what I'm trying to do is something like this.
To clarify: The code below is boilerplate of what I'm trying to do.
void SetCurrentWeaponLayerWeight(int index)
{
_animator.SetLayerWeight(index, 1);
foreach(AnimatorLayer l in Animator.Layers)
{
if (l.index != index)
_animator.SetLayerWeight(l.index, 0);
}
}