puerts icon indicating copy to clipboard operation
puerts copied to clipboard

[UE] 怎样在ts里写函数,然后让蓝图去调用?

Open DZTZ opened this issue 2 years ago • 2 comments

文档和demo都看过了,没看到有相关的示例 在C++中是继承UBlueprintFunctionLibrary 然后 UFUNCTION(BlueprintCallable, Category = "分类") static int QuanJu(int a, int b); 这样就能在蓝图调用了,

但是用puerts 无从下手,完全不知道怎么写, 能否再给出一点相关的示例? 如果现有的demo已经有相关示例了,能在这里告诉我一下是那个吗,可能我没看明白 谢谢!

DZTZ avatar Nov 18 '22 10:11 DZTZ

例子文档都有

chexiongsheng avatar Nov 18 '22 11:11 chexiongsheng

ts用继承引擎类继承UBlueprintFunctionLibrary,回生成对应蓝图,蓝图就可以调用了 https://puerts.github.io/unreal/zhcn/uclass_extends

lzj10 avatar Feb 13 '23 12:02 lzj10