UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

37 lines (36 loc) 754 B
"use strict"; import { NamedFunction1, NamedFunction2, NamedFunction3 } from "./_Base"; export class triggerFilter extends NamedFunction1 { static type() { return "triggerFilter"; } func(condition) { return condition; } asString(condition) { return `if(${condition}==false) { return }`; } } export class triggerTwoWaySwitch extends NamedFunction3 { static type() { return "triggerTwoWaySwitch"; } func(condition, _func0, _func1) { if (condition) { _func0(); } else { _func1(); } } } export class triggerSwitch extends NamedFunction2 { static type() { return "triggerSwitch"; } func(index, _functions) { const _func = _functions[index]; if (_func) { _func(); } } }