/****************************************************************** * Copyright(C) 2019 - 2020 Nx Studio * * 召唤页基类 * * 2018.05.18 ******************************************************************/ const BridgeComponent = require( "bridge.component" ); const EmptyBG = ""; cc.Class( { extends: BridgeComponent, properties: { nodBG: { default: null, type: cc.Node }, }, // 置空 setEmpty: function() { this.sumId = 0; nx.gui.setSpriteFrame( this.nodBG, "", EmptyBG ); }, // 设置召唤库编号 bindId: function( _id ) { // 置空 if( !nx.dt.numPositive( _id, false ) ) { this.setEmpty(); return false; } this.sumId = _id; return true; }, // 更新数据 updateData: function( _data ) { }, // 召唤 reqSummon: function( _type, _times, _args ) { if( !this.cmpRoot ) { nx.error( "尚未绑定召唤主界面!" ); return; } this.cmpRoot.onReqSummon( this.sumId, _type, _times, _args ); }, } );