// import { GUI } from 'dat.gui' import { ContextRegistry, ContextEvent } from '@needle-tools/engine' ContextRegistry.registerCallback(ContextEvent.ContextCreated, (_evt: any) => { // Hack to re-apply cached modifications // setTimeout(()=>{ // applyCached(); // }, 1000) // const { context: Context } = evt; // const renderer = GameObject.findObjectOfType(Renderer); // if (!renderer) return; // const mat = renderer.sharedMaterial; // const gui = new GUI(); // console.dir(gui); // const folder = gui.addFolder('Color') // folder.add(mat.color, 'r', 0, 1).onFinishChange(cb => { // notifyPropertyChanged(mat, 'color.r', cb) // }); // folder.add(mat.color, 'g', 0, 1).onFinishChange(cb => { // notifyPropertyChanged(mat, 'color.g', cb) // }); // folder.add(mat.color, 'b', 0, 1).onFinishChange(cb => { // notifyPropertyChanged(mat, 'color.b', cb) // }); // folder.open() });