@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
3 lines (2 loc) • 1.82 kB
JavaScript
import{a as e,d as t}from"./KHR_interactivity-D4lwBSW9.esm.min.js";import{y as s,u as n}from"./index-BPURObVq.esm.min.js";import{g as i}from"./declarationMapper-D_filC93.esm.min.js";import"./objectModelMapping-ClgDmo5Q.esm.min.js";import"./spotLight.pure-5s2DDDIt.esm.min.js";class o extends e{constructor(e){super(e),this.config=e,this.initPriority=1;for(const e in this.config.eventData){const t=this.config.eventData[e],s="string"==typeof t.type?t.type:t.type?.typeName,n="function"==typeof t.type?.serialize?t.type:i(s);t.type=n,this.registerDataOutput(e,n)}}_preparePendingTasks(e){const s=e.configuration.coordinator.getCustomEventObservable(this.config.eventId);if(s&&s.hasObservers()&&s.observers.length>t.MaxEventsPerType)return void this._reportError(e,`FlowGraphReceiveCustomEventBlock: Too many observers for event ${this.config.eventId}. Max is ${t.MaxEventsPerType}.`);const n=s.add(t=>{const s=Object.keys(t);for(const n of s)this.getDataOutput(n)?.setValue(t[n],e);this._execute(e)});e._setExecutionVariable(this,"_eventObserver",n)}_cancelPendingTasks(e){const t=e.configuration.coordinator.getCustomEventObservable(this.config.eventId);if(t){const s=e._getExecutionVariable(this,"_eventObserver",null);t.remove(s)}else s.Warn(`FlowGraphReceiveCustomEventBlock: Missing observable for event ${this.config.eventId}`)}_executeEvent(e,t){return!0}serialize(e={}){super.serialize(e);const t={};for(const e in this.config.eventData)t[e]={type:this.config.eventData[e].type.typeName};e.config.eventData=t}getClassName(){return"FlowGraphReceiveCustomEventBlock"}}let r=!1;function a(){r||(r=!0,n("FlowGraphReceiveCustomEventBlock",o))}a();export{o as FlowGraphReceiveCustomEventBlock,a as RegisterFlowGraphReceiveCustomEventBlock};
//# sourceMappingURL=flowGraphReceiveCustomEventBlock-DCjupSgn.esm.min.js.map