강의

멘토링

커뮤니티

Inflearn Community Q&A

coffeecat02130592's profile image
coffeecat02130592

asked

[Unity Level Up!] Modularly Developing Skill System

Multi Layered State Machine

deadstate 질문입니다

Resolved

Written on

·

145

·

Edited

0

deadstate에서 에니메이션이 다 재생된후 destroy를 할려면 어떻게 해야할까요
따로 함수를 만들어 애니메이션 트리거로 destroy를 하고 있는데 더 나은 방법이 있을까 해서 질문해봅니다

unitymodules

Answer 1

0

Developer G님의 프로필 이미지
Developer G
Instructor

수강해주셔서 감사합니다.

Animation에서 Tirgger하는 방법 외에는 Animator를 통해서 Dead Animation이 끝났는지 확인하는 방법이 있습니다.

DeadState.cs
public override void Update()
{
var animationInfo = Entity.Animator.GetCurrentAnimatorStateInfo(0);
// normailzedTime(=PlayTime) 0 ~ 1
if (animationInfo.normalizedTime >= 1f)
IsAnimationEnded = true;
}

감사합니다.

coffeecat02130592's profile image
coffeecat02130592

asked

Ask a question