callFunc 和 repeat 無法一起使用?html5

鄙人嘗試學習使用 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) {

    // },
});

试了一下貌似没法重现你的问题,方便的话提供一个 demo 把

我也遇到了这个问题

IOS平台 callFunc中嵌套(或递归)使用其他Action 有概率会执行不下去

你好 我已經將 項目 打包 並共享到 google drivers
這是連接地址 https://drive.google.com/file/d/0BzBTagdHxViwU1BlQlk4Z2s4Q1U/view?usp=sharing
壓縮包中的 TestCocos 是項目代碼 (runAction 的代碼 在 Script/Lucifer.js 中)
壓縮包中 bin 是我build的 web目標 (bin/run.bat 會開啓一個 工作在 :9090 的http服務器以便 運行 deamon)

還有 我已經將 cocos creator版本 更新到最新的 1.6.1 依然存在此問題

谢谢反馈,问题已经修复了

https://github.com/cocos-creator/engine/pull/1965

主要原因是嵌套的 sequence 被 repeat 时,会被当作 reversed mode 来执行一些逻辑导致的

能幫上忙 是在下的榮幸
cocos 提供了一個不錯的 遊戲開發環境 我也很感激 cocos團隊的貢獻
一直希望 開源社區中 能有更多華人的優秀項目

1赞