UNPKG

@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.41 kB
import{c as e,d as t}from"./KHR_interactivity-CKt1TdMW.esm.min.js";import{b as s,R as o}from"./index-Bw2N6w1y.esm.min.js";import"./declarationMapper-13w1YGqM.esm.min.js";import"./objectModelMapping-DX92iJ8M.esm.min.js";class n extends e{constructor(e){super(e),this.config=e,this.initPriority=1;for(const e in this.config.eventData)this.registerDataOutput(e,this.config.eventData[e].type)}_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 o=s.add((t=>{const s=Object.keys(t);for(const o of s)this.getDataOutput(o)?.setValue(t[o],e);this._execute(e)}));e._setExecutionVariable(this,"_eventObserver",o)}_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}getClassName(){return"FlowGraphReceiveCustomEventBlock"}}o("FlowGraphReceiveCustomEventBlock",n);export{n as FlowGraphReceiveCustomEventBlock}; //# sourceMappingURL=flowGraphReceiveCustomEventBlock-B1DtpOVl.esm.min.js.map