@eva/plugin-stats 1.1.1-fix.2 → 1.1.1-fix.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,446 +1,201 @@
1
- window.EVA = window.EVA || {};
2
- window.EVA.plugin = window.EVA.plugin || {};
3
-
4
- var _EVA_IIFE_stats = function (exports, eva_js) {
5
- 'use strict';
6
-
7
- var _extendStatics = function extendStatics(d, b) {
8
- _extendStatics = Object.setPrototypeOf || {
9
- __proto__: []
10
- } instanceof Array && function (d, b) {
11
- d.__proto__ = b;
12
- } || function (d, b) {
13
- for (var p in b) {
14
- if (b.hasOwnProperty(p)) d[p] = b[p];
15
- }
16
- };
17
-
18
- return _extendStatics(d, b);
19
- };
20
-
21
- function __extends(d, b) {
22
- _extendStatics(d, b);
23
-
24
- function __() {
25
- this.constructor = d;
26
- }
27
-
28
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
29
- }
30
-
31
- var _assign = function __assign() {
32
- _assign = Object.assign || function __assign(t) {
33
- for (var s, i = 1, n = arguments.length; i < n; i++) {
34
- s = arguments[i];
35
-
36
- for (var p in s) {
37
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
38
- }
39
- }
40
-
41
- return t;
42
- };
43
-
44
- return _assign.apply(this, arguments);
45
- };
46
-
47
- var StatsComponent = function (_super) {
48
- __extends(StatsComponent, _super);
49
-
50
- function StatsComponent() {
51
- return _super !== null && _super.apply(this, arguments) || this;
52
- }
53
-
54
- StatsComponent.prototype.update = function () {
55
- this.stats && this.stats.begin();
56
- };
57
-
58
- StatsComponent.componentName = 'Stats';
59
- return StatsComponent;
60
- }(eva_js.Component);
61
-
62
- var Stats$2 = StatsComponent;
63
-
64
- var Stats = function Stats(style) {
65
- style = _assign({
66
- width: 20,
67
- height: 12,
68
- x: 0,
69
- y: 0
70
- }, style);
71
- var width = style.width,
72
- height = style.height,
73
- x = style.x,
74
- y = style.y;
75
- var mode = 0;
76
- var container = document.createElement('div');
77
- container.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000;width: " + width + "vw;height: " + height + "vw;left: " + x + "vw;top: " + y + "vw;";
78
- container.addEventListener('click', function (event) {
79
- event.preventDefault();
80
- showPanel(++mode % container.children.length);
81
- }, false);
82
-
83
- function addPanel(panel) {
84
- container.appendChild(panel.dom);
85
- return panel;
86
- }
87
-
88
- function showPanel(id) {
89
- for (var i = 0; i < container.children.length; i++) {
90
- container.children[i].style.display = i === id ? 'block' : 'none';
91
- }
92
-
93
- mode = id;
94
- }
95
-
96
- var beginTime = (performance || Date).now(),
97
- prevTime = beginTime,
98
- frames = 0;
99
- var fpsPanel = addPanel(Stats.Panel('FPS', '#0ff', '#002'));
100
- var msPanel = addPanel(Stats.Panel('MS', '#0f0', '#020'));
101
- var dcPanel = addPanel(Stats.Panel('DrawCall', '#330570', '#A69700'));
102
- var tcPanel = addPanel(Stats.Panel('TC:', '#A62500', '#00B454'));
103
- var memPanel;
104
-
105
- if (self.performance && self.performance.memory) {
106
- memPanel = addPanel(Stats.Panel('MB', '#f08', '#201'));
107
- }
108
-
109
- showPanel(0);
110
- return {
111
- REVISION: 16,
112
- dom: container,
113
- addPanel: addPanel,
114
- showPanel: showPanel,
115
- begin: function begin(time) {
116
- beginTime = time || (performance || Date).now();
117
- },
118
- end: function end(hook) {
119
- frames++;
120
- var time = (performance || Date).now();
121
- msPanel.update(time - beginTime, 200);
122
-
123
- if (hook) {
124
- dcPanel.update(hook.deltaDrawCalls, Math.max(50, hook.maxDeltaDrawCalls));
125
- tcPanel.update(hook.texturesCount, Math.max(20, hook.maxTextureCount));
126
- }
127
-
128
- if (time >= prevTime + 1000) {
129
- fpsPanel.update(frames * 1000 / (time - prevTime), 100);
130
- prevTime = time;
131
- frames = 0;
132
-
133
- if (memPanel) {
134
- var memory = performance.memory;
135
- memPanel.update(memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576);
136
- }
137
- }
138
-
139
- return time;
140
- },
141
- update: function update() {
142
- beginTime = this.end();
143
- },
144
- domElement: container,
145
- setMode: showPanel
146
- };
147
- };
148
-
149
- Stats.Panel = function (name, fg, bg) {
150
- var min = Infinity,
151
- max = 0;
152
- var round = Math.round;
153
- var PR = round(window.devicePixelRatio || 1);
154
- var WIDTH = 80 * PR,
155
- HEIGHT = 48 * PR,
156
- TEXT_X = 3 * PR,
157
- TEXT_Y = 2 * PR,
158
- GRAPH_X = 3 * PR,
159
- GRAPH_Y = 15 * PR,
160
- GRAPH_WIDTH = 74 * PR,
161
- GRAPH_HEIGHT = 30 * PR;
162
- var canvas = document.createElement('canvas');
163
- canvas.width = WIDTH;
164
- canvas.height = HEIGHT;
165
- canvas.style.cssText = 'width:100%;height:100%';
166
- var context = canvas.getContext('2d');
167
- context.font = 'bold ' + 9 * PR + 'px Helvetica,Arial,sans-serif';
168
- context.textBaseline = 'top';
169
- context.fillStyle = bg;
170
- context.fillRect(0, 0, WIDTH, HEIGHT);
171
- context.fillStyle = fg;
172
- context.fillText(name, TEXT_X, TEXT_Y);
173
- context.fillRect(GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT);
174
- context.fillStyle = bg;
175
- context.globalAlpha = 0.9;
176
- context.fillRect(GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT);
177
- return {
178
- dom: canvas,
179
- update: function update(value, maxValue) {
180
- min = Math.min(min, value);
181
- max = Math.max(max, value);
182
- context.fillStyle = bg;
183
- context.globalAlpha = 1;
184
- context.fillRect(0, 0, WIDTH, GRAPH_Y);
185
- context.fillStyle = fg;
186
- context.fillText(round(value) + ' ' + name + ' (' + round(min) + '-' + round(max) + ')', TEXT_X, TEXT_Y);
187
- context.drawImage(canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT);
188
- context.fillRect(GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT);
189
- context.fillStyle = bg;
190
- context.globalAlpha = 0.9;
191
- context.fillRect(GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round((1 - value / maxValue) * GRAPH_HEIGHT));
192
- }
193
- };
194
- };
195
-
196
- var Stats$1 = Stats;
197
-
198
- var GLHook = function () {
199
- function GLHook(_gl) {
200
- this.drawPasses = 0;
201
- this.isInit = false;
202
-
203
- this.realGLDrawElements = function () {};
204
-
205
- if (_gl) {
206
- if (_gl.__proto__.drawElements) {
207
- this.gl = _gl;
208
- this.realGLDrawElements = _gl.__proto__.drawElements;
209
- _gl.__proto__.drawElements = this.fakeGLdrawElements.bind(this);
210
- this.isInit = true;
211
- }
212
- } else {
213
- console.error("[GLHook] GL can't be NULL");
214
- }
215
- }
216
-
217
- GLHook.prototype.fakeGLdrawElements = function (mode, count, type, offset) {
218
- this.drawPasses++;
219
- this.realGLDrawElements.call(this.gl, mode, count, type, offset);
220
- };
221
-
222
- GLHook.prototype.reset = function () {
223
- this.drawPasses = 0;
224
- };
225
-
226
- GLHook.prototype.release = function () {
227
- if (this.isInit) {
228
- this.gl.__proto__.drawElements = this.realGLDrawElements;
229
- }
230
-
231
- this.isInit = false;
232
- };
233
-
234
- return GLHook;
235
- }();
236
-
237
- var TextureHook = function () {
238
- function TextureHook(_gl) {
239
- this.createdTextures = new Array();
240
- this.maxTexturesCount = 0;
241
- this.isInit = false;
242
-
243
- this.realGLCreateTexture = function () {};
244
-
245
- this.realGLDeleteTexture = function () {};
246
-
247
- if (_gl) {
248
- if (_gl.__proto__.createTexture) {
249
- this.gl = _gl;
250
- this.realGLCreateTexture = _gl.__proto__.createTexture;
251
- this.realGLDeleteTexture = _gl.__proto__.deleteTexture;
252
- _gl.__proto__.createTexture = this.fakeGLCreateTexture.bind(this);
253
- _gl.__proto__.deleteTexture = this.fakeGLDeleteTexture.bind(this);
254
- this.isInit = true;
255
- }
256
- } else {
257
- console.error("[TextureHook] GL can't be NULL");
258
- }
259
- }
260
-
261
- Object.defineProperty(TextureHook.prototype, "currentTextureCount", {
262
- get: function get() {
263
- return this.createdTextures.length;
264
- },
265
- enumerable: false,
266
- configurable: true
267
- });
268
-
269
- TextureHook.prototype.registerTexture = function (texture) {
270
- this.createdTextures.push(texture);
271
- this.maxTexturesCount = Math.max(this.createdTextures.length, this.maxTexturesCount);
272
- };
273
-
274
- TextureHook.prototype.fakeGLCreateTexture = function () {
275
- var texture = this.realGLCreateTexture.call(this.gl);
276
- this.registerTexture(texture);
277
- return texture;
278
- };
279
-
280
- TextureHook.prototype.fakeGLDeleteTexture = function (texture) {
281
- var index = this.createdTextures.indexOf(texture);
282
-
283
- if (index > -1) {
284
- this.createdTextures.splice(index, 1);
285
- }
286
-
287
- this.realGLDeleteTexture.call(this.gl, texture);
288
- };
289
-
290
- TextureHook.prototype.reset = function () {
291
- this.createdTextures = new Array();
292
- this.maxTexturesCount = 0;
293
- };
294
-
295
- TextureHook.prototype.release = function () {
296
- if (this.isInit) {
297
- this.gl.__proto__.createTexture = this.realGLCreateTexture;
298
- this.gl.__proto__.deleteTexture = this.realGLDeleteTexture;
299
- console.log('[TextureHook] Hook was removed!');
300
- }
301
-
302
- this.isInit = false;
303
- };
304
-
305
- return TextureHook;
306
- }();
307
-
308
- var BaseHooks = function () {
309
- function BaseHooks() {
310
- this._drawCalls = -1;
311
- this._maxDeltaDrawCalls = -1;
312
- }
313
-
314
- BaseHooks.prototype.attach = function (gl) {
315
- this.glhook = new GLHook(gl);
316
- this.texturehook = new TextureHook(gl);
317
- };
318
-
319
- Object.defineProperty(BaseHooks.prototype, "drawCalls", {
320
- get: function get() {
321
- if (this.glhook && this.glhook.isInit) {
322
- return this.glhook.drawPasses;
323
- }
324
-
325
- return -1;
326
- },
327
- enumerable: false,
328
- configurable: true
329
- });
330
- Object.defineProperty(BaseHooks.prototype, "maxDeltaDrawCalls", {
331
- get: function get() {
332
- return this._maxDeltaDrawCalls;
333
- },
334
- enumerable: false,
335
- configurable: true
336
- });
337
- Object.defineProperty(BaseHooks.prototype, "deltaDrawCalls", {
338
- get: function get() {
339
- if (this._drawCalls == -1) {
340
- this._drawCalls = this.drawCalls;
341
- return 0;
342
- }
343
-
344
- var dc = this.drawCalls;
345
- var delta = dc - this._drawCalls;
346
- this._drawCalls = dc;
347
- this._maxDeltaDrawCalls = Math.max(this._maxDeltaDrawCalls, delta);
348
- return delta;
349
- },
350
- enumerable: false,
351
- configurable: true
352
- });
353
- Object.defineProperty(BaseHooks.prototype, "maxTextureCount", {
354
- get: function get() {
355
- if (this.texturehook && this.texturehook.isInit) return this.texturehook.maxTexturesCount;
356
- return 0;
357
- },
358
- enumerable: false,
359
- configurable: true
360
- });
361
- Object.defineProperty(BaseHooks.prototype, "texturesCount", {
362
- get: function get() {
363
- if (this.texturehook && this.texturehook.isInit) return this.texturehook.currentTextureCount;
364
- return 0;
365
- },
366
- enumerable: false,
367
- configurable: true
368
- });
369
-
370
- BaseHooks.prototype.reset = function () {
371
- this._maxDeltaDrawCalls = -1;
372
- this._drawCalls = -1;
373
- if (this.glhook) this.glhook.reset();
374
- if (this.texturehook) this.texturehook.reset();
375
- };
376
-
377
- BaseHooks.prototype.release = function () {
378
- if (this.glhook) this.glhook.release();
379
- if (this.texturehook) this.texturehook.release();
380
- };
381
-
382
- return BaseHooks;
383
- }();
384
-
385
- var StatsSystem = function (_super) {
386
- __extends(StatsSystem, _super);
387
-
388
- function StatsSystem() {
389
- var _this = _super !== null && _super.apply(this, arguments) || this;
390
-
391
- _this.show = true;
392
- return _this;
393
- }
394
-
395
- StatsSystem.prototype.init = function (param) {
396
- if (param === void 0) {
397
- param = {
398
- show: true
399
- };
400
- }
401
-
402
- this.show = param.show;
403
- this.style = param.style;
404
- this.renderSystem = this.game.getSystem('Renderer');
405
- this.app = this.renderSystem.application;
406
-
407
- if (this.app && this.show) {
408
- var gl = this.app.renderer.gl;
409
- this.hook = new BaseHooks();
410
- this.hook.attach(gl);
411
- }
412
- };
413
-
414
- StatsSystem.prototype.start = function () {
415
- if (!this.show) return;
416
- this.component = this.game.scene.addComponent(new Stats$2());
417
- this.stats = Stats$1(this.style);
418
- this.component.stats = this.stats;
419
- this.stats.showPanel(0);
420
- document.body.appendChild(this.stats.dom);
421
- };
422
-
423
- StatsSystem.prototype.lateUpdate = function () {
424
- if (!this.show) return;
425
- this.stats && this.stats.end(this.hook);
426
- };
427
-
428
- StatsSystem.systemName = 'Stats';
429
- return StatsSystem;
430
- }(eva_js.System);
431
-
432
- var StatsSystem$1 = StatsSystem;
433
- var index = {
434
- Components: [Stats$2],
435
- Systems: [StatsSystem$1]
436
- };
437
- exports.Stats = Stats$2;
438
- exports.StatsSystem = StatsSystem$1;
439
- exports['default'] = index;
440
- Object.defineProperty(exports, '__esModule', {
441
- value: true
442
- });
443
- return exports;
444
- }({}, EVA);
445
-
446
- window.EVA.plugin.stats = window.EVA.plugin.stats || _EVA_IIFE_stats;
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@eva/eva.js')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@eva/eva.js'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.EVA = global.EVA || {}, global.EVA.plugin = global.EVA.plugin || {}, global.EVA.plugin.stats = {}), global.EVA));
5
+ }(this, (function (exports, eva_js) { 'use strict';
6
+
7
+ /*! *****************************************************************************
8
+ Copyright (c) Microsoft Corporation.
9
+
10
+ Permission to use, copy, modify, and/or distribute this software for any
11
+ purpose with or without fee is hereby granted.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
+ PERFORMANCE OF THIS SOFTWARE.
20
+ ***************************************************************************** */
21
+ /* global Reflect, Promise */
22
+
23
+ var extendStatics = function(d, b) {
24
+ extendStatics = Object.setPrototypeOf ||
25
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
+ return extendStatics(d, b);
28
+ };
29
+
30
+ function __extends(d, b) {
31
+ extendStatics(d, b);
32
+ function __() { this.constructor = d; }
33
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
+ }
35
+
36
+ var __assign = function() {
37
+ __assign = Object.assign || function __assign(t) {
38
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
39
+ s = arguments[i];
40
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
+ }
42
+ return t;
43
+ };
44
+ return __assign.apply(this, arguments);
45
+ };
46
+
47
+ var StatsComponent = (function (_super) {
48
+ __extends(StatsComponent, _super);
49
+ function StatsComponent() {
50
+ return _super !== null && _super.apply(this, arguments) || this;
51
+ }
52
+ StatsComponent.prototype.update = function () {
53
+ this.stats && this.stats.begin();
54
+ };
55
+ StatsComponent.componentName = 'Stats';
56
+ return StatsComponent;
57
+ }(eva_js.Component));
58
+ var Stats$2 = StatsComponent;
59
+
60
+ var Stats = function (style) {
61
+ style = __assign({ width: 20, height: 12, x: 0, y: 0 }, style);
62
+ var width = style.width, height = style.height, x = style.x, y = style.y;
63
+ var mode = 0;
64
+ var container = document.createElement('div');
65
+ container.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000;width: " + width + "vw;height: " + height + "vw;left: " + x + "vw;top: " + y + "vw;";
66
+ container.addEventListener('click', function (event) {
67
+ event.preventDefault();
68
+ showPanel(++mode % container.children.length);
69
+ }, false);
70
+ function addPanel(panel) {
71
+ container.appendChild(panel.dom);
72
+ return panel;
73
+ }
74
+ function showPanel(id) {
75
+ for (var i = 0; i < container.children.length; i++) {
76
+ container.children[i].style.display = i === id ? 'block' : 'none';
77
+ }
78
+ mode = id;
79
+ }
80
+ var beginTime = (performance || Date).now(), prevTime = beginTime, frames = 0;
81
+ var fpsPanel = addPanel(Stats.Panel('FPS', '#0ff', '#002'));
82
+ var msPanel = addPanel(Stats.Panel('MS', '#0f0', '#020'));
83
+ var memPanel;
84
+ if (self.performance && self.performance.memory) {
85
+ memPanel = addPanel(Stats.Panel('MB', '#f08', '#201'));
86
+ }
87
+ showPanel(0);
88
+ return {
89
+ REVISION: 16,
90
+ dom: container,
91
+ addPanel: addPanel,
92
+ showPanel: showPanel,
93
+ begin: function (time) {
94
+ beginTime = time || (performance || Date).now();
95
+ },
96
+ end: function () {
97
+ frames++;
98
+ var time = (performance || Date).now();
99
+ msPanel.update(time - beginTime, 200);
100
+ if (time >= prevTime + 1000) {
101
+ fpsPanel.update((frames * 1000) / (time - prevTime), 100);
102
+ prevTime = time;
103
+ frames = 0;
104
+ if (memPanel) {
105
+ var memory = performance.memory;
106
+ memPanel.update(memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576);
107
+ }
108
+ }
109
+ return time;
110
+ },
111
+ update: function () {
112
+ beginTime = this.end();
113
+ },
114
+ domElement: container,
115
+ setMode: showPanel,
116
+ };
117
+ };
118
+ Stats.Panel = function (name, fg, bg) {
119
+ var min = Infinity, max = 0;
120
+ var round = Math.round;
121
+ var PR = round(window.devicePixelRatio || 1);
122
+ var WIDTH = 80 * PR, HEIGHT = 48 * PR, TEXT_X = 3 * PR, TEXT_Y = 2 * PR, GRAPH_X = 3 * PR, GRAPH_Y = 15 * PR, GRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;
123
+ var canvas = document.createElement('canvas');
124
+ canvas.width = WIDTH;
125
+ canvas.height = HEIGHT;
126
+ canvas.style.cssText = 'width:100%;height:100%';
127
+ var context = canvas.getContext('2d');
128
+ context.font = 'bold ' + 9 * PR + 'px Helvetica,Arial,sans-serif';
129
+ context.textBaseline = 'top';
130
+ context.fillStyle = bg;
131
+ context.fillRect(0, 0, WIDTH, HEIGHT);
132
+ context.fillStyle = fg;
133
+ context.fillText(name, TEXT_X, TEXT_Y);
134
+ context.fillRect(GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT);
135
+ context.fillStyle = bg;
136
+ context.globalAlpha = 0.9;
137
+ context.fillRect(GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT);
138
+ return {
139
+ dom: canvas,
140
+ update: function (value, maxValue) {
141
+ min = Math.min(min, value);
142
+ max = Math.max(max, value);
143
+ context.fillStyle = bg;
144
+ context.globalAlpha = 1;
145
+ context.fillRect(0, 0, WIDTH, GRAPH_Y);
146
+ context.fillStyle = fg;
147
+ context.fillText(round(value) + ' ' + name + ' (' + round(min) + '-' + round(max) + ')', TEXT_X, TEXT_Y);
148
+ context.drawImage(canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT);
149
+ context.fillRect(GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT);
150
+ context.fillStyle = bg;
151
+ context.globalAlpha = 0.9;
152
+ context.fillRect(GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round((1 - value / maxValue) * GRAPH_HEIGHT));
153
+ },
154
+ };
155
+ };
156
+ var Stats$1 = Stats;
157
+
158
+ var StatsSystem = (function (_super) {
159
+ __extends(StatsSystem, _super);
160
+ function StatsSystem() {
161
+ var _this = _super !== null && _super.apply(this, arguments) || this;
162
+ _this.show = true;
163
+ return _this;
164
+ }
165
+ StatsSystem.prototype.init = function (param) {
166
+ if (param === void 0) { param = { show: true }; }
167
+ this.show = param.show;
168
+ this.style = param.style;
169
+ };
170
+ StatsSystem.prototype.start = function () {
171
+ if (!this.show)
172
+ return;
173
+ this.component = this.game.scene.addComponent(new Stats$2());
174
+ this.stats = Stats$1(this.style);
175
+ this.component.stats = this.stats;
176
+ this.stats.showPanel(0);
177
+ document.body.appendChild(this.stats.dom);
178
+ };
179
+ StatsSystem.prototype.lateUpdate = function () {
180
+ if (!this.show)
181
+ return;
182
+ this.stats && this.stats.end();
183
+ };
184
+ StatsSystem.systemName = 'Stats';
185
+ return StatsSystem;
186
+ }(eva_js.System));
187
+ var StatsSystem$1 = StatsSystem;
188
+
189
+ var index = {
190
+ Components: [Stats$2],
191
+ Systems: [StatsSystem$1],
192
+ };
193
+
194
+ exports.Stats = Stats$2;
195
+ exports.StatsSystem = StatsSystem$1;
196
+ exports['default'] = index;
197
+
198
+ Object.defineProperty(exports, '__esModule', { value: true });
199
+
200
+ })));
201
+ //# sourceMappingURL=EVA.plugin.stats.js.map