cc.game.once(cc.game.EVENT_ENGINE_INITED, function () {
cc.js.mixin(sp.Skeleton.prototype, {
update (dt) {
// if (CC_EDITOR) return;
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);
}
}
})
})
cocosCreator2.x版本中在编辑器里实时显示spine预览
162 浏览量
2024-05-28
19:06:39
上传
评论
收藏 663B ZIP 举报
![avatar](https://profile-avatar.csdnimg.cn/1e1a9b6b42894cf88598baa260d04c6a_weixin_42253927.jpg!1)
爱你的魔
- 粉丝: 25
- 资源: 3
最新资源
- python实现基于深度学习高性能中文车牌识别(源码+数据)
- 用于MATLAB的bossdevice API
- docker配置使用,很值得学习的笔记
- Python实现基于 opencv 和 tensorflow 的车牌识别项目(源码+数据).zip
- TM1629B SOP-32封装 LED驱动控制专用电路 深圳市可芯电子有限公司.pdf
- qt-everywhere-src-5.15.0
- Vue3+Element Plus+pinia+ts实现的后台管理系统
- python爬取北、上、广租房信息(高分课程设计)
- Flutter Widget魔法:构建绚丽界面的秘诀
- 基于SSM的学生智能选课系统(源代码+数据库+文档)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)