animatingInEditMode这个你咋发现的。。搜了一下源码没搜到这个值
调试进去一步一步看
大佬能教下你这该怎么处理不?ccc萌新没干过这种操作
我按照你的pr改了一下,也build了,但是并没有生效,不知道什么原因 cocos版本2.4.4
if (CC_EDITOR) {
// 重写update方法 达到在编辑模式下 自动播放动画的功能
sp.Skeleton.prototype['update'] = function (dt) {
if (CC_EDITOR) {
cc['engine']._animatingInEditMode = 1;
cc['engine'].animatingInEditMode = 1;
}
if (this.paused) return;
dt *= this.timeScale * sp['timeScale'];
if (this.isAnimationCached()) {
// Cache mode and has animation queue.
if (this._isAniComplete) {
if (this._animationQueue.length === 0 && !this._headAniInfo) {
let frameCache = this._frameCache;
if (frameCache && frameCache.isInvalid()) {
frameCache.updateToFrame();
let frames = frameCache.frames;
this._curFrame = frames[frames.length - 1];
}
return;
}
if (!this._headAniInfo) {
this._headAniInfo = this._animationQueue.shift();
}
this._accTime += dt;
if (this._accTime > this._headAniInfo.delay) {
let aniInfo = this._headAniInfo;
this._headAniInfo = null;
this.setAnimation(0, aniInfo.animationName, aniInfo.loop);
}
return;
}
this._updateCache(dt);
} else {
this._updateRealtime(dt);
}
}
}
把这段代码放在任意脚本里面就可以
9赞
dragon动画怎么在浏览器中预览啊?
这个不清楚… 我这个就是按照楼主那个pr修改的 只是这写不用重写build引擎而已…
直接放到脚本的update函数里吗
放任意脚本 不要在onload udpate函数里面 放在最外面
可以 多谢大哥
如何编译引擎看官方这里 https://docs.cocos.com/creator/manual/zh/advanced-topics/engine-customization.html?h=引擎
gulp build 后 用这个定制
2赞
感谢,先收藏,好麻烦啊
2.4.4版本可以使用,太牛了,开发起来太方便了,必须赞一个!!!
2.4.2报错:
操作:
每次切换pfefab都会提示这个错误
可以了,谢谢