Files
CocosCreatorTutorial/RollingNumber/assets/script/test.js
2019-11-16 19:01:23 +08:00

46 lines
561 B
JavaScript

cc.Class({
extends: cc.Component,
properties: {
rolling: cc.Node,
editBox: cc.EditBox,
},
onLoad() {
this.rollingNubmer = this.rolling.getComponent('RollingNumber');
},
registerEvent() {
},
init(data) {
},
onEventClicked() {
let number = this.editBox.string;
console.log(number);
this.rollingNubmer.init(number * 1);
},
update(dt) {
},
onEnable() {
this.registerEvent();
},
onDisable() {
this.offEvent();
},
offEvent() {
cc.emitter.offThis(this);
},
onDestroy() {
}
});