let scene = director.getScene();
let node = instantiate(this.target);
node.parent = scene;
node.setPosition(0,0,0);
无法设置父节点
node.parent为Node类型 scene为 Scene类型
let scene = director.getScene();
let node = instantiate(this.target);
node.parent = scene;
node.setPosition(0,0,0);
无法设置父节点
node.parent为Node类型 scene为 Scene类型
import { director } from ‘cc’;
// This will help you to get the Canvas node in scene
director.getScene().getChildByName(‘Canvas’);
谢谢—