64 lines
1.4 KiB
JavaScript
64 lines
1.4 KiB
JavaScript
|
|
/******************************************************************
|
||
|
|
* Copyright(C) 2019 - 2020 Nx Studio
|
||
|
|
*
|
||
|
|
* 道具图标 --- 发光扩展
|
||
|
|
*
|
||
|
|
*
|
||
|
|
******************************************************************/
|
||
|
|
|
||
|
|
const ItemBase = require( "cmp.item.base" );
|
||
|
|
const FxSpine = require( "nx.fx.spine" );
|
||
|
|
|
||
|
|
cc.Class( {
|
||
|
|
|
||
|
|
extends: ItemBase,
|
||
|
|
|
||
|
|
properties: {
|
||
|
|
|
||
|
|
spGlow: { default: null, type: FxSpine },
|
||
|
|
cmpIcon: { default: null, type: cc.Node },
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
// 置空
|
||
|
|
setEmpty: function() {
|
||
|
|
|
||
|
|
this._super();
|
||
|
|
|
||
|
|
if( this.spGlow ) {
|
||
|
|
this.spGlow.stop();
|
||
|
|
}
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
// 发光显示
|
||
|
|
glowShow: function() {
|
||
|
|
|
||
|
|
if( this.spGlow ) {
|
||
|
|
this.spGlow.action( "action", false );
|
||
|
|
}
|
||
|
|
nx.tween.delayFadeIn( this.cmpIcon, "", 0.3, 0.2, null, 255, 180 );
|
||
|
|
},
|
||
|
|
|
||
|
|
// 设置阵营
|
||
|
|
setCamp: function( _camp ) {
|
||
|
|
|
||
|
|
if ( !this.imgLT ) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
let cfg = game.configs.partner_data.data_partner_base[this.info.bid];
|
||
|
|
if( cfg ){
|
||
|
|
let career = game.configs.partner_data.data_partner_base[this.info.bid].type;
|
||
|
|
if( career ){
|
||
|
|
let sf = cc.path.join( "coms/images/career" + career );
|
||
|
|
nx.gui.setSpriteFrame( this.imgLT, "", sf );
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
|
||
|
|
} );
|