UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

24 lines (21 loc) 479 B
import { ScopeId } from './scope-id.js'; class ScopeSpace { resolve(name) { if (!this.variables.has(name)) { this.variables.set(name, new ScopeId(name)); } return this.variables.get(name); } removeValue(value) { for (const uniform of this.variables.values()){ if (uniform.value === value) { uniform.value = null; } } } constructor(name){ this.name = name; this.variables = new Map(); } } export { ScopeSpace };