Tencent / puerts

PUER(普洱) Typescript. Let's write your game in UE or Unity with TypeScript.
Other
5.08k stars 707 forks source link

[UE] Bug: NewMap(UE.BuiltinString, UE.BuiltinFloat) 作为函数参数传入蓝图函数,所有value赋值为0.000 #1775

Closed ZhouXinyu001 closed 4 months ago

ZhouXinyu001 commented 4 months ago

前置阅读 | Pre-reading

Puer的版本 | Puer Version

v1.0.6p1

UE的版本 | UE Version

5.2

发生在哪个平台 | Platform

win

错误信息 | Error Message

猜测是UE的蓝图Float为双精度,UE.BuiltinFloat 为单精度 (帮忙确认一下) 导致NewMap(UE.BuiltinString, UE.BuiltinFloat) 无法转换成 蓝图中的Map((String, Float) image

问题重现 | Bug reproduce

TS代码:
const tMap = UE.NewMap(UE.BuiltinString, UE.BuiltinFloat);
tMap.Set('a', 1.1 );
tMap.Set('b', 2.2);
component.Test(tMap)

蓝图中的Test函数 image

运行时蓝图断点: NewParam: { a: 0.000, b: 0.000 }

chexiongsheng commented 4 months ago

5以后的蓝图的float改为double了:https://github.com/Tencent/puerts/issues/712 不过C++写的UFunction那还有float,UE.BuiltinFloat还得保留并保持为float类型。 可以新增一个UE.BuiltinDouble

chexiongsheng commented 4 months ago

你试试用UE.NewMap(UE.BuiltinString, UE.BuiltinDouble);

ZhouXinyu001 commented 4 months ago

感谢更新~