Cocos-节点层级修改

1、2.x的版本的层级修改

 zIndex

 this..node.zIndex = 1;

 

2、3.0的时候是通过UITransform中的priority设置

2、3.1开始使用

setSiblingIndex
 this..node.setSiblingIndex(1);

 

具体的版变更,可以参考升级指南
https://docs.cocos.com/creator/manual/zh/release-notes/
 
posted @ 2022-09-21 13:56  jiaxin2015  阅读(1341)  评论(0)    收藏  举报