var Global = require("Global"); var GameProtocol = require("RaioGameProtocol"); cc.Class({ extends: cc.Component, editor: { menu: 'Game/Raio/Item' }, properties: { normalBG: cc.Node, normalAni: sp.Skeleton, aniNode: cc.Node, _value: -1, _lineCount: 0, _bSpecial: false, }, setValue (_val, spineData, _bSpe) { this._value = _val; this._bSpecial = _bSpe; this.normalAni.skeletonData = spineData; this._bNewOppr = false; this.node.scale = 1; if(this._bSpecial) { this.node.scale = 1.1; } this.showRolling(); }, getValue() { return this._value; }, resetCount() { this._lineCount = 0; this.showNormal(); }, addCount() { this._lineCount++; }, setCount(_val) { this._lineCount = _val; }, getCount() { return this._lineCount; }, showRolling() { this.normalBG.stopAllActions(); this.aniNode.active = false; this.normalAni.clearTracks(); this.normalAni.setAnimation(0, 'a0', false); }, showNormal() { if(this._bSpecial) {return;} this.normalBG.stopAllActions(); this.aniNode.active = false; this.normalAni.clearTracks(); this.normalAni.setAnimation(0, 'a1', true); }, resetShow() { this.node.opacity = 255; // this.showNormal(); }, resetCashShow() { if(!this._bSpecial) { this.showNormal(); return; } this._bNewOppr = false; this.aniNode.active = false; this.normalBG.stopAllActions(); this.normalAni.clearTracks(); this.normalAni.setAnimation(0, "a1", true); }, //cash中级动画 showLightAni(bPrizes) { if(!this._bSpecial) { this.showNormal(); return; } this._bNewOppr = true; this.aniNode.active = false; this.normalBG.stopAllActions(); this.normalAni.clearTracks(); this.normalAni.setAnimation(0, "a2", false); // if(!bPrizes) // this.normalAni.addAnimation(0, "a0", true); }, showNewPrizes(bPrizes) { if(!this._bSpecial) {return;} if(this._bNewOppr) { Global.print("showNewPrizes") this._bNewOppr = false; this.aniNode.active = false; this.normalBG.stopAllActions(); this.normalAni.clearTracks(); if(bPrizes) { this.normalAni.setAnimation(0, "a3", false); this.normalAni.addAnimation(0, "a1", true); }else{ this.normalAni.setAnimation(0, "a1", true); } // this.normalAni.setAnimation(0, "a3", false); // this.normalAni.addAnimation(0, "a1", true); } }, showEndPrizes() { if(!this._bSpecial) {return;} this.aniNode.active = true; let ani = this.aniNode.getComponent(sp.Skeleton); ani.clearTracks(); ani.setAnimation(0, 'a3', false); this.normalBG.stopAllActions(); this.normalAni.clearTracks(); this.normalAni.setAnimation(0, "a3", false); this.normalAni.addAnimation(0, "a4", true); }, goCashPrizes(bShow) { if(bShow) { this.node.opacity = 255; }else{ this.node.opacity = 85; } }, showNotPrizes() { this.node.opacity = 85; if(this._bSpecial) { this.normalAni.clearTracks(); this.normalAni.setAnimation(0, "a4", false); } }, showPrizes() { if(this._lineCount <= 0) { this.showNotPrizes(); return; } this.node.opacity = 255; this.aniNode.active = false; this.normalBG.stopAllActions(); this.normalAni.clearTracks(); this.normalAni.setAnimation(0, "a2", false); this.normalAni.addAnimation(0, "a1", true); }, playEffect(effName, needStop = false) { if(needStop) cc.vv.audioMgr.stopAllEffects(); cc.vv.audioMgr.playSFX(effName); }, // update (dt) {}, });