@needle-tools/engine
Version:
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.
20 lines • 653 B
JavaScript
import { FrameEvent } from "../../engine/engine_setup.js";
import { getParam } from "../../engine/engine_utils.js";
import { Behaviour } from "../../engine-components/Component.js";
const debug = getParam("logstats");
/** @internal */
export class LogStats extends Behaviour {
onEnable() {
console.log(this);
if (debug)
this.startCoroutine(this.run(), FrameEvent.OnAfterRender);
}
*run() {
while (this.enabled) {
const info = this.context.renderer.info;
console.log(info.memory, info.render, info.programs);
yield;
}
}
}
//# sourceMappingURL=LogStats.js.map