@eva/plugin-stats 2.0.0-beta.0 → 2.0.0-beta.2

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.
Files changed (242) hide show
  1. package/dist/EVA.plugin.stats.js +113 -176
  2. package/dist/EVA.plugin.stats.min.js +1 -1
  3. package/dist/plugin-stats.cjs.js +107 -185
  4. package/dist/plugin-stats.cjs.prod.js +1 -15
  5. package/dist/{packages/plugin-stats/lib/StatsSystem.d.ts → plugin-stats.d.ts} +22 -8
  6. package/dist/plugin-stats.esm.js +106 -184
  7. package/package.json +2 -2
  8. package/dist/packages/eva.js/lib/core/Component.d.ts +0 -35
  9. package/dist/packages/eva.js/lib/core/Component.d.ts.map +0 -1
  10. package/dist/packages/eva.js/lib/core/ComponentObserver.d.ts +0 -22
  11. package/dist/packages/eva.js/lib/core/ComponentObserver.d.ts.map +0 -1
  12. package/dist/packages/eva.js/lib/core/GameObject.d.ts +0 -31
  13. package/dist/packages/eva.js/lib/core/GameObject.d.ts.map +0 -1
  14. package/dist/packages/eva.js/lib/core/System.d.ts +0 -30
  15. package/dist/packages/eva.js/lib/core/System.d.ts.map +0 -1
  16. package/dist/packages/eva.js/lib/core/Transform.d.ts +0 -51
  17. package/dist/packages/eva.js/lib/core/Transform.d.ts.map +0 -1
  18. package/dist/packages/eva.js/lib/core/observer.d.ts +0 -23
  19. package/dist/packages/eva.js/lib/core/observer.d.ts.map +0 -1
  20. package/dist/packages/eva.js/lib/decorators/ide.d.ts +0 -2
  21. package/dist/packages/eva.js/lib/decorators/ide.d.ts.map +0 -1
  22. package/dist/packages/eva.js/lib/decorators/system.d.ts +0 -11
  23. package/dist/packages/eva.js/lib/decorators/system.d.ts.map +0 -1
  24. package/dist/packages/eva.js/lib/game/Game.d.ts +0 -72
  25. package/dist/packages/eva.js/lib/game/Game.d.ts.map +0 -1
  26. package/dist/packages/eva.js/lib/game/Scene.d.ts +0 -12
  27. package/dist/packages/eva.js/lib/game/Scene.d.ts.map +0 -1
  28. package/dist/packages/eva.js/lib/game/Ticker.d.ts +0 -25
  29. package/dist/packages/eva.js/lib/game/Ticker.d.ts.map +0 -1
  30. package/dist/packages/eva.js/lib/index.d.ts +0 -26
  31. package/dist/packages/eva.js/lib/index.d.ts.map +0 -1
  32. package/dist/packages/eva.js/lib/loader/Progress.d.ts +0 -21
  33. package/dist/packages/eva.js/lib/loader/Progress.d.ts.map +0 -1
  34. package/dist/packages/eva.js/lib/loader/Resource.d.ts +0 -99
  35. package/dist/packages/eva.js/lib/loader/Resource.d.ts.map +0 -1
  36. package/dist/packages/eva.js/lib/loader/resourceLoader.d.ts +0 -14
  37. package/dist/packages/eva.js/lib/loader/resourceLoader.d.ts.map +0 -1
  38. package/dist/packages/eva.js/lib/timeline/index.d.ts +0 -40
  39. package/dist/packages/eva.js/lib/timeline/index.d.ts.map +0 -1
  40. package/dist/packages/eva.js/lib/timeline/utils.d.ts +0 -2
  41. package/dist/packages/eva.js/lib/timeline/utils.d.ts.map +0 -1
  42. package/dist/packages/plugin-a11y/lib/A11y.d.ts +0 -26
  43. package/dist/packages/plugin-a11y/lib/A11y.d.ts.map +0 -1
  44. package/dist/packages/plugin-a11y/lib/A11ySystem.d.ts +0 -54
  45. package/dist/packages/plugin-a11y/lib/A11ySystem.d.ts.map +0 -1
  46. package/dist/packages/plugin-a11y/lib/constant.d.ts +0 -34
  47. package/dist/packages/plugin-a11y/lib/constant.d.ts.map +0 -1
  48. package/dist/packages/plugin-a11y/lib/index.d.ts +0 -4
  49. package/dist/packages/plugin-a11y/lib/index.d.ts.map +0 -1
  50. package/dist/packages/plugin-a11y/lib/utils.d.ts +0 -6
  51. package/dist/packages/plugin-a11y/lib/utils.d.ts.map +0 -1
  52. package/dist/packages/plugin-evax/lib/EvaXComponent.d.ts +0 -20
  53. package/dist/packages/plugin-evax/lib/EvaXComponent.d.ts.map +0 -1
  54. package/dist/packages/plugin-evax/lib/EvaXSystem.d.ts +0 -33
  55. package/dist/packages/plugin-evax/lib/EvaXSystem.d.ts.map +0 -1
  56. package/dist/packages/plugin-evax/lib/index.d.ts +0 -10
  57. package/dist/packages/plugin-evax/lib/index.d.ts.map +0 -1
  58. package/dist/packages/plugin-evax/lib/utils.d.ts +0 -3
  59. package/dist/packages/plugin-evax/lib/utils.d.ts.map +0 -1
  60. package/dist/packages/plugin-matterjs/lib/BodiesFactory.d.ts +0 -31
  61. package/dist/packages/plugin-matterjs/lib/BodiesFactory.d.ts.map +0 -1
  62. package/dist/packages/plugin-matterjs/lib/Physics.d.ts +0 -32
  63. package/dist/packages/plugin-matterjs/lib/Physics.d.ts.map +0 -1
  64. package/dist/packages/plugin-matterjs/lib/PhysicsEngine.d.ts +0 -35
  65. package/dist/packages/plugin-matterjs/lib/PhysicsEngine.d.ts.map +0 -1
  66. package/dist/packages/plugin-matterjs/lib/PhysicsSystem.d.ts +0 -32
  67. package/dist/packages/plugin-matterjs/lib/PhysicsSystem.d.ts.map +0 -1
  68. package/dist/packages/plugin-matterjs/lib/index.d.ts +0 -5
  69. package/dist/packages/plugin-matterjs/lib/index.d.ts.map +0 -1
  70. package/dist/packages/plugin-matterjs/lib/matter.d.ts +0 -3
  71. package/dist/packages/plugin-matterjs/lib/matter.d.ts.map +0 -1
  72. package/dist/packages/plugin-renderer/lib/Renderer.d.ts +0 -19
  73. package/dist/packages/plugin-renderer/lib/Renderer.d.ts.map +0 -1
  74. package/dist/packages/plugin-renderer/lib/System.d.ts +0 -40
  75. package/dist/packages/plugin-renderer/lib/System.d.ts.map +0 -1
  76. package/dist/packages/plugin-renderer/lib/Transform.d.ts +0 -28
  77. package/dist/packages/plugin-renderer/lib/Transform.d.ts.map +0 -1
  78. package/dist/packages/plugin-renderer/lib/compressedTexture/ability.d.ts +0 -20
  79. package/dist/packages/plugin-renderer/lib/compressedTexture/ability.d.ts.map +0 -1
  80. package/dist/packages/plugin-renderer/lib/compressedTexture/fix/loader.d.ts +0 -2
  81. package/dist/packages/plugin-renderer/lib/compressedTexture/fix/loader.d.ts.map +0 -1
  82. package/dist/packages/plugin-renderer/lib/compressedTexture/index.d.ts +0 -7
  83. package/dist/packages/plugin-renderer/lib/compressedTexture/index.d.ts.map +0 -1
  84. package/dist/packages/plugin-renderer/lib/index.d.ts +0 -8
  85. package/dist/packages/plugin-renderer/lib/index.d.ts.map +0 -1
  86. package/dist/packages/plugin-renderer/lib/manager/ContainerManager.d.ts +0 -18
  87. package/dist/packages/plugin-renderer/lib/manager/ContainerManager.d.ts.map +0 -1
  88. package/dist/packages/plugin-renderer/lib/manager/RendererManager.d.ts +0 -17
  89. package/dist/packages/plugin-renderer/lib/manager/RendererManager.d.ts.map +0 -1
  90. package/dist/packages/plugin-renderer/lib/mixin.d.ts +0 -2
  91. package/dist/packages/plugin-renderer/lib/mixin.d.ts.map +0 -1
  92. package/dist/packages/plugin-renderer-dragonbone/lib/component.d.ts +0 -26
  93. package/dist/packages/plugin-renderer-dragonbone/lib/component.d.ts.map +0 -1
  94. package/dist/packages/plugin-renderer-dragonbone/lib/db.d.ts +0 -3
  95. package/dist/packages/plugin-renderer-dragonbone/lib/db.d.ts.map +0 -1
  96. package/dist/packages/plugin-renderer-dragonbone/lib/engine.d.ts +0 -10
  97. package/dist/packages/plugin-renderer-dragonbone/lib/engine.d.ts.map +0 -1
  98. package/dist/packages/plugin-renderer-dragonbone/lib/index.d.ts +0 -4
  99. package/dist/packages/plugin-renderer-dragonbone/lib/index.d.ts.map +0 -1
  100. package/dist/packages/plugin-renderer-dragonbone/lib/system.d.ts +0 -24
  101. package/dist/packages/plugin-renderer-dragonbone/lib/system.d.ts.map +0 -1
  102. package/dist/packages/plugin-renderer-event/lib/component.d.ts +0 -52
  103. package/dist/packages/plugin-renderer-event/lib/component.d.ts.map +0 -1
  104. package/dist/packages/plugin-renderer-event/lib/index.d.ts +0 -5
  105. package/dist/packages/plugin-renderer-event/lib/index.d.ts.map +0 -1
  106. package/dist/packages/plugin-renderer-event/lib/system.d.ts +0 -19
  107. package/dist/packages/plugin-renderer-event/lib/system.d.ts.map +0 -1
  108. package/dist/packages/plugin-renderer-graphics/lib/component.d.ts +0 -8
  109. package/dist/packages/plugin-renderer-graphics/lib/component.d.ts.map +0 -1
  110. package/dist/packages/plugin-renderer-graphics/lib/index.d.ts +0 -4
  111. package/dist/packages/plugin-renderer-graphics/lib/index.d.ts.map +0 -1
  112. package/dist/packages/plugin-renderer-graphics/lib/system.d.ts +0 -12
  113. package/dist/packages/plugin-renderer-graphics/lib/system.d.ts.map +0 -1
  114. package/dist/packages/plugin-renderer-img/lib/component.d.ts +0 -10
  115. package/dist/packages/plugin-renderer-img/lib/component.d.ts.map +0 -1
  116. package/dist/packages/plugin-renderer-img/lib/index.d.ts +0 -4
  117. package/dist/packages/plugin-renderer-img/lib/index.d.ts.map +0 -1
  118. package/dist/packages/plugin-renderer-img/lib/system.d.ts +0 -18
  119. package/dist/packages/plugin-renderer-img/lib/system.d.ts.map +0 -1
  120. package/dist/packages/plugin-renderer-lottie/lib/Lottie.d.ts +0 -27
  121. package/dist/packages/plugin-renderer-lottie/lib/Lottie.d.ts.map +0 -1
  122. package/dist/packages/plugin-renderer-lottie/lib/LottieSystem.d.ts +0 -18
  123. package/dist/packages/plugin-renderer-lottie/lib/LottieSystem.d.ts.map +0 -1
  124. package/dist/packages/plugin-renderer-lottie/lib/index.d.ts +0 -3
  125. package/dist/packages/plugin-renderer-lottie/lib/index.d.ts.map +0 -1
  126. package/dist/packages/plugin-renderer-lottie/lib/lottie-pixi.d.ts +0 -180
  127. package/dist/packages/plugin-renderer-lottie/lib/lottie-pixi.d.ts.map +0 -1
  128. package/dist/packages/plugin-renderer-lottie/lib/types.d.ts +0 -18
  129. package/dist/packages/plugin-renderer-lottie/lib/types.d.ts.map +0 -1
  130. package/dist/packages/plugin-renderer-lottie/lib/utils.d.ts +0 -2
  131. package/dist/packages/plugin-renderer-lottie/lib/utils.d.ts.map +0 -1
  132. package/dist/packages/plugin-renderer-mask/lib/component.d.ts +0 -33
  133. package/dist/packages/plugin-renderer-mask/lib/component.d.ts.map +0 -1
  134. package/dist/packages/plugin-renderer-mask/lib/index.d.ts +0 -4
  135. package/dist/packages/plugin-renderer-mask/lib/index.d.ts.map +0 -1
  136. package/dist/packages/plugin-renderer-mask/lib/system.d.ts +0 -31
  137. package/dist/packages/plugin-renderer-mask/lib/system.d.ts.map +0 -1
  138. package/dist/packages/plugin-renderer-nine-patch/lib/component.d.ts +0 -22
  139. package/dist/packages/plugin-renderer-nine-patch/lib/component.d.ts.map +0 -1
  140. package/dist/packages/plugin-renderer-nine-patch/lib/index.d.ts +0 -4
  141. package/dist/packages/plugin-renderer-nine-patch/lib/index.d.ts.map +0 -1
  142. package/dist/packages/plugin-renderer-nine-patch/lib/system.d.ts +0 -19
  143. package/dist/packages/plugin-renderer-nine-patch/lib/system.d.ts.map +0 -1
  144. package/dist/packages/plugin-renderer-render/lib/component.d.ts +0 -17
  145. package/dist/packages/plugin-renderer-render/lib/component.d.ts.map +0 -1
  146. package/dist/packages/plugin-renderer-render/lib/index.d.ts +0 -4
  147. package/dist/packages/plugin-renderer-render/lib/index.d.ts.map +0 -1
  148. package/dist/packages/plugin-renderer-render/lib/system.d.ts +0 -17
  149. package/dist/packages/plugin-renderer-render/lib/system.d.ts.map +0 -1
  150. package/dist/packages/plugin-renderer-spine/lib/Spine.d.ts +0 -4
  151. package/dist/packages/plugin-renderer-spine/lib/Spine.d.ts.map +0 -1
  152. package/dist/packages/plugin-renderer-spine/lib/SpineSystem.d.ts +0 -5
  153. package/dist/packages/plugin-renderer-spine/lib/SpineSystem.d.ts.map +0 -1
  154. package/dist/packages/plugin-renderer-spine/lib/index.d.ts +0 -4
  155. package/dist/packages/plugin-renderer-spine/lib/index.d.ts.map +0 -1
  156. package/dist/packages/plugin-renderer-sprite/lib/component.d.ts +0 -12
  157. package/dist/packages/plugin-renderer-sprite/lib/component.d.ts.map +0 -1
  158. package/dist/packages/plugin-renderer-sprite/lib/index.d.ts +0 -4
  159. package/dist/packages/plugin-renderer-sprite/lib/index.d.ts.map +0 -1
  160. package/dist/packages/plugin-renderer-sprite/lib/system.d.ts +0 -17
  161. package/dist/packages/plugin-renderer-sprite/lib/system.d.ts.map +0 -1
  162. package/dist/packages/plugin-renderer-sprite-animation/lib/component.d.ts +0 -31
  163. package/dist/packages/plugin-renderer-sprite-animation/lib/component.d.ts.map +0 -1
  164. package/dist/packages/plugin-renderer-sprite-animation/lib/index.d.ts +0 -4
  165. package/dist/packages/plugin-renderer-sprite-animation/lib/index.d.ts.map +0 -1
  166. package/dist/packages/plugin-renderer-sprite-animation/lib/system.d.ts +0 -31
  167. package/dist/packages/plugin-renderer-sprite-animation/lib/system.d.ts.map +0 -1
  168. package/dist/packages/plugin-renderer-test/lib/component.d.ts +0 -20
  169. package/dist/packages/plugin-renderer-test/lib/component.d.ts.map +0 -1
  170. package/dist/packages/plugin-renderer-test/lib/index.d.ts +0 -4
  171. package/dist/packages/plugin-renderer-test/lib/index.d.ts.map +0 -1
  172. package/dist/packages/plugin-renderer-test/lib/system.d.ts +0 -21
  173. package/dist/packages/plugin-renderer-test/lib/system.d.ts.map +0 -1
  174. package/dist/packages/plugin-renderer-test/lib/system2.d.ts +0 -12
  175. package/dist/packages/plugin-renderer-test/lib/system2.d.ts.map +0 -1
  176. package/dist/packages/plugin-renderer-text/lib/component.d.ts +0 -43
  177. package/dist/packages/plugin-renderer-text/lib/component.d.ts.map +0 -1
  178. package/dist/packages/plugin-renderer-text/lib/index.d.ts +0 -4
  179. package/dist/packages/plugin-renderer-text/lib/index.d.ts.map +0 -1
  180. package/dist/packages/plugin-renderer-text/lib/system.d.ts +0 -22
  181. package/dist/packages/plugin-renderer-text/lib/system.d.ts.map +0 -1
  182. package/dist/packages/plugin-renderer-tiling-sprite/lib/component.d.ts +0 -20
  183. package/dist/packages/plugin-renderer-tiling-sprite/lib/component.d.ts.map +0 -1
  184. package/dist/packages/plugin-renderer-tiling-sprite/lib/index.d.ts +0 -4
  185. package/dist/packages/plugin-renderer-tiling-sprite/lib/index.d.ts.map +0 -1
  186. package/dist/packages/plugin-renderer-tiling-sprite/lib/system.d.ts +0 -18
  187. package/dist/packages/plugin-renderer-tiling-sprite/lib/system.d.ts.map +0 -1
  188. package/dist/packages/plugin-sound/lib/Sound.d.ts +0 -44
  189. package/dist/packages/plugin-sound/lib/Sound.d.ts.map +0 -1
  190. package/dist/packages/plugin-sound/lib/SoundSystem.d.ts +0 -37
  191. package/dist/packages/plugin-sound/lib/SoundSystem.d.ts.map +0 -1
  192. package/dist/packages/plugin-sound/lib/index.d.ts +0 -3
  193. package/dist/packages/plugin-sound/lib/index.d.ts.map +0 -1
  194. package/dist/packages/plugin-stats/lib/Stats.d.ts +0 -19
  195. package/dist/packages/plugin-stats/lib/Stats.d.ts.map +0 -1
  196. package/dist/packages/plugin-stats/lib/StatsComponent.d.ts +0 -7
  197. package/dist/packages/plugin-stats/lib/StatsComponent.d.ts.map +0 -1
  198. package/dist/packages/plugin-stats/lib/StatsSystem.d.ts.map +0 -1
  199. package/dist/packages/plugin-stats/lib/hooks/BaseHooks.d.ts +0 -18
  200. package/dist/packages/plugin-stats/lib/hooks/BaseHooks.d.ts.map +0 -1
  201. package/dist/packages/plugin-stats/lib/hooks/GLHook.d.ts +0 -11
  202. package/dist/packages/plugin-stats/lib/hooks/GLHook.d.ts.map +0 -1
  203. package/dist/packages/plugin-stats/lib/hooks/TextureHook.d.ts +0 -16
  204. package/dist/packages/plugin-stats/lib/hooks/TextureHook.d.ts.map +0 -1
  205. package/dist/packages/plugin-stats/lib/index.d.ts +0 -9
  206. package/dist/packages/plugin-stats/lib/index.d.ts.map +0 -1
  207. package/dist/packages/plugin-transition/lib/Animation.d.ts +0 -38
  208. package/dist/packages/plugin-transition/lib/Animation.d.ts.map +0 -1
  209. package/dist/packages/plugin-transition/lib/component.d.ts +0 -35
  210. package/dist/packages/plugin-transition/lib/component.d.ts.map +0 -1
  211. package/dist/packages/plugin-transition/lib/index.d.ts +0 -3
  212. package/dist/packages/plugin-transition/lib/index.d.ts.map +0 -1
  213. package/dist/packages/plugin-transition/lib/system.d.ts +0 -6
  214. package/dist/packages/plugin-transition/lib/system.d.ts.map +0 -1
  215. package/dist/packages/renderer-adapter/lib/Application.d.ts +0 -3
  216. package/dist/packages/renderer-adapter/lib/Application.d.ts.map +0 -1
  217. package/dist/packages/renderer-adapter/lib/Container.d.ts +0 -5
  218. package/dist/packages/renderer-adapter/lib/Container.d.ts.map +0 -1
  219. package/dist/packages/renderer-adapter/lib/Graphics.d.ts +0 -5
  220. package/dist/packages/renderer-adapter/lib/Graphics.d.ts.map +0 -1
  221. package/dist/packages/renderer-adapter/lib/NinePatch.d.ts +0 -5
  222. package/dist/packages/renderer-adapter/lib/NinePatch.d.ts.map +0 -1
  223. package/dist/packages/renderer-adapter/lib/Sprite.d.ts +0 -9
  224. package/dist/packages/renderer-adapter/lib/Sprite.d.ts.map +0 -1
  225. package/dist/packages/renderer-adapter/lib/SpriteAnimation.d.ts +0 -14
  226. package/dist/packages/renderer-adapter/lib/SpriteAnimation.d.ts.map +0 -1
  227. package/dist/packages/renderer-adapter/lib/Text.d.ts +0 -6
  228. package/dist/packages/renderer-adapter/lib/Text.d.ts.map +0 -1
  229. package/dist/packages/renderer-adapter/lib/TilingSprite.d.ts +0 -9
  230. package/dist/packages/renderer-adapter/lib/TilingSprite.d.ts.map +0 -1
  231. package/dist/packages/renderer-adapter/lib/index.d.ts +0 -9
  232. package/dist/packages/renderer-adapter/lib/index.d.ts.map +0 -1
  233. package/dist/packages/spine-base/lib/Spine.d.ts +0 -32
  234. package/dist/packages/spine-base/lib/Spine.d.ts.map +0 -1
  235. package/dist/packages/spine-base/lib/SpineData.d.ts +0 -5
  236. package/dist/packages/spine-base/lib/SpineData.d.ts.map +0 -1
  237. package/dist/packages/spine-base/lib/SpineSystem.d.ts +0 -20
  238. package/dist/packages/spine-base/lib/SpineSystem.d.ts.map +0 -1
  239. package/dist/packages/spine-base/lib/TexCache.d.ts +0 -10
  240. package/dist/packages/spine-base/lib/TexCache.d.ts.map +0 -1
  241. package/dist/packages/spine-base/lib/index.d.ts +0 -4
  242. package/dist/packages/spine-base/lib/index.d.ts.map +0 -1
