원하는 애니메이션 클립의 재생시간을 얻어오기

public Animation anim;
Animation의 Component를 얻어온다
anim.GetClip("애니메이션 클립 파일 이름").length
print("run: " + anim.GetClip("run@loop").length);
print는 MonoBehaviour를 상속받아야 사용할 수 있다

애니메이션이 재생중인지 확인
print(anim.isPlaying);

https://docs.unity3d.com/kr/530/ScriptReference/Animation.html
'Unity > 수업 내용' 카테고리의 다른 글
| [Unity 2020.3] 10-20 MiniRPG 적 피격, 적 따라오기 (0) | 2021.10.20 |
|---|---|
| [Unity 2020.3] 10-19 MiniRPG 플레이어 공격, 적 피격 (0) | 2021.10.19 |
| [Unity 2020.3] MiniRPG 10-18 캐릭터 선택, 이동 (0) | 2021.10.19 |
| [Unity 2020.3] MiniRPG 기획 (0) | 2021.10.18 |
| [Unity 2020.3] Shooting Project 17일 작업물 (0) | 2021.10.18 |