.h
DECLARE_DELEGATE(Close);
DECLARE_DELEGATE(OpenFinished);
Close Action;
OpenFinished _OpenFinished;
UFUNCTION(BlueprintCallable)
void SetOpen();
UFUNCTION(BlueprintCallable)
void SetOpen(const OpenFinished& _actFinished);
.cpp
void ABaseView::SetOpen()
{
SetOpen((OpenFinished)nullptr);
}
void ABaseView::SetOpen(const OpenFinished & _actFinished)
{
if (!_actFinished.TryGetBoundFunctionName().IsNone())
{
_OpenFinished = _actFinished;
_OpenFinished.ExecuteIfBound();
}
}
我现在正在这样做。
将Close和OpenFinished的委托声明更改为 DECLARE_DYNAMIC_MULTICAST_DELEGATE导致E0077错误。我会 想要在蓝图中使用它,但是代表不断 错误。