게임엔진/Unreal
[Unreal] 애니메이션 이벤트 관련 / Notify 및 NotifyState
ShovelingLife
2022. 10. 17. 22:12
두 가지의 Notify 즉 메시지가 존재하는데, 이건 애니메이션 내에서 설정이 가능하다 이 둘의 가장 큰 차이점은 AnimNotify는 일회성이고 AnimNotifyState는 시작 (Begin), 진행 중일 때 (Tick) 그리고 끝날 때 (End) 각각 다른 이벤트를 처리하도록 설정할 수 있다는 점이다.
UAnimNotify / Super:: 해서 부모 클래스 오버라이딩 함수 호출 생략
UE_DEPRECATED(5.0, "Please use the other Notify function instead")
virtual void Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation);
virtual void Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference);
void UEndAimAnimNotify::Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference)
{
GEngine->AddOnScreenDebugMessage(8, 1.f, FColor::Red, "Aim end");
}
UAnimNotifyState / Super:: 필수
UE_DEPRECATED(5.0, "This function is deprecated. Use the other NotifyBegin instead.")
virtual void NotifyBegin(USkeletalMeshComponent * MeshComp, UAnimSequenceBase * Animation, float TotalDuration);
UE_DEPRECATED(5.0, "This function is deprecated. Use the other NotifyTick instead.")
virtual void NotifyTick(USkeletalMeshComponent * MeshComp, UAnimSequenceBase * Animation, float FrameDeltaTime);
UE_DEPRECATED(5.0, "This function is deprecated. Use the other NotifyEnd instead.")
virtual void NotifyEnd(USkeletalMeshComponent * MeshComp, UAnimSequenceBase * Animation);
virtual void NotifyBegin(USkeletalMeshComponent * MeshComp, UAnimSequenceBase * Animation, float TotalDuration, const FAnimNotifyEventReference& EventReference);
virtual void NotifyTick(USkeletalMeshComponent * MeshComp, UAnimSequenceBase * Animation, float FrameDeltaTime, const FAnimNotifyEventReference& EventReference);
virtual void NotifyEnd(USkeletalMeshComponent * MeshComp, UAnimSequenceBase * Animation, const FAnimNotifyEventReference& EventReference);
void UPlayerAnimNotifyState::NotifyBegin(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, float TotalDuration, const FAnimNotifyEventReference& EventReference)
{
Super::NotifyBegin(MeshComp, Animation, TotalDuration);
}
void UPlayerAnimNotifyState::NotifyEnd(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference)
{
Super::NotifyEnd(MeshComp, Animation, EventReference);
}