16{
17 if (MeshComp ==
nullptr ||
AudioTag.IsValid() ==
false)
18 {
19 return;
20 }
21
22 AActor* OwnerActor = MeshComp->GetOwner();
23 if (OwnerActor == nullptr)
24 {
25#if WITH_EDITORONLY_DATA
26 TryPlayPreviewAudio(MeshComp);
27#endif
28 return;
29 }
30
31 TArray<UAudioEmitterComponent*> AudioTagComponents;
32 OwnerActor->GetComponents<UAudioEmitterComponent>(AudioTagComponents);
33
34 if (
bDebugLog && AudioTagComponents.IsEmpty())
35 {
36 LOG_WARNING(LogCK,
"AudioTagComponent 없음. Owner: %s, AudioTag: %s", *OwnerActor->GetName(), *
AudioTag.ToString());
37 }
38
39 for (UAudioEmitterComponent* AudioTagComponent : AudioTagComponents)
40 {
41 if (AudioTagComponent == nullptr)
42 {
43 continue;
44 }
45
46 if (AudioTagComponent->PlayAudioTag(
AudioTag))
47 {
48 return;
49 }
50 }
51
52#if WITH_EDITORONLY_DATA
53 if (TryPlayPreviewAudio(MeshComp))
54 {
55 return;
56 }
57#endif
58
60 {
61 LOG_WARNING(LogCK,
"AudioTag 재생 실패. Owner: %s, ComponentCount: %d, AudioTag: %s", *OwnerActor->GetName(), AudioTagComponents.Num(), *
AudioTag.ToString());
62 }
63}
#define LOG_WARNING(Category, Format,...)
Definition CK_UE.h:39
bool bDebugLog
Definition AnimNotify_PlayAudioTag.h:31