반응형
AnimNofity 혹은 AnimNotifyState에서 "USkeletalMeshComponent* MeshComp"를 파라미터로 넘겨 받는다.
virtual void Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference) override;
virtual void NotifyBegin(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, float TotalDuration, const FAnimNotifyEventReference& EventReference) override;
virtual void NotifyTick(USkeletalMeshComponent * MeshComp, UAnimSequenceBase * Animation, float FrameDeltaTime, const FAnimNotifyEventReference& EventReference) override;
virtual void NotifyEnd(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference) override;
다음은 에디터 관련 코드에서도 USkeletalMeshComponent를 얻오는 샘플 코드 입니다.
void UAnimNotifyState_FX::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
#if WITH_EDITORONLY_DATA
Super::PostEditChangeProperty(PropertyChangedEvent);
const FName PropertyName = (PropertyChangedEvent.Property ? PropertyChangedEvent.Property->GetFName() : NAME_None);
const USkeletalMeshComponent* EditorSkeletalMeshComp = nullptr;
for (TObjectIterator<USkeletalMeshComponent> It; It; ++It)
{
const USkeletalMeshComponent* SkeletalComp = *It;
if (SkeletalComp == nullptr || SkeletalComp->GetOwner() == nullptr)
continue;
if (SkeletalComp->GetOwner()->GetName().Contains(TEXT("AnimationEditorPreviewActor")))
{
EditorSkeletalMeshComp = SkeletalComp;
}
}
if(EditorSkeletalMeshComp == nullptr)
return;
if (PropertyChangedEvent.MemberProperty->GetName().Equals(TEXT("FxTransformDataContainer")))
{
...
}
#endif
}
'게임 개발 > Unreal Engine' 카테고리의 다른 글
[UE] Control Rig 게임 실행중 디버깅 콘솔 명령어 (0) | 2023.01.19 |
---|---|
[UE] Unreal Engine 에디터 커스텀 관련 링크 (0) | 2023.01.19 |
[UE] Unreal Engine 현지화 - UI 현지화 작업 (0) | 2023.01.14 |
[UE] Unreal Engine 현지화 - 스트링 테이블(String Table) (0) | 2023.01.14 |
[UE] Unreal Engine 현지화 - Localization Dashboard - Translation Editor로 번역 작업 하기 (0) | 2023.01.14 |