Parsing headers for try001Editor
2>           Running UnrealHeaderTool "F:\space-12\try001\try001.uproject" "F:\space-12\try001\Intermediate\Build\Win64\try001Editor\Development\try001Editor.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);

编译通过

 

相关文章:

  • 2021-12-11
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-28
  • 2021-09-23
  • 2022-12-23
  • 2021-07-22
  • 2021-04-12
  • 2021-05-12
  • 2022-12-23
相关资源
相似解决方案