From 3143a416bb12d0c6ca9da731896ad7fb01a82ff8 Mon Sep 17 00:00:00 2001 From: Kyle Baker Date: Mon, 23 Aug 2021 00:51:05 +0200 Subject: [PATCH] Update stats-in-vr.js fixed ability to add targets for load time --- stats-in-vr.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stats-in-vr.js b/stats-in-vr.js index 0954500..38092c5 100644 --- a/stats-in-vr.js +++ b/stats-in-vr.js @@ -40,6 +40,7 @@ AFRAME.registerComponent("stats-in-vr", { calls: 200, // raf: 15, // needed to keep responsiveness around 60fps triangles: 100000, + load: 3000, // you can specify your own targets for any stats props, and they'll turn red when they rise above target // this does come with a small performance penalty }), @@ -49,6 +50,7 @@ AFRAME.registerComponent("stats-in-vr", { Object.keys(output).forEach(label => { output[capitalizeWord(label)] = output[label] }) + output['Load Time'] = output['Load Time'] || output['load time'] || output['load']; // || output['loadtime'] || output['load_time'] || output['Load'] || output['Load time'] || output['load-time'] || return output; }, stringify: JSON.stringify @@ -65,6 +67,7 @@ AFRAME.registerComponent("stats-in-vr", { Object.keys(output).forEach(label => { output[capitalizeWord(label)] = output[label] }) + output['Load Time'] = output['Load Time'] || output['load time'] || output['load']; // || output['loadtime'] || output['load_time'] || output['Load'] || output['Load time'] || output['load-time'] || return output; }, stringify: JSON.stringify