const BridgeComponent = require( "bridge.component" ); const PlotDefine = require( "plot.define" ); const RoleController = require( "role_controller" ); const PPT = PlotDefine.PlotType; cc.Class({ extends: BridgeComponent, properties: { }, // 显示 onLoad: function() { // 视图监听 nx.bridge.plot.vbind( this, [ [ "step", this.onStepChanged.bind( this ) ], ] ); // 检查 }, // 关闭 onDestroy: function() { if( window.nx && nx.bridge.plot ){ // 视图解绑 nx.bridge.plot.vunbind( this ); } }, // 剧情改变 onStepChanged: function( _id ) { console.log( "当前的剧情相关" + JSON.stringify( nx.bridge.plot.stepData() ) ); nx.bridge.closePanel( "WndPlotGuide" ); let wname = "WndPlotGuide"; if( nx.dt.strNEmpty( wname ) ) { if ( nx.bridge.popups ) { nx.bridge.popups.clean(); } nx.bridge.createPanel( wname ); } }, });