mirror of
https://github.com/Leo501/CocosCreatorTutorial.git
synced 2026-09-06 00:58:18 +08:00
61 lines
892 B
JavaScript
61 lines
892 B
JavaScript
cc.Class({
|
|
extends: cc.Component,
|
|
|
|
properties: {
|
|
rolling: cc.Node,
|
|
rolling3: cc.Node,
|
|
editBox: cc.EditBox,
|
|
},
|
|
|
|
onLoad() {
|
|
this.rollingNumbmer = this.rolling.getComponent('RollingNumber3');
|
|
this.rollingNumber3 = this.rolling3.getComponent('RollingNumber3');
|
|
|
|
},
|
|
|
|
start() {
|
|
this.rollingNumbmer.init();
|
|
this.rollingNumber3.init();
|
|
},
|
|
|
|
registerEvent() {
|
|
|
|
},
|
|
|
|
init(data) {
|
|
|
|
},
|
|
|
|
onEventClicked() {
|
|
let number = this.editBox.string;
|
|
console.log(number);
|
|
this.rollingNumbmer.initResult([number * 1]);
|
|
|
|
},
|
|
|
|
onEventClicked2() {
|
|
let number = this.editBox.string;
|
|
console.log(number);
|
|
this.rollingNumber3.initResult([number * 1]);
|
|
},
|
|
|
|
update(dt) {
|
|
|
|
},
|
|
|
|
onEnable() {
|
|
this.registerEvent();
|
|
},
|
|
|
|
onDisable() {
|
|
this.offEvent();
|
|
},
|
|
|
|
offEvent() {
|
|
cc.emitter.offThis(this);
|
|
},
|
|
|
|
onDestroy() {
|
|
|
|
}
|
|
}); |