Last active
January 22, 2020 15:56
-
-
Save felixprojekt/47cd5fdd02ef6bd40bf4a2782a883a85 to your computer and use it in GitHub Desktop.
Get Animator clips lengths of current gameObject in Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ClipsLength : MonoBehaviour | |
void Start() | |
{ | |
AnimationClip[] clips = gameObject.GetComponent<Animator>().runtimeAnimatorController.animationClips; | |
foreach(AnimationClip clip in clips) | |
{ | |
Debug.Log(clip.name); | |
Debug.Log(clip.length); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment