| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- window.boxingManager = {
- // confs: [
- // {
- // top: {
- // time: 0.2,
- // timeScale: 3
- // },
- // mid: {
- // time: 2.6,
- // timeScale: 1
- // },
- // lower: {
- // time: 0.1,
- // timeScale: 3
- // },
- // },
- // {
- // top: {
- // time: 0.2,
- // timeScale: 3
- // },
- // mid: {
- // time: 2.2,
- // timeScale: 1
- // },
- // lower: {
- // time: 0.1,
- // timeScale: 3
- // }
- // },
- // {
- // top: {
- // time: 0.2,
- // timeScale: 3
- // },
- // mid: {
- // time: 2,
- // timeScale: 1
- // },
- // lower: {
- // time: 0.1,
- // timeScale: 3
- // }
- // },
- //
- // ],
- scheduleTimes : [3,1.5,1.25],
- num: 0,
- //奖励分数
- rewardScore : 10,
- setConf: function (num) {
- this.num = num;
- return this.confs[this.num];
- },
- getConf: function () {
- return this.confs[this.num];
- },
- setScheduleTimes: function (num) {
- this.num = num;
- return this.scheduleTimes[this.num];
- },
- getScheduleTimes: function () {
- // Log.info("到底是什么",this.num,this.scheduleTimes)
- return this.scheduleTimes[this.num];
- },
- }
- cc.Class({
- extends: cc.Component,
- properties: {
- },
- onLoad() {
- },
- endLoop: function () {
- },
- startLoop: function () {
- this.count = boxingManager.getScheduleTimes();
- this.callback = function () {
- if (this.count != boxingManager.getScheduleTimes()) {
- // 在第六次执行回调时取消这个计时器
- this.count = boxingManager.getScheduleTimes();
- this.unschedule(this.callback);
- this.startLoop();
- return;
- }
- // let time = new Date().getTime();
- // // console.log("相差时间 ",time-this.currld);
- // this.currld = time;
- this.doSomething();
- // this.startLoop();
- // this.count++;
- }
- this.schedule(this.callback, boxingManager.getScheduleTimes());
- },
- doSomething: function () {
- if (this.StartLoopListener) {
- this.StartLoopListener()
- }
- },
- start() {
- },
- setStartLoopListener(StartLoopListener){
- this.StartLoopListener = StartLoopListener;
- },
- update(dt) {
- },
- });
|