var Global = require("Global"); cc.Class({ extends: cc.Component, properties: { normalBG: cc.Node, normalAni: sp.Skeleton, aniNode: cc.Node, _value: -1, _lineCount: 0, _bSpecial: false, }, // LIFE-CYCLE CALLBACKS: // onLoad () {}, setValue (_val, spineData, _bSpe) { this._value = _val; this._bSpecial = _bSpe; this.normalAni.skeletonData = spineData; this.showNormal(); }, resetCount() { this._lineCount = 0; this.showNormal(); }, addCount() { this._lineCount++; }, setCount(_val) { this._lineCount = _val; }, getCount() { return this._lineCount; }, showNormal() { this.normalBG.stopAllActions(); this.aniNode.active = false; this.normalAni.clearTracks(); this.normalAni.setAnimation(0, "a1", false); }, showLightAni() { if(this._lineCount <= 0) { this.showNormal(); return; } this.aniNode.active = true; this.normalBG.stopAllActions(); this.normalAni.clearTracks(); this.normalAni.setAnimation(0, "a2", false); }, showLightAniNoScale() { if(this._lineCount <= 0) { this.showNormal(); return; } this.aniNode.active = true; this.normalBG.stopAllActions(); }, showSpecialAni() { if(!this._bSpecial) { return; } this.normalBG.stopAllActions(); this.normalAni.clearTracks(); this.normalAni.setAnimation(0, "a2", false); }, // update (dt) {}, });