我的封装函数缺少一个变量?

问题描述 投票:0回答:1

由于我遇到了一个奇特的错误,我决定这样封装一个函数来解决上述错误。

UFUNCTION()         
void OnBoxOverlapWrapper(UPrimitiveComponent* /*ignored*/, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherIndex, bool bFromSweep, const FHitResult & SweepResult)
{
    OnBoxOverlap(OtherActor, OtherComp, OtherIndex, bFromSweep, SweepResult);
}

然而,当我试图编译我的代码时, 设置OnBoxOverlapWrapper的那行产生了这样的结果: Error: Missing variable name. 这是唯一一次在函数中声明了包装器,所以这不应该发生。特别奇怪的是,当我在另一个函数中使用类似的包装器时,它没有产生这样的错误。

UFUNCTION()
void OnBoxEndOverlapWrapper(UPrimitiveComponent* /*ignored*/ AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherIndex)
{
    OnBoxEndOverlap(OtherActor, OtherComp, OtherIndex);
} //this code does not produce an error

这到底是怎么回事?

c++ unreal-engine4
1个回答
1
投票

原来你需要为这个函数写一个体 OnBoxOverlap 职能

© www.soinside.com 2019 - 2024. All rights reserved.