@galacean/effects-plugin-stats 2.4.3 → 2.4.4

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.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime stats for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 云垣
6
- * Version: v2.4.3
6
+ * Version: v2.4.4
7
7
  */
8
8
 
9
9
  'use strict';
@@ -752,7 +752,7 @@ var json = {
752
752
 
753
753
  /**
754
754
  * 插件版本号
755
- */ var version = "2.4.3";
755
+ */ var version = "2.4.4";
756
756
  EFFECTS.logger.info("Plugin stats version: " + version + ".");
757
757
  if (version !== EFFECTS__namespace.version) {
758
758
  console.error("注意:请统一 Stats 插件与 Player 版本,不统一的版本混用会有不可预知的后果!", "\nAttention: Please ensure the Stats plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");
package/dist/index.min.js CHANGED
@@ -3,6 +3,6 @@
3
3
  * Description: Galacean Effects runtime stats for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 云垣
6
- * Version: v2.4.3
7
- */function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@galacean/effects")):"function"==typeof define&&define.amd?define(["exports","@galacean/effects"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).ge=e.ge||{},e.ge.statsPlugin={}),e.ge)}(this,function(e,t){"use strict";var r=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(t);function n(e,t,r,n,s,o,i){try{var a=e[o](i),h=a.value}catch(e){r(e);return}a.done?t(h):Promise.resolve(h).then(n,s)}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}"function"==typeof SuppressedError&&SuppressedError;var i=function(){function e(e,t){this.gl=e,this.debug=t,this.drawCall=0,this.triangles=0,this.lines=0,this.points=0,this.hooked=!0,this.realDrawElements=e.drawElements,this.realDrawArrays=e.drawArrays,e.drawElements=this.hookedDrawElements.bind(this),e.drawArrays=this.hookedDrawArrays.bind(this),t&&console.debug("DrawCall is hooked.")}var t=e.prototype;return t.hookedDrawElements=function(e,t,r,n){this.realDrawElements.call(this.gl,e,t,r,n),this.update(t,e)},t.hookedDrawArrays=function(e,t,r){this.realDrawArrays.call(this.gl,e,t,r),this.update(r,e)},t.update=function(e,t){var r=this.gl;switch(this.drawCall++,t){case r.TRIANGLES:this.triangles+=e/3;break;case r.TRIANGLE_STRIP:case r.TRIANGLE_FAN:this.triangles+=e-2;break;case r.LINES:this.lines+=e/2;break;case r.LINE_STRIP:this.lines+=e-1;break;case r.LINE_LOOP:this.lines+=e;break;case r.POINTS:this.points+=e;break;default:console.error("Unknown draw mode: "+t+". Count: "+e)}},t.reset=function(){this.drawCall=0,this.triangles=0,this.lines=0,this.points=0},t.release=function(){this.hooked&&(this.gl.drawElements=this.realDrawElements,this.gl.drawArrays=this.realDrawArrays,this.hooked=!1)},e}(),a=function(){function e(e,t){this.gl=e,this.debug=t,this.programs=0,this.hooked=!0,this.realUseProgram=e.useProgram,e.useProgram=this.hookedUseProgram.bind(this),t&&console.debug("Program is hooked.")}var t=e.prototype;return t.hookedUseProgram=function(e){this.realUseProgram.call(this.gl,e),this.programs++,this.debug&&console.debug("UseProgram: "+e+", program: "+this.programs+".")},t.reset=function(){this.programs=0},t.release=function(){this.hooked&&(this.gl.useProgram=this.realUseProgram,this.hooked=!1)},e}(),h=function(){function e(e,t){this.gl=e,this.debug=t,this.shaders=0,this.hooked=!0,this.realAttachShader=e.attachShader,this.realDetachShader=e.detachShader,e.attachShader=this.hookedAttachShader.bind(this),e.detachShader=this.hookedDetachShader.bind(this),t&&console.debug("Shader is hooked.")}var t=e.prototype;return t.hookedAttachShader=function(e,t){this.realAttachShader.call(this.gl,e,t),this.shaders++,this.debug&&console.debug("AttachShader: "+t+". shaders: "+this.shaders)},t.hookedDetachShader=function(e,t){this.realDetachShader.call(this.gl,e,t),this.shaders--,this.debug&&console.debug("DetachShader. shaders: "+this.shaders)},t.reset=function(){this.shaders=0},t.release=function(){this.hooked&&(this.gl.attachShader=this.realAttachShader,this.gl.detachShader=this.realDetachShader,this.hooked=!1)},e}(),l=function(){function e(e,t){this.gl=e,this.debug=t,this.textures=0,this.hooked=!0,this.realCreateTexture=e.createTexture,this.realDeleteTexture=e.deleteTexture,e.createTexture=this.hookedCreateTexture.bind(this),e.deleteTexture=this.hookedDeleteTexture.bind(this),t&&console.debug("Texture is hooked.")}var t=e.prototype;return t.hookedCreateTexture=function(){var e=this.realCreateTexture.call(this.gl);return this.textures++,this.debug&&console.debug("CreateTexture: "+e+", textures: "+this.textures+"."),e},t.hookedDeleteTexture=function(e){this.realDeleteTexture.call(this.gl,e),this.textures--,this.debug&&console.debug("DeleteTexture, textures: "+this.textures+".")},t.reset=function(){this.textures=0},t.release=function(){this.hooked&&(this.gl.createTexture=this.realCreateTexture,this.gl.deleteTexture=this.realDeleteTexture,this.hooked=!1)},e}(),d=function(){function e(e,t){if(void 0===t&&(t=!1),this.gl=e,this.samplingFrames=60,this.samplingIndex=0,this.updateCounter=0,this.updateTime=0,!e)throw Error("Unsupported WebGL context.");this.hook(e,t)}var t=e.prototype;return t.hook=function(e,t){this.drawCallHook=new i(e,t),this.textureHook=new l(e,t),this.shaderHook=new h(e,t),this.programHook=new a(e,t)},t.reset=function(){var e,t;null==(e=this.drawCallHook)||e.reset(),null==(t=this.programHook)||t.reset()},t.release=function(){var e,t,r,n;null==(e=this.drawCallHook)||e.release(),null==(t=this.textureHook)||t.release(),null==(r=this.shaderHook)||r.release(),null==(n=this.programHook)||n.release()},t.update=function(e){var t=performance.now();if(this.updateCounter++,!(t-this.updateTime<1e3)){if(this.samplingIndex!==this.samplingFrames){this.reset(),this.samplingIndex++;return}this.samplingIndex=0;var r={fps:Math.round(1e3*this.updateCounter/(t-this.updateTime)),memory:performance.memory&&performance.memory.usedJSHeapSize/1048576>>0,drawCall:0===this.drawCallHook.drawCall?0:this.drawCallHook.drawCall,triangles:0===this.drawCallHook.triangles?0:this.drawCallHook.triangles,lines:this.drawCallHook.lines,points:this.drawCallHook.points,textures:this.textureHook.textures,shaders:0===this.shaderHook.shaders?0:this.shaderHook.shaders,programs:this.programHook.programs,webglContext:!function e(t,r){return null!=r&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](t):e(t,r)}(this.gl,WebGL2RenderingContext)?"1.0":"2.0"};return this.reset(),this.updateCounter=0,this.updateTime=t,r}},e}(),u="\n .gl-perf {\n pointer-events: none;\n user-select: none;\n position: absolute;\n top: 0;\n left: 0;\n padding: "+10/7.5+"vh "+10/7.5+"vh 0 "+10/7.5+"vh;\n background: rgba(0, 0, 0, 0.3);\n color: #fff;\n font: "+10/7.5+"vh arial;\n }\n\n .gl-perf dl,\n .gl-perf dt,\n .gl-perf dd {\n padding: 0;\n margin: 0;\n }\n\n .gl-perf dt {\n color: #fff;\n text-shadow: #000 0 0 1px;\n }\n\n .gl-perf dt .unit{\n font-size: "+10/7.5+"vh;\n }\n\n .gl-perf dd {\n font-size: "+20/7.5+"vh;\n padding: "+10/7.5+"vh 0 "+10/7.5+"vh;\n }\n",c=function(){function e(e,t){this.options=t,this.items=["fps","memory","drawCall","triangles","textures","shaders","programs","webglContext"],this.data={fps:60,memory:0,drawCall:0,triangles:0,lines:0,points:0,textures:0,shaders:0,programs:0,webglContext:"2.0"},this.core=new d(e,t.debug),this.createContainer(),this.update=this.update.bind(this)}var t=e.prototype;return t.createContainer=function(){var e=document.createElement("div");this.container=e,this.options.visible||this.hide(),e.classList.add("gl-perf"),e.innerHTML='\n <dl>\n <dt>FPS</dt>\n <dd>0</dd>\n <dt>Memory <span class="unit">(MB)</span></dt>\n <dd>0</dd>\n <dt>DrawCall</dt>\n <dd>0</dd>\n <dt>Triangles</dt>\n <dd>0</dd>\n <dt>Textures</dt>\n <dd>0</dd>\n <dt>Shaders</dt>\n <dd>0</dd>\n <dt>Program</dt>\n <dd>0</dd>\n <dt>WebGL</dt>\n <dd></dd>\n </dl>\n',e.appendChild(this.createStyle()),this.options.container.appendChild(e),this.doms=Array.prototype.slice.apply(e.querySelectorAll("dd"))},t.createStyle=function(){var e=document.createElement("style");return e.appendChild(document.createTextNode(u)),e},t.update=function(e){var t,r=this.core.update(e);if(r&&0!==r.triangles)for(var n=0,s=this.items.length;n<s;n++)t=this,function(e,n){var s=t.doms[e],o=r[t.items[e]]||0;requestAnimationFrame(function(){s.innerText=String(o)})}(n)},t.hide=function(){this.container.style.display="none"},t.show=function(){this.container.style.display="block"},t.reset=function(){var e;this.core.reset();for(var t=0,r=this.items.length;t<r;t++)e=this,function(t,r){var n=e.doms[t],s=e.items[t],o=e.data[s]||0;requestAnimationFrame(function(){n.innerText=String(o)})}(t)},t.release=function(){this.core.release()},t.dispose=function(){this.release(),this.container.remove()},e}(),p=function(e){function t(){return e.apply(this,arguments)}!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(t,e);var r=t.prototype;return r.init=function(e){var t=this.engine.renderer.pipelineContext.gl;this.monitor=new c(t,e)},r.onUpdate=function(e){this.monitor.update(e)},r.dispose=function(){e.prototype.dispose.call(this),this.monitor.dispose()},t}(t.Behaviour),f={debug:!1,visible:!0,container:document.body},g={images:[],fonts:[],version:"3.0",shapes:[],plugins:[],type:"ge",compositions:[{id:"2",name:"stats",duration:5,startTime:0,endBehavior:2,previewSize:[750,1624],items:[{id:"05e1c616baf34cc084968a05703719cd"}],camera:{fov:60,far:40,near:.1,clipMode:1,position:[0,0,8],rotation:[0,0,0]},sceneBindings:[]}],components:[],geometries:[],materials:[],items:[{id:"05e1c616baf34cc084968a05703719cd",name:"component",duration:99999,type:"3",visible:!0,endBehavior:0,delay:0,renderLevel:"B+",components:[],transform:{position:{x:0,y:0,z:0},eulerHint:{x:0,y:0,z:0},anchor:{x:0,y:0},size:{x:1.2,y:1.2},scale:{x:1,y:1,z:1}},dataType:"VFXItemData"}],shaders:[],bins:[],textures:[],animations:[],compositionId:"2"},m=function(){function e(e,t){this.player=e,this.options=t,this.disposed=!1,this.init()}var t=e.prototype;return t.init=function(){var e,t=this;return(e=function(){var e;return function(e,t){var r,n,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(h){return function(a){if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(s=(s=o.trys).length>0&&s[s.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,h])}}}(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.player.loadScene(g)];case 1:return(e=r.sent().getItemByName("component"))&&(e.addComponent(p).init(s({},f,t.options)),t.component=e.getComponent(p)),[3,3];case 2:throw Error("Failed to load stats scene: "+r.sent().message+".");case 3:return[2]}})},function(){var t=this,r=arguments;return new Promise(function(s,o){var i=e.apply(t,r);function a(e){n(i,s,o,a,h,"next",e)}function h(e){n(i,s,o,a,h,"throw",e)}a(void 0)})})()},t.hide=function(){var e;null==(e=this.component)||e.monitor.hide()},t.show=function(){var e;null==(e=this.component)||e.monitor.show()},t.dispose=function(){var e;this.disposed||(this.disposed=!0,null==(e=this.component)||e.dispose(),this.component=void 0)},e}(),b="2.4.3";t.logger.info("Plugin stats version: "+b+"."),b!==r.version&&console.error("注意:请统一 Stats 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Stats plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),e.Stats=m,e.version=b,Object.defineProperty(e,"__esModule",{value:!0})});
6
+ * Version: v2.4.4
7
+ */function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@galacean/effects")):"function"==typeof define&&define.amd?define(["exports","@galacean/effects"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).ge=e.ge||{},e.ge.statsPlugin={}),e.ge)}(this,function(e,t){"use strict";var r=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(t);function n(e,t,r,n,s,o,i){try{var a=e[o](i),h=a.value}catch(e){r(e);return}a.done?t(h):Promise.resolve(h).then(n,s)}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}"function"==typeof SuppressedError&&SuppressedError;var i=function(){function e(e,t){this.gl=e,this.debug=t,this.drawCall=0,this.triangles=0,this.lines=0,this.points=0,this.hooked=!0,this.realDrawElements=e.drawElements,this.realDrawArrays=e.drawArrays,e.drawElements=this.hookedDrawElements.bind(this),e.drawArrays=this.hookedDrawArrays.bind(this),t&&console.debug("DrawCall is hooked.")}var t=e.prototype;return t.hookedDrawElements=function(e,t,r,n){this.realDrawElements.call(this.gl,e,t,r,n),this.update(t,e)},t.hookedDrawArrays=function(e,t,r){this.realDrawArrays.call(this.gl,e,t,r),this.update(r,e)},t.update=function(e,t){var r=this.gl;switch(this.drawCall++,t){case r.TRIANGLES:this.triangles+=e/3;break;case r.TRIANGLE_STRIP:case r.TRIANGLE_FAN:this.triangles+=e-2;break;case r.LINES:this.lines+=e/2;break;case r.LINE_STRIP:this.lines+=e-1;break;case r.LINE_LOOP:this.lines+=e;break;case r.POINTS:this.points+=e;break;default:console.error("Unknown draw mode: "+t+". Count: "+e)}},t.reset=function(){this.drawCall=0,this.triangles=0,this.lines=0,this.points=0},t.release=function(){this.hooked&&(this.gl.drawElements=this.realDrawElements,this.gl.drawArrays=this.realDrawArrays,this.hooked=!1)},e}(),a=function(){function e(e,t){this.gl=e,this.debug=t,this.programs=0,this.hooked=!0,this.realUseProgram=e.useProgram,e.useProgram=this.hookedUseProgram.bind(this),t&&console.debug("Program is hooked.")}var t=e.prototype;return t.hookedUseProgram=function(e){this.realUseProgram.call(this.gl,e),this.programs++,this.debug&&console.debug("UseProgram: "+e+", program: "+this.programs+".")},t.reset=function(){this.programs=0},t.release=function(){this.hooked&&(this.gl.useProgram=this.realUseProgram,this.hooked=!1)},e}(),h=function(){function e(e,t){this.gl=e,this.debug=t,this.shaders=0,this.hooked=!0,this.realAttachShader=e.attachShader,this.realDetachShader=e.detachShader,e.attachShader=this.hookedAttachShader.bind(this),e.detachShader=this.hookedDetachShader.bind(this),t&&console.debug("Shader is hooked.")}var t=e.prototype;return t.hookedAttachShader=function(e,t){this.realAttachShader.call(this.gl,e,t),this.shaders++,this.debug&&console.debug("AttachShader: "+t+". shaders: "+this.shaders)},t.hookedDetachShader=function(e,t){this.realDetachShader.call(this.gl,e,t),this.shaders--,this.debug&&console.debug("DetachShader. shaders: "+this.shaders)},t.reset=function(){this.shaders=0},t.release=function(){this.hooked&&(this.gl.attachShader=this.realAttachShader,this.gl.detachShader=this.realDetachShader,this.hooked=!1)},e}(),l=function(){function e(e,t){this.gl=e,this.debug=t,this.textures=0,this.hooked=!0,this.realCreateTexture=e.createTexture,this.realDeleteTexture=e.deleteTexture,e.createTexture=this.hookedCreateTexture.bind(this),e.deleteTexture=this.hookedDeleteTexture.bind(this),t&&console.debug("Texture is hooked.")}var t=e.prototype;return t.hookedCreateTexture=function(){var e=this.realCreateTexture.call(this.gl);return this.textures++,this.debug&&console.debug("CreateTexture: "+e+", textures: "+this.textures+"."),e},t.hookedDeleteTexture=function(e){this.realDeleteTexture.call(this.gl,e),this.textures--,this.debug&&console.debug("DeleteTexture, textures: "+this.textures+".")},t.reset=function(){this.textures=0},t.release=function(){this.hooked&&(this.gl.createTexture=this.realCreateTexture,this.gl.deleteTexture=this.realDeleteTexture,this.hooked=!1)},e}(),d=function(){function e(e,t){if(void 0===t&&(t=!1),this.gl=e,this.samplingFrames=60,this.samplingIndex=0,this.updateCounter=0,this.updateTime=0,!e)throw Error("Unsupported WebGL context.");this.hook(e,t)}var t=e.prototype;return t.hook=function(e,t){this.drawCallHook=new i(e,t),this.textureHook=new l(e,t),this.shaderHook=new h(e,t),this.programHook=new a(e,t)},t.reset=function(){var e,t;null==(e=this.drawCallHook)||e.reset(),null==(t=this.programHook)||t.reset()},t.release=function(){var e,t,r,n;null==(e=this.drawCallHook)||e.release(),null==(t=this.textureHook)||t.release(),null==(r=this.shaderHook)||r.release(),null==(n=this.programHook)||n.release()},t.update=function(e){var t=performance.now();if(this.updateCounter++,!(t-this.updateTime<1e3)){if(this.samplingIndex!==this.samplingFrames){this.reset(),this.samplingIndex++;return}this.samplingIndex=0;var r={fps:Math.round(1e3*this.updateCounter/(t-this.updateTime)),memory:performance.memory&&performance.memory.usedJSHeapSize/1048576>>0,drawCall:0===this.drawCallHook.drawCall?0:this.drawCallHook.drawCall,triangles:0===this.drawCallHook.triangles?0:this.drawCallHook.triangles,lines:this.drawCallHook.lines,points:this.drawCallHook.points,textures:this.textureHook.textures,shaders:0===this.shaderHook.shaders?0:this.shaderHook.shaders,programs:this.programHook.programs,webglContext:!function e(t,r){return null!=r&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](t):e(t,r)}(this.gl,WebGL2RenderingContext)?"1.0":"2.0"};return this.reset(),this.updateCounter=0,this.updateTime=t,r}},e}(),u="\n .gl-perf {\n pointer-events: none;\n user-select: none;\n position: absolute;\n top: 0;\n left: 0;\n padding: "+10/7.5+"vh "+10/7.5+"vh 0 "+10/7.5+"vh;\n background: rgba(0, 0, 0, 0.3);\n color: #fff;\n font: "+10/7.5+"vh arial;\n }\n\n .gl-perf dl,\n .gl-perf dt,\n .gl-perf dd {\n padding: 0;\n margin: 0;\n }\n\n .gl-perf dt {\n color: #fff;\n text-shadow: #000 0 0 1px;\n }\n\n .gl-perf dt .unit{\n font-size: "+10/7.5+"vh;\n }\n\n .gl-perf dd {\n font-size: "+20/7.5+"vh;\n padding: "+10/7.5+"vh 0 "+10/7.5+"vh;\n }\n",c=function(){function e(e,t){this.options=t,this.items=["fps","memory","drawCall","triangles","textures","shaders","programs","webglContext"],this.data={fps:60,memory:0,drawCall:0,triangles:0,lines:0,points:0,textures:0,shaders:0,programs:0,webglContext:"2.0"},this.core=new d(e,t.debug),this.createContainer(),this.update=this.update.bind(this)}var t=e.prototype;return t.createContainer=function(){var e=document.createElement("div");this.container=e,this.options.visible||this.hide(),e.classList.add("gl-perf"),e.innerHTML='\n <dl>\n <dt>FPS</dt>\n <dd>0</dd>\n <dt>Memory <span class="unit">(MB)</span></dt>\n <dd>0</dd>\n <dt>DrawCall</dt>\n <dd>0</dd>\n <dt>Triangles</dt>\n <dd>0</dd>\n <dt>Textures</dt>\n <dd>0</dd>\n <dt>Shaders</dt>\n <dd>0</dd>\n <dt>Program</dt>\n <dd>0</dd>\n <dt>WebGL</dt>\n <dd></dd>\n </dl>\n',e.appendChild(this.createStyle()),this.options.container.appendChild(e),this.doms=Array.prototype.slice.apply(e.querySelectorAll("dd"))},t.createStyle=function(){var e=document.createElement("style");return e.appendChild(document.createTextNode(u)),e},t.update=function(e){var t,r=this.core.update(e);if(r&&0!==r.triangles)for(var n=0,s=this.items.length;n<s;n++)t=this,function(e,n){var s=t.doms[e],o=r[t.items[e]]||0;requestAnimationFrame(function(){s.innerText=String(o)})}(n)},t.hide=function(){this.container.style.display="none"},t.show=function(){this.container.style.display="block"},t.reset=function(){var e;this.core.reset();for(var t=0,r=this.items.length;t<r;t++)e=this,function(t,r){var n=e.doms[t],s=e.items[t],o=e.data[s]||0;requestAnimationFrame(function(){n.innerText=String(o)})}(t)},t.release=function(){this.core.release()},t.dispose=function(){this.release(),this.container.remove()},e}(),p=function(e){function t(){return e.apply(this,arguments)}!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(t,e);var r=t.prototype;return r.init=function(e){var t=this.engine.renderer.pipelineContext.gl;this.monitor=new c(t,e)},r.onUpdate=function(e){this.monitor.update(e)},r.dispose=function(){e.prototype.dispose.call(this),this.monitor.dispose()},t}(t.Behaviour),f={debug:!1,visible:!0,container:document.body},g={images:[],fonts:[],version:"3.0",shapes:[],plugins:[],type:"ge",compositions:[{id:"2",name:"stats",duration:5,startTime:0,endBehavior:2,previewSize:[750,1624],items:[{id:"05e1c616baf34cc084968a05703719cd"}],camera:{fov:60,far:40,near:.1,clipMode:1,position:[0,0,8],rotation:[0,0,0]},sceneBindings:[]}],components:[],geometries:[],materials:[],items:[{id:"05e1c616baf34cc084968a05703719cd",name:"component",duration:99999,type:"3",visible:!0,endBehavior:0,delay:0,renderLevel:"B+",components:[],transform:{position:{x:0,y:0,z:0},eulerHint:{x:0,y:0,z:0},anchor:{x:0,y:0},size:{x:1.2,y:1.2},scale:{x:1,y:1,z:1}},dataType:"VFXItemData"}],shaders:[],bins:[],textures:[],animations:[],compositionId:"2"},m=function(){function e(e,t){this.player=e,this.options=t,this.disposed=!1,this.init()}var t=e.prototype;return t.init=function(){var e,t=this;return(e=function(){var e;return function(e,t){var r,n,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(h){return function(a){if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(s=(s=o.trys).length>0&&s[s.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,h])}}}(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.player.loadScene(g)];case 1:return(e=r.sent().getItemByName("component"))&&(e.addComponent(p).init(s({},f,t.options)),t.component=e.getComponent(p)),[3,3];case 2:throw Error("Failed to load stats scene: "+r.sent().message+".");case 3:return[2]}})},function(){var t=this,r=arguments;return new Promise(function(s,o){var i=e.apply(t,r);function a(e){n(i,s,o,a,h,"next",e)}function h(e){n(i,s,o,a,h,"throw",e)}a(void 0)})})()},t.hide=function(){var e;null==(e=this.component)||e.monitor.hide()},t.show=function(){var e;null==(e=this.component)||e.monitor.show()},t.dispose=function(){var e;this.disposed||(this.disposed=!0,null==(e=this.component)||e.dispose(),this.component=void 0)},e}(),b="2.4.4";t.logger.info("Plugin stats version: "+b+"."),b!==r.version&&console.error("注意:请统一 Stats 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Stats plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),e.Stats=m,e.version=b,Object.defineProperty(e,"__esModule",{value:!0})});
8
8
  //# sourceMappingURL=index.min.js.map
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime stats for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 云垣
6
- * Version: v2.4.3
6
+ * Version: v2.4.4
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -729,7 +729,7 @@ var json = {
729
729
 
730
730
  /**
731
731
  * 插件版本号
732
- */ var version = "2.4.3";
732
+ */ var version = "2.4.4";
733
733
  logger.info("Plugin stats version: " + version + ".");
734
734
  if (version !== EFFECTS.version) {
735
735
  console.error("注意:请统一 Stats 插件与 Player 版本,不统一的版本混用会有不可预知的后果!", "\nAttention: Please ensure the Stats plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-plugin-stats",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "description": "Galacean Effects runtime stats for the web",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "registry": "https://registry.npmjs.org"
29
29
  },
30
30
  "devDependencies": {
31
- "@galacean/effects": "2.4.3"
31
+ "@galacean/effects": "2.4.4"
32
32
  },
33
33
  "scripts": {
34
34
  "dev": "vite",