Skip to content

Commit

Permalink
Update stats-in-vr.js
Browse files Browse the repository at this point in the history
fixed ability to add targets for load time
  • Loading branch information
kylebakerio authored Aug 22, 2021
1 parent 99272d4 commit 3143a41
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stats-in-vr.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}),
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3143a41

Please sign in to comment.