@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
24 lines (23 loc) • 696 B
JavaScript
;
import { AnimationNodeParamsProxy } from "./ParamProxy";
class NodeParamProxiesRegisterClass {
constructor() {
this._map = /* @__PURE__ */ new Map();
}
static instance() {
return this._instance = this._instance || new NodeParamProxiesRegisterClass();
}
nodeProxy(node) {
const existingProxy = this._map.get(node);
if (existingProxy) {
return existingProxy;
}
const newProxy = new AnimationNodeParamsProxy(node);
this._map.set(node, newProxy);
return newProxy;
}
paramProxy(param) {
return this.nodeProxy(param.node).getParamProxy(param);
}
}
export const NodeParamProxiesRegister = NodeParamProxiesRegisterClass.instance();