1 line
6.3 KiB
JavaScript
1 line
6.3 KiB
JavaScript
window.__require=function s(i,t,c){function n(p,e){if(!t[p]){if(!i[p]){var u=p.split("/");if(u=u[u.length-1],!i[u]){var h="function"==typeof __require&&__require;if(!e&&h)return h(u,!0);if(o)return o(u,!0);throw new Error("Cannot find module '"+p+"'")}p=u}var r=t[p]={exports:{}};i[p][0].call(r.exports,function(s){return n(i[p][1][s]||s)},r,r.exports,s,i,t,c)}return t[p].exports}for(var o="function"==typeof __require&&__require,p=0;p<c.length;p++)n(c[p]);return n}({mainPanel:[function(s,i,t){"use strict";cc._RF.push(i,"ed5dbgDUldJD6v8x9dWSeg1","mainPanel");var c,n=this&&this.__extends||(c=function(s,i){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(s[t]=i[t])})(s,i)},function(s,i){function t(){this.constructor=s}c(s,i),s.prototype=null===i?Object.create(i):(t.prototype=i.prototype,new t)}),o=this&&this.__decorate||function(s,i,t,c){var n,o=arguments.length,p=o<3?i:null===c?c=Object.getOwnPropertyDescriptor(i,t):c;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(s,i,t,c);else for(var e=s.length-1;e>=0;e--)(n=s[e])&&(p=(o<3?n(p):o>3?n(i,t,p):n(i,t))||p);return o>3&&p&&Object.defineProperty(i,t,p),p};Object.defineProperty(t,"__esModule",{value:!0});var p=cc._decorator,e=p.ccclass,u=p.property,h=function(s){function i(){var i=null!==s&&s.apply(this,arguments)||this;return i.ndCloud=null,i.spine=null,i.ndBuildList=[],i._posList=[],i._currPosIndex=-1,i._buildData=[],i._currBuildIndex=0,i._isAniming=!1,i._isCloudAnim=!1,i._step=1,i._cb=null,i._diffX=33,i._diffY=17,i}return n(i,s),i.prototype.onLoad=function(){this.spine.node.x=225,this.spine.node.y=50,this._posList.push(cc.v2(1,0)),this._posList.push(cc.v2(1,0)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(-1,0)),this._posList.push(cc.v2(-1,0)),this._posList.push(cc.v2(-1,0)),this._posList.push(cc.v2(-1,0)),this._posList.push(cc.v2(-1,0)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(-1,0)),this._posList.push(cc.v2(-1,0)),this._posList.push(cc.v2(-1,0)),this._posList.push(cc.v2(-1,0)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(-1,0)),this._posList.push(cc.v2(-1,0)),this._posList.push(cc.v2(-1,0)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(1,0)),this._posList.push(cc.v2(1,0)),this._posList.push(cc.v2(1,0)),this._posList.push(cc.v2(1,0)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(0,-1)),this._posList.push(cc.v2(1,0)),this._posList.push(cc.v2(1,0)),this._posList.push(cc.v2(1,0)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(1,0)),this._posList.push(cc.v2(1,0)),this._posList.push(cc.v2(1,0)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._posList.push(cc.v2(0,1)),this._buildData.push({index:55,pos:cc.v2(159,84)}),this._buildData.push({index:8,pos:cc.v2(324,-35)}),this._buildData.push({index:16,pos:cc.v2(60,-1)}),this._buildData.push({index:22,pos:cc.v2(60,-103)}),this._buildData.push({index:31,pos:cc.v2(-237,-52)}),this._buildData.push({index:35,pos:cc.v2(-303,16)}),this._buildData.push({index:44,pos:cc.v2(-204,169)}),this._buildData.push({index:50,pos:cc.v2(-6,169)}),this.spine.node.active=!1,this.ndCloud.active=!1,cc.mainAnim=this},i.prototype.onDestroy=function(){cc.mainAnim=null},i.prototype.setCurrPos=function(s){var i=s%this.ndBuildList.length;this.initData(i)},i.prototype.setData=function(s,i){this._isAniming||(this._step=s,this._cb=i,this.startAnim())},i.prototype.cloudAnim=function(s){var i=this;void 0===s&&(s=0),this._isCloudAnim||(this._isCloudAnim=!0,this.ndCloud.runAction(cc.sequence(cc.spawn(cc.fadeOut(1),cc.scaleTo(1,1.5)),cc.callFunc(function(){i._isCloudAnim=!1,i.initData(s||0)}))))},i.prototype.initData=function(s){(s<0||s>this._buildData.length-1)&&(s=0),this._currBuildIndex=s,this.spine.node.position=this._buildData[this._currBuildIndex].pos,this._currPosIndex=this._buildData[this._currBuildIndex].index,this.spine.node.active=!0,this.spine.setAnimation(0,"animation1",!0)},i.prototype.move=function(s,i){var t=this;if(void 0===i&&(i=null),!this._isAniming){this._isAniming=!0,this.spine.setAnimation(0,"animation2",!0);var c=function(){if(s<=0)return t.spine.setAnimation(0,"animation1",!0),t._isAniming=!1,void(null==i||i());s--,t._currPosIndex++,t._currPosIndex>t._posList.length-1&&(t._currPosIndex=0);var n=t._posList[t._currPosIndex];t._moveAnim(n).then(c)};c()}},i.prototype._moveAnim=function(s){var i=this;return new Promise(function(t){var c,n=0;if(0==s.x?(c=s.y>0?i._diffX:-i._diffX,n=s.y>0?-i._diffY:i._diffY):(n=s.x>0?i._diffY:-i._diffY,c=s.x>0?i._diffX:-i._diffX),i.spine.node.runAction(cc.sequence(cc.moveBy(.2,cc.v2(c,n)),cc.callFunc(function(){null==t||t(!0)}))),0!=s.x){var o=i.spine.node.scaleX;i.spine.node.scaleX=s.x>0?-Math.abs(o):Math.abs(o)}})},i.prototype.startAnim=function(){var s=this;if(!this._isAniming&&!this._isCloudAnim){var i=function(){if(s._step<=0){s._isAniming=!0;var t=s.ndBuildList[s._currBuildIndex];return t.opacity=0,void t.runAction(cc.sequence(cc.fadeIn(.25),cc.delayTime(.2),cc.fadeOut(.25),cc.callFunc(function(){var i;s._isAniming=!1,null===(i=s._cb)||void 0===i||i.call(s,s._currBuildIndex)})))}s._step--,s._currBuildIndex++,s._currBuildIndex>s._buildData.length-1&&(s._currBuildIndex=0);var c,n=s._buildData[s._currBuildIndex];c=n.index<s._currPosIndex?n.index+(s._posList.length-s._currPosIndex):n.index-s._currPosIndex,s.move(c,i)};i()}},o([u(cc.Node)],i.prototype,"ndCloud",void 0),o([u(sp.Skeleton)],i.prototype,"spine",void 0),o([u([cc.Node])],i.prototype,"ndBuildList",void 0),o([e],i)}(cc.Component);t.default=h,cc._RF.pop()},{}]},{},["mainPanel"]); |