假设有Prefab A,
A.js 为:
cc.Class({
extends: cc.Component,
properties: {
},
doSomething: function() {
},
});
在其他js中,如何调用到A.doSomething?
instantiate方法出来的对象貌似不行
假设有Prefab A,
A.js 为:
cc.Class({
extends: cc.Component,
properties: {
},
doSomething: function() {
},
});
在其他js中,如何调用到A.doSomething?
instantiate方法出来的对象貌似不行
nodeA.getComponent(‘A’).doSomething()
谢谢