新手提问,${} 这个写法 ,我怎么不可以??

QQ截图20220113213746

用的是tab按钮上面的`
不是常用的双引号

1赞

`${this.name}` // 正确写法

而不是

'${this.name}' // 错误写法

也不是

"${this.name}" // 错误写法

5赞

你这也太细了

确实很细 :laughing:

请教:

let scene = director.getScene();
        let node = instantiate(this.target);

        node.parent = scene;
        node.setPosition(0,0,0);

无法设置父节点
node.parent为Node类型 scene为 Scene类型
用什么代替啊

scene.addChild(node)

谢谢,我试试啊

该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。