鄙人嘗試學習使用 cocos creator 開發遊戲 發現使用 repeat 的同時 使用 callFunc
repeat 執行多次的化(參數大於1) 在第一次執行後 就會偏離原本的 軌道 而且執行的速度也不對
本地環境是 win7 64 creator1.5.1 firefox chrome 都有此問題 模擬器中 運行正常
在firefox中 控制檯 顯示了 Error: WebGL warning: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one. 的信息 chrome沒有任何信息反饋
下面時鄙人的 代碼
cc.Class({
extends: cc.Component,
properties: {
},
// use this for initialization
onLoad: function () {
var node = this.node;
var finished = cc.callFunc(function(target, score) {
console.log(score);
}, this, 100);
var action = cc.sequence(
cc.sequence(
cc.moveBy(1, 200, 0),
cc.moveBy(1, -200, 0)
).repeat(5)
,finished
);
node.runAction(action);
},
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});