Skip to content

Instantly share code, notes, and snippets.

@onionmk2
Created June 6, 2017 18:07
Show Gist options
  • Save onionmk2/f590eb8535a133f7a15321706ce87a4b to your computer and use it in GitHub Desktop.
Save onionmk2/f590eb8535a133f7a15321706ce87a4b to your computer and use it in GitHub Desktop.
var animator = GetComponent<Animator>();
var layer = animator.GetLayerIndex("Face");
// 戻り値がコレクションなのと、型がAnimatorClipInfoである(AnimationClipInfoではない)のに注意
AnimatorClipInfo[] clips = animator.GetCurrentAnimatorClipInfo(layer);
foreach (var c in clips)
{
print(c.clip.name + " : weight " + c.weight);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment