Parsing headers for try001Editor 2> Running UnrealHeaderTool "F:space-12 ry001 ry001.uproject" "F:space-12 ry001IntermediateBuildWin64 ry001EditorDevelopment ry001Editor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed 2> F:/space-12/try001/Plugins/ImageLoader/Source/ImageLoader/Classes/ImageLoaderComponent.h(20) : Missing '*' in Expected a pointer type
在定义下述函数的时候产生了上述错误
UFUNCTION(BlueprintCallable, Category = "HongGuang|ImageLoaderComponent") static void LoadImage(FString filepath, UTexture2D& _image);
原因是蓝图不能定义引用类型
如果要返回这个对象,那么我们可以采用返回指针的方式
UFUNCTION(BlueprintCallable, Category = "HongGuang|ImageLoaderComponent") static UTexture2D* LoadImage(FString filepath);
编译通过