如何将数字解析为文本

How to parse number to text

假设我有一个代表运行时补丁输出的 X 值,它是一个数字,表示自效果开始以来经过的时间。我如何将 X 值显示为二维文本?

我尝试使用 Unpack 补丁并将值发送到脚本,然后设置文本,但对我没有任何作用

我希望文本显示数字值,而 运行 效果

根据documentation你可以使用ScalarSignal格式方法:

const Patches = require('Patches');

const numberFormat = 'Time: {0}';
const number = Patches.getScalarValue('number');

Patches.setStringValue('value', number.format(numberFormat));

创建适当的脚本值:

和 link 补丁编辑器中的适当节点: