通过name去取,一层一层的:Laya.stage.getChildByName('root').getChildByName('scene').getChildByName('xxx');
通过var去取,直接var就是对象名就:Laya.stage.getChildByName('root').getChildByName('scene').xxx;
在子节点绑定的script的onEnbale() {}的时候就:self.xxx = Laya.stage.getChildByName('root').getChildByName('scene').xxx;
取好,就可以在这个script里面重复用了。
如果要调用其它script的方法,可以使用self.xxx._components[0].someFunc();
我这么用好使,但是可能不规范,最好还是问问官方。