Animator Length 구하기 API

Unity/찾아본것 2019. 4. 23. 17:55
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
private float GetAnimLength(string animName)
    {
        float time = 0;
        RuntimeAnimatorController ac = heroAnim.runtimeAnimatorController;
 
        for (int i = 0; i < ac.animationClips.Length; i++)
        {
            if (ac.animationClips[i].name == animName)
            {
                time = ac.animationClips[i].length;
            }
        }
 
        return time;
    }
cs


1
var length = this.GetAnimLength("attack_sword_01");
cs


: