@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.
36 lines (33 loc) • 1.57 kB
JavaScript
import { R as RegisterClass } from './index-FzOfPXLV.esm.js';
import { b as FlowGraphExecutionBlockWithOutSignal, g as getNumericValue } from './KHR_interactivity-Bmb38TjL.esm.js';
import { k as RichTypeFlowGraphInteger } from './declarationMapper-rcGCdcDP.esm.js';
import './objectModelMapping-CJnQ6at_.esm.js';
/**
* This block cancels a delay that was previously scheduled.
*/
class FlowGraphCancelDelayBlock extends FlowGraphExecutionBlockWithOutSignal {
constructor(config) {
super(config);
this.delayIndex = this.registerDataInput("delayIndex", RichTypeFlowGraphInteger);
}
_execute(context, _callingSignal) {
const delayIndex = getNumericValue(this.delayIndex.getValue(context));
if (delayIndex <= 0 || isNaN(delayIndex) || !isFinite(delayIndex)) {
return this._reportError(context, "Invalid delay index");
}
const timers = context._getGlobalContextVariable("pendingDelays", []);
const timer = timers[delayIndex];
if (timer) {
timer.dispose();
// not removing it from the array. Disposing it will clear all of its resources
}
// activate the out output flow
this.out._activateSignal(context);
}
getClassName() {
return "FlowGraphCancelDelayBlock" /* FlowGraphBlockNames.CancelDelay */;
}
}
RegisterClass("FlowGraphCancelDelayBlock" /* FlowGraphBlockNames.CancelDelay */, FlowGraphCancelDelayBlock);
export { FlowGraphCancelDelayBlock };
//# sourceMappingURL=flowGraphCancelDelayBlock-mCSQ7AYm.esm.js.map