层级不能改变 苦恼

创建一个Prefab预制体,代码去生成他的数量并设置坐标,但是他的层级是最高的,挡不住,求解

通过node.zIndex在prefab生成后设置顺序。

1赞

我也是同样的问题,请问解决了吗?

insertChild(child: Node, siblingIndex: number): void;

/**
!#en
Inserts a child to the node at a specified index.
!#zh
插入子节点到指定位置
@param child the child node to be inserted
@param siblingIndex the sibling index to place the child in

	@example 
	```js
	node.insertChild(child, 2);
	``` 
	*/
	insertChild(child: Node, siblingIndex: number): void;