假如有节点A和节点B,节点A下挂了AScript脚本,节点B下挂了BScript脚本。现在要在AScript里面调用BScript里面的方法test。
GameObject.Find("B").GetComponent<BScript>().test();
假如有节点A和节点B,节点A下挂了AScript脚本,节点B下挂了BScript脚本。现在要在AScript里面调用BScript里面的方法test。
GameObject.Find("B").GetComponent<BScript>().test();