c7c47aa9-67d0-42e3-bdaf-1f535f9edc63.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. "use strict";
  2. cc._RF.push(module, 'c7c47qpZ9BC472vH1Nfntxj', 'SkeletonExt');
  3. // libs/SkeletonExt.js
  4. "use strict";
  5. cc.game.once(cc.game.EVENT_ENGINE_INITED, function () {
  6. cc.js.mixin(sp.Skeleton.prototype, {
  7. update: function update(dt) {
  8. // if (CC_EDITOR) return;
  9. if (CC_EDITOR) {
  10. cc.engine._animatingInEditMode = 1;
  11. cc.engine.animatingInEditMode = 1;
  12. }
  13. if (this.paused) return;
  14. dt *= this.timeScale * sp.timeScale;
  15. if (this.isAnimationCached()) {
  16. // Cache mode and has animation queue.
  17. if (this._isAniComplete) {
  18. if (this._animationQueue.length === 0 && !this._headAniInfo) {
  19. var frameCache = this._frameCache;
  20. if (frameCache && frameCache.isInvalid()) {
  21. frameCache.updateToFrame();
  22. var frames = frameCache.frames;
  23. this._curFrame = frames[frames.length - 1];
  24. }
  25. return;
  26. }
  27. if (!this._headAniInfo) {
  28. this._headAniInfo = this._animationQueue.shift();
  29. }
  30. this._accTime += dt;
  31. if (this._accTime > this._headAniInfo.delay) {
  32. var aniInfo = this._headAniInfo;
  33. this._headAniInfo = null;
  34. this.setAnimation(0, aniInfo.animationName, aniInfo.loop);
  35. }
  36. return;
  37. }
  38. this._updateCache(dt);
  39. } else {
  40. this._updateRealtime(dt);
  41. }
  42. }
  43. });
  44. });
  45. cc._RF.pop();