[UE]Unreal中能否支持普通的结构体(非UStruct)通过UsingCppType和UsingContainer静态绑定并支持数组? #2231
watsonsong
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
目前只有内建的类型,以及UStruct支持绑定到TArray。对于纯C++的结构体的数组,无论TArray还是原生数组的绑定功能都比较缺失。静态绑定有什么办法可以扩展对这一类的支持么?
目前非UStruct的结构体绑定之后,无法通过UE.NewArray的方法来构造,按可以自行注册一个MakeArray的函数返回数组可以注册成功。
另外一种情况是对于一些UE的结构体,例如 FReportPlayedWithUser() = delete;。它没有实现比较运算符,这个可以通过自己实现一个自由函数的相等运算符解决。以及它的默认构造函数被delete掉了。
这种结构体在
RegisterTArray(FReportPlayedWithUser);的时候会产生错误。主要是Add, Contains和FindIndex这三方方法会要求用到默认的构造函数。Beta Was this translation helpful? Give feedback.
All reactions