如图B脚本:我需要调用 blockType 这个变量
public init(_type) {
var blockType = _type
this.node.getComponent(cc.Sprite).spriteFrame = this.spf_block[blockType]
}
我要在A脚本中调用它:
var num_type_touch = children[i_tounch].getComponent(‘block’).blockType
但是调用出来的是未定义!

请问有人能给我解答吗?谢谢了。


