Tencent / puerts

PUER(普洱) Typescript. Let's write your game in UE or Unity with TypeScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ZhouXinyu001 opened this issue · comments

前置阅读 | 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
}

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

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

感谢更新~