Files
fc/dev/project/assets/Scripts/mod/summon/com/cmp.summon.page.js
T
2026-05-23 22:10:14 +08:00

62 lines
1.1 KiB
JavaScript

/******************************************************************
* 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 );
},
} );