1、cc.tween(this.node).bezierTo(time,p1,p2,endp).start()。會把node弄到別的坐標(biāo),,我三個點(diǎn)的y軸都為負(fù),結(jié)束時發(fā)現(xiàn)為正了!!應(yīng)該使用?this.node.runAction(cc.bezierTo(time,[startP,centerP,endP]));這樣就是正確的。 但是不管cc.bezierTo還是runAction都沒有完成動畫時的事件回調(diào),目前只能采用 this.schedule(function() {
? ? ?// 這里的 this 指向 component
? ? ?this.doSomething();
?}, time, repeat, delay)的方式在動畫結(jié)束后執(zhí)行回調(diào)
2、剛才發(fā)布到微信時報錯:SyntaxError: Unexpected end of JSON input
百度了下現(xiàn)有的幾種方式都不對,后來猜測可能是我在Data類中設(shè)置了static 屬性的PlayerInfo類。之后把PlayerInfo也做成單例就沒報這個錯了。。
然后就是在讀取本地數(shù)據(jù)時:
var dataStr = cc.sys.localStorage.getItem(this.UserInfoKey);
var? data=JSON.parse(dataStr);
這樣寫在cocos中是沒問題的,但是在微信中就會報這個錯誤,需要提前檢查dataStr:
if(dataStr!=null && dataStr!=undefined && dataStr !=""){
? ? ? ? ? ? data=JSON.parse(dataStr);
}
這樣就沒問題了
奇怪的東西,,,記錄下。