1.预制体脚本,点击预制体按钮,更换图片
@property(cc.Label)
txt: cc.Label = null;
@property(cc.Button)
btn:cc.Button = null
public et: cc.EventTarget = null;
private index = null
private picture = null
changeMess(i,data){
var self = this
console.log("data====",data)
self.txt.string = data.name
self.index = i
self.picture =data.picture
}
onBtnClick(){
var self = this
this.et.emit('mess', { id:self.index ,picture:self.picture})
}
onLoad(){