@@ -1,60 +1,31 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
1
2
  window.EVA = window.EVA || {};
2
3
  window.EVA.plugin = window.EVA.plugin || {};
3
4
  var _EVA_IIFE_stats = function (exports, eva_js) {
4
5
  'use strict';
5
- var extendStatics = function (d, b) {
6
- extendStatics = Object.setPrototypeOf || {
7
- __proto__: []
8
- } instanceof Array && function (d, b) {
9
- d.__proto__ = b;
10
- } || function (d, b) {
11
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
12
- };
13
- return extendStatics(d, b);
14
- };
15
- function __extends(d, b) {
16
- extendStatics(d, b);
17
- function __() {
18
- this.constructor = d;
6
+
7
+ class StatsComponent extends eva_js.Component {
8
+ update() {
9
+ this.stats && this.stats.begin();
19
10
  }
20
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
21
11
  }
22
- var __assign = function () {
23
- __assign = Object.assign || function __assign(t) {
24
- for (var s, i = 1, n = arguments.length; i < n; i++) {
25
- s = arguments[i];
26
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
27
- }
28
- return t;
29
- };
30
- return __assign.apply(this, arguments);
31
- };
32
- var StatsComponent = function (_super) {
33
- __extends(StatsComponent, _super);
34
- function StatsComponent() {
35
- return _super !== null && _super.apply(this, arguments) || this;
36
- }
37
- StatsComponent.prototype.update = function () {
38
- this.stats && this.stats.begin();
39
- };
40
- StatsComponent.componentName = 'Stats';
41
- return StatsComponent;
42
- }(eva_js.Component);
43
- var Stats$2 = StatsComponent;
44
- var Stats = function (style) {
45
- style = __assign({
12
+ StatsComponent.componentName = 'Stats';
13
+ const Stats = function (style) {
14
+ style = _extends({
46
15
  width: 20,
47
16
  height: 12,
48
17
  x: 0,
49
18
  y: 0
50
19
  }, style);
51
- var width = style.width,
52
- height = style.height,
53
- x = style.x,
54
- y = style.y;
55
- var mode = 0;
56
- var container = document.createElement('div');
57
- 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;";
20
+ const {
21
+ width,
22
+ height,
23
+ x,
24
+ y
25
+ } = style;
26
+ let mode = 0;
27
+ const container = document.createElement('div');
28
+ 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;`;
58
29
  container.addEventListener('click', function (event) {
59
30
  event.preventDefault();
60
31
  showPanel(++mode % container.children.length);
@@ -64,19 +35,19 @@ var _EVA_IIFE_stats = function (exports, eva_js) {
64
35
  return panel;
65
36
  }
66
37
  function showPanel(id) {
67
- for (var i = 0; i < container.children.length; i++) {
38
+ for (let i = 0; i < container.children.length; i++) {
68
39
  container.children[i].style.display = i === id ? 'block' : 'none';
69
40
  }
70
41
  mode = id;
71
42
  }
72
- var beginTime = (performance || Date).now(),
43
+ let beginTime = (performance || Date).now(),
73
44
  prevTime = beginTime,
74
45
  frames = 0;
75
- var fpsPanel = addPanel(Stats.Panel('FPS', '#0ff', '#002'));
76
- var msPanel = addPanel(Stats.Panel('MS', '#0f0', '#020'));
77
- var dcPanel = addPanel(Stats.Panel('DrawCall', '#330570', '#A69700'));
78
- var tcPanel = addPanel(Stats.Panel('TC:', '#A62500', '#00B454'));
79
- var memPanel;
46
+ const fpsPanel = addPanel(Stats.Panel('FPS', '#0ff', '#002'));
47
+ const msPanel = addPanel(Stats.Panel('MS', '#0f0', '#020'));
48
+ const dcPanel = addPanel(Stats.Panel('DrawCall', '#330570', '#A69700'));
49
+ const tcPanel = addPanel(Stats.Panel('TC:', '#A62500', '#00B454'));
50
+ let memPanel;
80
51
  if (self.performance && self.performance.memory) {
81
52
  memPanel = addPanel(Stats.Panel('MB', '#f08', '#201'));
82
53
  }
@@ -91,7 +62,7 @@ var _EVA_IIFE_stats = function (exports, eva_js) {
91
62
  },
92
63
  end: function (hook) {
93
64
  frames++;
94
- var time = (performance || Date).now();
65
+ const time = (performance || Date).now();
95
66
  msPanel.update(time - beginTime, 200);
96
67
  if (hook) {
97
68
  dcPanel.update(hook.deltaDrawCalls, Math.max(50, hook.maxDeltaDrawCalls));
@@ -102,7 +73,7 @@ var _EVA_IIFE_stats = function (exports, eva_js) {
102
73
  prevTime = time;
103
74
  frames = 0;
104
75
  if (memPanel) {
105
- var memory = performance.memory;
76
+ const memory = performance.memory;
106
77
  memPanel.update(memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576);
107
78
  }
108
79
  }
@@ -116,11 +87,11 @@ var _EVA_IIFE_stats = function (exports, eva_js) {
116
87
  };
117
88
  };
118
89
  Stats.Panel = function (name, fg, bg) {
119
- var min = Infinity,
90
+ let min = Infinity,
120
91
  max = 0;
121
- var round = Math.round;
122
- var PR = round(window.devicePixelRatio || 1);
123
- var WIDTH = 80 * PR,
92
+ const round = Math.round;
93
+ const PR = round(window.devicePixelRatio || 1);
94
+ const WIDTH = 80 * PR,
124
95
  HEIGHT = 48 * PR,
125
96
  TEXT_X = 3 * PR,
126
97
  TEXT_Y = 2 * PR,
@@ -128,11 +99,11 @@ var _EVA_IIFE_stats = function (exports, eva_js) {
128
99
  GRAPH_Y = 15 * PR,
129
100
  GRAPH_WIDTH = 74 * PR,
130
101
  GRAPH_HEIGHT = 30 * PR;
131
- var canvas = document.createElement('canvas');
102
+ const canvas = document.createElement('canvas');
132
103
  canvas.width = WIDTH;
133
104
  canvas.height = HEIGHT;
134
105
  canvas.style.cssText = 'width:100%;height:100%';
135
- var context = canvas.getContext('2d');
106
+ const context = canvas.getContext('2d');
136
107
  context.font = 'bold ' + 9 * PR + 'px Helvetica,Arial,sans-serif';
137
108
  context.textBaseline = 'top';
138
109
  context.fillStyle = bg;
@@ -162,8 +133,8 @@ var _EVA_IIFE_stats = function (exports, eva_js) {
162
133
  };
163
134
  };
164
135
  var Stats$1 = Stats;
165
- var GLHook = function () {
166
- function GLHook(_gl) {
136
+ class GLHook {
137
+ constructor(_gl) {
167
138
  this.drawPasses = 0;
168
139
  this.isInit = false;
169
140
  this.realGLDrawElements = function () {};
@@ -178,25 +149,24 @@ var _EVA_IIFE_stats = function (exports, eva_js) {
178
149
  console.error("[GLHook] GL can't be NULL");
179
150
  }
180
151
  }
181
- GLHook.prototype.fakeGLdrawElements = function (context) {
152
+ fakeGLdrawElements(context) {
182
153
  return function (mode, count, type, offset) {
183
154
  context.drawPasses++;
184
155
  context.realGLDrawElements.call(this, mode, count, type, offset);
185
156
  };
186
- };
187
- GLHook.prototype.reset = function () {
157
+ }
158
+ reset() {
188
159
  this.drawPasses = 0;
189
- };
190
- GLHook.prototype.release = function () {
160
+ }
161
+ release() {
191
162
  if (this.isInit) {
192
163
  this.gl.__proto__.drawElements = this.realGLDrawElements;
193
164
  }
194
165
  this.isInit = false;
195
- };
196
- return GLHook;
197
- }();
198
- var TextureHook = function () {
199
- function TextureHook(_gl) {
166
+ }
167
+ }
168
+ class TextureHook {
169
+ constructor(_gl) {
200
170
  this.createdTextures = new Array();
201
171
  this.maxTexturesCount = 0;
202
172
  this.isInit = false;
@@ -215,25 +185,21 @@ var _EVA_IIFE_stats = function (exports, eva_js) {
215
185
  console.error("[TextureHook] GL can't be NULL");
216
186
  }
217
187
  }
218
- Object.defineProperty(TextureHook.prototype, "currentTextureCount", {
219
- get: function () {
220
- return this.createdTextures.length;
221
- },
222
- enumerable: false,
223
- configurable: true
224
- });
225
- TextureHook.prototype.registerTexture = function (texture) {
188
+ get currentTextureCount() {
189
+ return this.createdTextures.length;
190
+ }
191
+ registerTexture(texture) {
226
192
  this.createdTextures.push(texture);
227
193
  this.maxTexturesCount = Math.max(this.createdTextures.length, this.maxTexturesCount);
228
- };
229
- TextureHook.prototype.fakeGLCreateTexture = function (context) {
194
+ }
195
+ fakeGLCreateTexture(context) {
230
196
  return function () {
231
197
  var texture = context.realGLCreateTexture.call(this);
232
198
  context.registerTexture(texture);
233
199
  return texture;
234
200
  };
235
- };
236
- TextureHook.prototype.fakeGLDeleteTexture = function (context) {
201
+ }
202
+ fakeGLDeleteTexture(context) {
237
203
  return function (texture) {
238
204
  var index = context.createdTextures.indexOf(texture);
239
205
  if (index > -1) {
@@ -241,135 +207,106 @@ var _EVA_IIFE_stats = function (exports, eva_js) {
241
207
  }
242
208
  context.realGLDeleteTexture.call(this, texture);
243
209
  };
244
- };
245
- TextureHook.prototype.reset = function () {
210
+ }
211
+ reset() {
246
212
  this.createdTextures = new Array();
247
213
  this.maxTexturesCount = 0;
248
- };
249
- TextureHook.prototype.release = function () {
214
+ }
215
+ release() {
250
216
  if (this.isInit) {
251
217
  this.gl.__proto__.createTexture = this.realGLCreateTexture;
252
218
  this.gl.__proto__.deleteTexture = this.realGLDeleteTexture;
253
219
  console.log('[TextureHook] Hook was removed!');
254
220
  }
255
221
  this.isInit = false;
256
- };
257
- return TextureHook;
258
- }();
259
- var BaseHooks = function () {
260
- function BaseHooks() {
222
+ }
223
+ }
224
+ class BaseHooks {
225
+ constructor() {
261
226
  this._drawCalls = -1;
262
227
  this._maxDeltaDrawCalls = -1;
263
228
  }
264
- BaseHooks.prototype.attach = function (gl) {
229
+ attach(gl) {
265
230
  this.glhook = new GLHook(gl);
266
231
  this.texturehook = new TextureHook(gl);
267
- };
268
- Object.defineProperty(BaseHooks.prototype, "drawCalls", {
269
- get: function () {
270
- if (this.glhook && this.glhook.isInit) {
271
- return this.glhook.drawPasses;
272
- }
273
- return -1;
274
- },
275
- enumerable: false,
276
- configurable: true
277
- });
278
- Object.defineProperty(BaseHooks.prototype, "maxDeltaDrawCalls", {
279
- get: function () {
280
- return this._maxDeltaDrawCalls;
281
- },
282
- enumerable: false,
283
- configurable: true
284
- });
285
- Object.defineProperty(BaseHooks.prototype, "deltaDrawCalls", {
286
- get: function () {
287
- if (this._drawCalls == -1) {
288
- this._drawCalls = this.drawCalls;
289
- return 0;
290
- }
291
- var dc = this.drawCalls;
292
- var delta = dc - this._drawCalls;
293
- this._drawCalls = dc;
294
- this._maxDeltaDrawCalls = Math.max(this._maxDeltaDrawCalls, delta);
295
- return delta;
296
- },
297
- enumerable: false,
298
- configurable: true
299
- });
300
- Object.defineProperty(BaseHooks.prototype, "maxTextureCount", {
301
- get: function () {
302
- if (this.texturehook && this.texturehook.isInit) return this.texturehook.maxTexturesCount;
303
- return 0;
304
- },
305
- enumerable: false,
306
- configurable: true
307
- });
308
- Object.defineProperty(BaseHooks.prototype, "texturesCount", {
309
- get: function () {
310
- if (this.texturehook && this.texturehook.isInit) return this.texturehook.currentTextureCount;
232
+ }
233
+ get drawCalls() {
234
+ if (this.glhook && this.glhook.isInit) {
235
+ return this.glhook.drawPasses;
236
+ }
237
+ return -1;
238
+ }
239
+ get maxDeltaDrawCalls() {
240
+ return this._maxDeltaDrawCalls;
241
+ }
242
+ get deltaDrawCalls() {
243
+ if (this._drawCalls == -1) {
244
+ this._drawCalls = this.drawCalls;
311
245
  return 0;
312
- },
313
- enumerable: false,
314
- configurable: true
315
- });
316
- BaseHooks.prototype.reset = function () {
246
+ }
247
+ var dc = this.drawCalls;
248
+ var delta = dc - this._drawCalls;
249
+ this._drawCalls = dc;
250
+ this._maxDeltaDrawCalls = Math.max(this._maxDeltaDrawCalls, delta);
251
+ return delta;
252
+ }
253
+ get maxTextureCount() {
254
+ if (this.texturehook && this.texturehook.isInit) return this.texturehook.maxTexturesCount;
255
+ return 0;
256
+ }
257
+ get texturesCount() {
258
+ if (this.texturehook && this.texturehook.isInit) return this.texturehook.currentTextureCount;
259
+ return 0;
260
+ }
261
+ reset() {
317
262
  this._maxDeltaDrawCalls = -1;
318
263
  this._drawCalls = -1;
319
264
  if (this.glhook) this.glhook.reset();
320
265
  if (this.texturehook) this.texturehook.reset();
321
- };
322
- BaseHooks.prototype.release = function () {
266
+ }
267
+ release() {
323
268
  if (this.glhook) this.glhook.release();
324
269
  if (this.texturehook) this.texturehook.release();
325
- };
326
- return BaseHooks;
327
- }();
328
- var StatsSystem = function (_super) {
329
- __extends(StatsSystem, _super);
330
- function StatsSystem() {
331
- var _this = _super !== null && _super.apply(this, arguments) || this;
332
- _this.show = true;
333
- return _this;
334
270
  }
335
- StatsSystem.prototype.init = function (param) {
336
- if (param === void 0) {
337
- param = {
338
- show: true
339
- };
340
- }
271
+ }
272
+ class StatsSystem extends eva_js.System {
273
+ constructor() {
274
+ super(...arguments);
275
+ this.show = true;
276
+ }
277
+ init(param = {
278
+ show: true
279
+ }) {
341
280
  this.show = param.show;
342
281
  this.style = param.style;
343
282
  this.renderSystem = this.game.getSystem('Renderer');
344
283
  this.app = this.renderSystem.application;
345
284
  if (this.app && this.show) {
346
- var gl = this.app.renderer.gl;
285
+ const gl = this.app.renderer.gl;
347
286
  this.hook = new BaseHooks();
348
287
  this.hook.attach(gl);
349
288
  }
350
- };
351
- StatsSystem.prototype.start = function () {
289
+ }
290
+ start() {
352
291
  if (!this.show) return;
353
- this.component = this.game.scene.addComponent(new Stats$2());
292
+ this.component = this.game.scene.addComponent(new StatsComponent());
354
293
  this.stats = Stats$1(this.style);
355
294
  this.component.stats = this.stats;
356
295
  this.stats.showPanel(0);
357
296
  document.body.appendChild(this.stats.dom);
358
- };
359
- StatsSystem.prototype.lateUpdate = function () {
297
+ }
298
+ lateUpdate() {
360
299
  if (!this.show) return;
361
300
  this.stats && this.stats.end(this.hook);
362
- };
363
- StatsSystem.systemName = 'Stats';
364
- return StatsSystem;
365
- }(eva_js.System);
366
- var StatsSystem$1 = StatsSystem;
301
+ }
302
+ }
303
+ StatsSystem.systemName = 'Stats';
367
304
  var index = {
368
- Components: [Stats$2],
369
- Systems: [StatsSystem$1]
305
+ Components: [StatsComponent],
306
+ Systems: [StatsSystem]
370
307
  };
371
- exports.Stats = Stats$2;
372
- exports.StatsSystem = StatsSystem$1;
308
+ exports.Stats = StatsComponent;
309
+ exports.StatsSystem = StatsSystem;
373
310
  exports["default"] = index;
374
311
  Object.defineProperty(exports, '__esModule', {
375
312
  value: true
@@ -1 +1 @@
1
- window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{};var _EVA_IIFE_stats=function(t,e){"use strict";var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},r(t,e)};function o(t,e){function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var n=function(){return n=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},n.apply(this,arguments)},i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.update=function(){this.stats&&this.stats.begin()},e.componentName="Stats",e}(e.Component),s=i,a=function(t){var e=(t=n({width:20,height:12,x:0,y:0},t)).width,r=t.height,o=t.x,i=t.y,s=0,l=document.createElement("div");function u(t){return l.appendChild(t.dom),t}function h(t){for(var e=0;e<l.children.length;e++)l.children[e].style.display=e===t?"block":"none";s=t}l.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000;width: "+e+"vw;height: "+r+"vw;left: "+o+"vw;top: "+i+"vw;",l.addEventListener("click",(function(t){t.preventDefault(),h(++s%l.children.length)}),!1);var c,p=(performance||Date).now(),f=p,d=0,x=u(a.Panel("FPS","#0ff","#002")),w=u(a.Panel("MS","#0f0","#020")),m=u(a.Panel("DrawCall","#330570","#A69700")),_=u(a.Panel("TC:","#A62500","#00B454"));return self.performance&&self.performance.memory&&(c=u(a.Panel("MB","#f08","#201"))),h(0),{REVISION:16,dom:l,addPanel:u,showPanel:h,begin:function(t){p=t||(performance||Date).now()},end:function(t){d++;var e=(performance||Date).now();if(w.update(e-p,200),t&&(m.update(t.deltaDrawCalls,Math.max(50,t.maxDeltaDrawCalls)),_.update(t.texturesCount,Math.max(20,t.maxTextureCount))),e>=f+1e3&&(x.update(1e3*d/(e-f),100),f=e,d=0,c)){var r=performance.memory;c.update(r.usedJSHeapSize/1048576,r.jsHeapSizeLimit/1048576)}return e},update:function(){p=this.end()},domElement:l,setMode:h}};a.Panel=function(t,e,r){var o=1/0,n=0,i=Math.round,s=i(window.devicePixelRatio||1),a=80*s,l=48*s,u=3*s,h=2*s,c=3*s,p=15*s,f=74*s,d=30*s,x=document.createElement("canvas");x.width=a,x.height=l,x.style.cssText="width:100%;height:100%";var w=x.getContext("2d");return w.font="bold "+9*s+"px Helvetica,Arial,sans-serif",w.textBaseline="top",w.fillStyle=r,w.fillRect(0,0,a,l),w.fillStyle=e,w.fillText(t,u,h),w.fillRect(c,p,f,d),w.fillStyle=r,w.globalAlpha=.9,w.fillRect(c,p,f,d),{dom:x,update:function(l,m){o=Math.min(o,l),n=Math.max(n,l),w.fillStyle=r,w.globalAlpha=1,w.fillRect(0,0,a,p),w.fillStyle=e,w.fillText(i(l)+" "+t+" ("+i(o)+"-"+i(n)+")",u,h),w.drawImage(x,c+s,p,f-s,d,c,p,f-s,d),w.fillRect(c+f-s,p,s,d),w.fillStyle=r,w.globalAlpha=.9,w.fillRect(c+f-s,p,s,i((1-l/m)*d))}}};var l=a,u=function(){function t(t){this.drawPasses=0,this.isInit=!1,this.realGLDrawElements=function(){},t?t.__proto__.drawElements&&(this.gl=t,this.realGLDrawElements=t.__proto__.drawElements,t.__proto__.drawElements=this.fakeGLdrawElements(this),this.isInit=!0):console.error("[GLHook] GL can't be NULL")}return t.prototype.fakeGLdrawElements=function(t){return function(e,r,o,n){t.drawPasses++,t.realGLDrawElements.call(this,e,r,o,n)}},t.prototype.reset=function(){this.drawPasses=0},t.prototype.release=function(){this.isInit&&(this.gl.__proto__.drawElements=this.realGLDrawElements),this.isInit=!1},t}(),h=function(){function t(t){this.createdTextures=new Array,this.maxTexturesCount=0,this.isInit=!1,this.realGLCreateTexture=function(){},this.realGLDeleteTexture=function(){},t?t.__proto__.createTexture&&(this.gl=t,this.realGLCreateTexture=t.__proto__.createTexture,this.realGLDeleteTexture=t.__proto__.deleteTexture,t.__proto__.createTexture=this.fakeGLCreateTexture(this),t.__proto__.deleteTexture=this.fakeGLDeleteTexture(this),this.isInit=!0):console.error("[TextureHook] GL can't be NULL")}return Object.defineProperty(t.prototype,"currentTextureCount",{get:function(){return this.createdTextures.length},enumerable:!1,configurable:!0}),t.prototype.registerTexture=function(t){this.createdTextures.push(t),this.maxTexturesCount=Math.max(this.createdTextures.length,this.maxTexturesCount)},t.prototype.fakeGLCreateTexture=function(t){return function(){var e=t.realGLCreateTexture.call(this);return t.registerTexture(e),e}},t.prototype.fakeGLDeleteTexture=function(t){return function(e){var r=t.createdTextures.indexOf(e);r>-1&&t.createdTextures.splice(r,1),t.realGLDeleteTexture.call(this,e)}},t.prototype.reset=function(){this.createdTextures=new Array,this.maxTexturesCount=0},t.prototype.release=function(){this.isInit&&(this.gl.__proto__.createTexture=this.realGLCreateTexture,this.gl.__proto__.deleteTexture=this.realGLDeleteTexture,console.log("[TextureHook] Hook was removed!")),this.isInit=!1},t}(),c=function(){function t(){this._drawCalls=-1,this._maxDeltaDrawCalls=-1}return t.prototype.attach=function(t){this.glhook=new u(t),this.texturehook=new h(t)},Object.defineProperty(t.prototype,"drawCalls",{get:function(){return this.glhook&&this.glhook.isInit?this.glhook.drawPasses:-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxDeltaDrawCalls",{get:function(){return this._maxDeltaDrawCalls},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deltaDrawCalls",{get:function(){if(-1==this._drawCalls)return this._drawCalls=this.drawCalls,0;var t=this.drawCalls,e=t-this._drawCalls;return this._drawCalls=t,this._maxDeltaDrawCalls=Math.max(this._maxDeltaDrawCalls,e),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxTextureCount",{get:function(){return this.texturehook&&this.texturehook.isInit?this.texturehook.maxTexturesCount:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texturesCount",{get:function(){return this.texturehook&&this.texturehook.isInit?this.texturehook.currentTextureCount:0},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this._maxDeltaDrawCalls=-1,this._drawCalls=-1,this.glhook&&this.glhook.reset(),this.texturehook&&this.texturehook.reset()},t.prototype.release=function(){this.glhook&&this.glhook.release(),this.texturehook&&this.texturehook.release()},t}(),p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.show=!0,e}return o(e,t),e.prototype.init=function(t){if(void 0===t&&(t={show:!0}),this.show=t.show,this.style=t.style,this.renderSystem=this.game.getSystem("Renderer"),this.app=this.renderSystem.application,this.app&&this.show){var e=this.app.renderer.gl;this.hook=new c,this.hook.attach(e)}},e.prototype.start=function(){this.show&&(this.component=this.game.scene.addComponent(new s),this.stats=l(this.style),this.component.stats=this.stats,this.stats.showPanel(0),document.body.appendChild(this.stats.dom))},e.prototype.lateUpdate=function(){this.show&&this.stats&&this.stats.end(this.hook)},e.systemName="Stats",e}(e.System),f=p,d={Components:[s],Systems:[f]};return t.Stats=s,t.StatsSystem=f,t.default=d,Object.defineProperty(t,"__esModule",{value:!0}),t}({},EVA);window.EVA.plugin.stats=window.EVA.plugin.stats||_EVA_IIFE_stats;
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var r in s)({}).hasOwnProperty.call(s,r)&&(t[r]=s[r])}return t},_extends.apply(null,arguments)}window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{};var _EVA_IIFE_stats=function(t,e){"use strict";class s extends e.Component{update(){this.stats&&this.stats.begin()}}s.componentName="Stats";const r=function(t){t=_extends({width:20,height:12,x:0,y:0},t);const{width:e,height:s,x:a,y:i}=t;let l=0;const n=document.createElement("div");function o(t){return n.appendChild(t.dom),t}function h(t){for(let e=0;e<n.children.length;e++)n.children[e].style.display=e===t?"block":"none";l=t}n.style.cssText=`position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000;width: ${e}vw;height: ${s}vw;left: ${a}vw;top: ${i}vw;`,n.addEventListener("click",(function(t){t.preventDefault(),h(++l%n.children.length)}),!1);let u=(performance||Date).now(),c=u,d=0;const x=o(r.Panel("FPS","#0ff","#002")),w=o(r.Panel("MS","#0f0","#020")),m=o(r.Panel("DrawCall","#330570","#A69700")),p=o(r.Panel("TC:","#A62500","#00B454"));let _;return self.performance&&self.performance.memory&&(_=o(r.Panel("MB","#f08","#201"))),h(0),{REVISION:16,dom:n,addPanel:o,showPanel:h,begin:function(t){u=t||(performance||Date).now()},end:function(t){d++;const e=(performance||Date).now();if(w.update(e-u,200),t&&(m.update(t.deltaDrawCalls,Math.max(50,t.maxDeltaDrawCalls)),p.update(t.texturesCount,Math.max(20,t.maxTextureCount))),e>=c+1e3&&(x.update(1e3*d/(e-c),100),c=e,d=0,_)){const t=performance.memory;_.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){u=this.end()},domElement:n,setMode:h}};r.Panel=function(t,e,s){let r=1/0,a=0;const i=Math.round,l=i(window.devicePixelRatio||1),n=80*l,o=48*l,h=3*l,u=2*l,c=3*l,d=15*l,x=74*l,w=30*l,m=document.createElement("canvas");m.width=n,m.height=o,m.style.cssText="width:100%;height:100%";const p=m.getContext("2d");return p.font="bold "+9*l+"px Helvetica,Arial,sans-serif",p.textBaseline="top",p.fillStyle=s,p.fillRect(0,0,n,o),p.fillStyle=e,p.fillText(t,h,u),p.fillRect(c,d,x,w),p.fillStyle=s,p.globalAlpha=.9,p.fillRect(c,d,x,w),{dom:m,update:function(o,_){r=Math.min(r,o),a=Math.max(a,o),p.fillStyle=s,p.globalAlpha=1,p.fillRect(0,0,n,d),p.fillStyle=e,p.fillText(i(o)+" "+t+" ("+i(r)+"-"+i(a)+")",h,u),p.drawImage(m,c+l,d,x-l,w,c,d,x-l,w),p.fillRect(c+x-l,d,l,w),p.fillStyle=s,p.globalAlpha=.9,p.fillRect(c+x-l,d,l,i((1-o/_)*w))}}};var a=r;class i{constructor(t){this.drawPasses=0,this.isInit=!1,this.realGLDrawElements=function(){},t?t.__proto__.drawElements&&(this.gl=t,this.realGLDrawElements=t.__proto__.drawElements,t.__proto__.drawElements=this.fakeGLdrawElements(this),this.isInit=!0):console.error("[GLHook] GL can't be NULL")}fakeGLdrawElements(t){return function(e,s,r,a){t.drawPasses++,t.realGLDrawElements.call(this,e,s,r,a)}}reset(){this.drawPasses=0}release(){this.isInit&&(this.gl.__proto__.drawElements=this.realGLDrawElements),this.isInit=!1}}class l{constructor(t){this.createdTextures=new Array,this.maxTexturesCount=0,this.isInit=!1,this.realGLCreateTexture=function(){},this.realGLDeleteTexture=function(){},t?t.__proto__.createTexture&&(this.gl=t,this.realGLCreateTexture=t.__proto__.createTexture,this.realGLDeleteTexture=t.__proto__.deleteTexture,t.__proto__.createTexture=this.fakeGLCreateTexture(this),t.__proto__.deleteTexture=this.fakeGLDeleteTexture(this),this.isInit=!0):console.error("[TextureHook] GL can't be NULL")}get currentTextureCount(){return this.createdTextures.length}registerTexture(t){this.createdTextures.push(t),this.maxTexturesCount=Math.max(this.createdTextures.length,this.maxTexturesCount)}fakeGLCreateTexture(t){return function(){var e=t.realGLCreateTexture.call(this);return t.registerTexture(e),e}}fakeGLDeleteTexture(t){return function(e){var s=t.createdTextures.indexOf(e);s>-1&&t.createdTextures.splice(s,1),t.realGLDeleteTexture.call(this,e)}}reset(){this.createdTextures=new Array,this.maxTexturesCount=0}release(){this.isInit&&(this.gl.__proto__.createTexture=this.realGLCreateTexture,this.gl.__proto__.deleteTexture=this.realGLDeleteTexture,console.log("[TextureHook] Hook was removed!")),this.isInit=!1}}class n{constructor(){this._drawCalls=-1,this._maxDeltaDrawCalls=-1}attach(t){this.glhook=new i(t),this.texturehook=new l(t)}get drawCalls(){return this.glhook&&this.glhook.isInit?this.glhook.drawPasses:-1}get maxDeltaDrawCalls(){return this._maxDeltaDrawCalls}get deltaDrawCalls(){if(-1==this._drawCalls)return this._drawCalls=this.drawCalls,0;var t=this.drawCalls,e=t-this._drawCalls;return this._drawCalls=t,this._maxDeltaDrawCalls=Math.max(this._maxDeltaDrawCalls,e),e}get maxTextureCount(){return this.texturehook&&this.texturehook.isInit?this.texturehook.maxTexturesCount:0}get texturesCount(){return this.texturehook&&this.texturehook.isInit?this.texturehook.currentTextureCount:0}reset(){this._maxDeltaDrawCalls=-1,this._drawCalls=-1,this.glhook&&this.glhook.reset(),this.texturehook&&this.texturehook.reset()}release(){this.glhook&&this.glhook.release(),this.texturehook&&this.texturehook.release()}}class o extends e.System{constructor(){super(...arguments),this.show=!0}init(t={show:!0}){if(this.show=t.show,this.style=t.style,this.renderSystem=this.game.getSystem("Renderer"),this.app=this.renderSystem.application,this.app&&this.show){const t=this.app.renderer.gl;this.hook=new n,this.hook.attach(t)}}start(){this.show&&(this.component=this.game.scene.addComponent(new s),this.stats=a(this.style),this.component.stats=this.stats,this.stats.showPanel(0),document.body.appendChild(this.stats.dom))}lateUpdate(){this.show&&this.stats&&this.stats.end(this.hook)}}o.systemName="Stats";var h={Components:[s],Systems:[o]};return t.Stats=s,t.StatsSystem=o,t.default=h,Object.defineProperty(t,"__esModule",{value:!0}),t}({},EVA);window.EVA.plugin.stats=window.EVA.plugin.stats||_EVA_IIFE_stats;