@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.
22 lines (18 loc) • 628 B
text/typescript
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");
export class LogStats extends Behaviour {
onEnable(): void {
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;
}
}
}