版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/themagickeyjianan/article/details/86259629
1)直接根据Canvas下面的查找
cc.find("Canvas/btn_rope").zIndex = 2000;
cc.find("Canvas/rope").zIndex = 1000;
2)根据组件节点查找子节点
this.node.getChildByName("xxx")
3)查找game_scene组件
this.game_scene = cc.find("Canvas").getComponent("game_scene");