Open Eu4ng opened 1 year ago
Delegate에 등록할 함수는 UFUNCTION()메크로를 붙여야 합니다.
Delegate 선언
// MyComponent.h DECLARE_DYNAMIC_MULTICAST_DELEGATE(FDelegate); UCLASS() class MYGAME_API UMyComponent : public UActorComponent { GENERATED_BODY() ... UPROPERTY(BlueprintAssignable) FDelegate OnUpdate; ... } // MyComponent.cpp ... if(OnUpdate.IsBound()) { OnUpdate.Broadcast(); } ... // MyActor.cpp ... MyComponent->OnUpdate.AddDynamic(this, &AMyActor::Action); ...
Delegate 선언
참고 링크