[LayaAir 2.0]2.0组件式开发Script间互相调用、通信的官方推荐方式是什么呢
比如Node1有Script1,Node2有Script2,在Script1中要调用Script2应该怎么处理呢?
1、Script2做成static instance?
2、findeNode(Node2).getComponent(Script2).doSomeThing()? 类似这样吗,Script中有findNode类似的api吗?
1、Script2做成static instance?
2、findeNode(Node2).getComponent(Script2).doSomeThing()? 类似这样吗,Script中有findNode类似的api吗?
要回复问题请先登录
1 个回复
dz5566
赞同来自:
this.owner.parent.parent.getChildByName("a").getChildByName("b");