invite_page/assets/scripts/infoMenu.js
2019-02-25 16:18:19 +08:00

41 lines
824 B
JavaScript

cc.Class({
extends: cc.Component,
properties: {
closeBtn: {
default: null,
type: cc.Node
},
submitBtn: {
default: null,
type: cc.Node
},
resultPrefab: {
default: null,
type: cc.Prefab
}
},
// LIFE-CYCLE CALLBACKS:
onLoad () {
let self = this;
this.closeBtn.on('click', function () {
self.node.removeFromParent(true);
});
this.submitBtn.on('click', function () {
self.showResultView();
})
},
start () {
},
// update (dt) {},
showResultView() {
let result = cc.instantiate(this.resultPrefab);
this.top.node.addChild(result, 11);
this.node.removeFromParent(true);
}
});