@galacean/engine 1.1.0-alpha.4 → 1.1.0-beta.0

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/browser.js CHANGED
@@ -4463,6 +4463,31 @@
4463
4463
  return this;
4464
4464
  };
4465
4465
  /**
4466
+ * Copy from array like object.
4467
+ * @param source - Array like object
4468
+ * @param offset - The start offset
4469
+ * @returns This color
4470
+ */ _proto.copyFromArray = function copyFromArray(source, offset) {
4471
+ if (offset === void 0) offset = 0;
4472
+ this._r = source[offset];
4473
+ this._g = source[offset + 1];
4474
+ this._b = source[offset + 2];
4475
+ this._a = source[offset + 3];
4476
+ this._onValueChanged && this._onValueChanged();
4477
+ return this;
4478
+ };
4479
+ /**
4480
+ * Copy the value of this color to an array.
4481
+ * @param out - The color
4482
+ * @param outOffset - The start offset
4483
+ */ _proto.copyToArray = function copyToArray(out, outOffset) {
4484
+ if (outOffset === void 0) outOffset = 0;
4485
+ out[outOffset] = this._r;
4486
+ out[outOffset + 1] = this._g;
4487
+ out[outOffset + 2] = this._b;
4488
+ out[outOffset + 3] = this._a;
4489
+ };
4490
+ /**
4466
4491
  * Modify components (r, g, b) of this color from gamma space to linear space.
4467
4492
  * @param out - The color in linear space
4468
4493
  * @returns The color in linear space
@@ -5137,6 +5162,31 @@
5137
5162
  return this;
5138
5163
  };
5139
5164
  /**
5165
+ * Copy from array like object.
5166
+ * @param source - Array like object
5167
+ * @param offset - The start offset
5168
+ * @returns This color
5169
+ */ _proto.copyFromArray = function copyFromArray(source, offset) {
5170
+ if (offset === void 0) offset = 0;
5171
+ this._r = source[offset];
5172
+ this._g = source[offset + 1];
5173
+ this._b = source[offset + 2];
5174
+ this._a = source[offset + 3];
5175
+ this._onValueChanged && this._onValueChanged();
5176
+ return this;
5177
+ };
5178
+ /**
5179
+ * Copy the value of this color to an array.
5180
+ * @param out - The color
5181
+ * @param outOffset - The start offset
5182
+ */ _proto.copyToArray = function copyToArray(out, outOffset) {
5183
+ if (outOffset === void 0) outOffset = 0;
5184
+ out[outOffset] = this._r;
5185
+ out[outOffset + 1] = this._g;
5186
+ out[outOffset + 2] = this._b;
5187
+ out[outOffset + 3] = this._a;
5188
+ };
5189
+ /**
5140
5190
  * Modify components (r, g, b) of this color from gamma space to linear space.
5141
5191
  * @param out - The color in linear space
5142
5192
  * @returns The color in linear space
@@ -5323,25 +5373,29 @@
5323
5373
  ]);
5324
5374
  return Color;
5325
5375
  }();
5326
- /******************************************************************************
5327
- Copyright (c) Microsoft Corporation.
5328
-
5329
- Permission to use, copy, modify, and/or distribute this software for any
5330
- purpose with or without fee is hereby granted.
5331
-
5332
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
5333
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
5334
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
5335
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
5336
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
5337
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5338
- PERFORMANCE OF THIS SOFTWARE.
5376
+ /******************************************************************************
5377
+ Copyright (c) Microsoft Corporation.
5378
+
5379
+ Permission to use, copy, modify, and/or distribute this software for any
5380
+ purpose with or without fee is hereby granted.
5381
+
5382
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
5383
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
5384
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
5385
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
5386
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
5387
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5388
+ PERFORMANCE OF THIS SOFTWARE.
5339
5389
  ***************************************************************************** */ function __decorate$1(decorators, target, key, desc) {
5340
5390
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5341
5391
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5342
5392
  else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5343
5393
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5344
5394
  }
5395
+ typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
5396
+ var e = new Error(message);
5397
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
5398
+ };
5345
5399
  function _instanceof1$2(left, right) {
5346
5400
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
5347
5401
  return !!right[Symbol.hasInstance](left);
@@ -5552,16 +5606,16 @@
5552
5606
  ], EngineObject.prototype, "_engine", void 0);
5553
5607
  /**
5554
5608
  * The base class of assets, with reference counting capability.
5555
- */ var ReferResource = /*#__PURE__*/ function(EngineObject) {
5609
+ */ var ReferResource = /*#__PURE__*/ function(EngineObject1) {
5556
5610
  var ReferResource = function ReferResource(engine) {
5557
5611
  var _this;
5558
- _this = EngineObject.call(this, engine) || this;
5612
+ _this = EngineObject1.call(this, engine) || this;
5559
5613
  /** Whether to ignore the garbage collection check, if it is true, it will not be affected by ResourceManager.gc(). */ _this.isGCIgnored = false;
5560
5614
  _this._refCount = 0;
5561
5615
  engine.resourceManager._addReferResource(_assert_this_initialized(_this));
5562
5616
  return _this;
5563
5617
  };
5564
- _inherits$2(ReferResource, EngineObject);
5618
+ _inherits$2(ReferResource, EngineObject1);
5565
5619
  var _proto = ReferResource.prototype;
5566
5620
  /**
5567
5621
  * Destroy self.
@@ -5572,7 +5626,7 @@
5572
5626
  if (!force && this._refCount !== 0) {
5573
5627
  return false;
5574
5628
  }
5575
- EngineObject.prototype.destroy.call(this);
5629
+ EngineObject1.prototype.destroy.call(this);
5576
5630
  return true;
5577
5631
  };
5578
5632
  /**
@@ -5593,7 +5647,7 @@
5593
5647
  /**
5594
5648
  * @internal
5595
5649
  */ _proto._onDestroy = function _onDestroy() {
5596
- EngineObject.prototype._onDestroy.call(this);
5650
+ EngineObject1.prototype._onDestroy.call(this);
5597
5651
  this._engine.resourceManager._deleteReferResource(this);
5598
5652
  var refCount = this._getReferCount();
5599
5653
  if (refCount > 0) {
@@ -5717,20 +5771,20 @@
5717
5771
  TextureWrapMode[TextureWrapMode[/** Repeating mode. tiling will be repeated if it exceeds the texture boundary. */ "Repeat"] = 1] = "Repeat";
5718
5772
  TextureWrapMode[TextureWrapMode[/** Mirror repeat mode. tiling will be mirrored and repeated if it exceeds the texture boundary. */ "Mirror"] = 2] = "Mirror";
5719
5773
  })(exports.TextureWrapMode || (exports.TextureWrapMode = {}));
5720
- var GraphicsResource = /*#__PURE__*/ function(ReferResource) {
5774
+ var GraphicsResource = /*#__PURE__*/ function(ReferResource1) {
5721
5775
  var GraphicsResource = function GraphicsResource(engine) {
5722
5776
  var _this;
5723
- _this = ReferResource.call(this, engine) || this;
5777
+ _this = ReferResource1.call(this, engine) || this;
5724
5778
  /** @internal */ _this._isContentLost = false;
5725
5779
  engine.resourceManager._addGraphicResource(_assert_this_initialized(_this));
5726
5780
  return _this;
5727
5781
  };
5728
- _inherits$2(GraphicsResource, ReferResource);
5782
+ _inherits$2(GraphicsResource, ReferResource1);
5729
5783
  var _proto = GraphicsResource.prototype;
5730
5784
  /**
5731
5785
  * @internal
5732
5786
  */ _proto._onDestroy = function _onDestroy() {
5733
- ReferResource.prototype._onDestroy.call(this);
5787
+ ReferResource1.prototype._onDestroy.call(this);
5734
5788
  this.engine.resourceManager._deleteGraphicResource(this);
5735
5789
  };
5736
5790
  _create_class$3(GraphicsResource, [
@@ -5780,16 +5834,16 @@
5780
5834
  };
5781
5835
  /**
5782
5836
  * The base class of texture, contains some common functions of texture-related classes.
5783
- */ var Texture = /*#__PURE__*/ function(GraphicsResource) {
5837
+ */ var Texture = /*#__PURE__*/ function(GraphicsResource1) {
5784
5838
  var Texture = function Texture() {
5785
5839
  var _this;
5786
- _this = GraphicsResource.apply(this, arguments) || this;
5840
+ _this = GraphicsResource1.apply(this, arguments) || this;
5787
5841
  /** @internal */ _this._isDepthTexture = false;
5788
5842
  _this._anisoLevel = 1;
5789
5843
  _this._useDepthCompareMode = false;
5790
5844
  return _this;
5791
5845
  };
5792
- _inherits$2(Texture, GraphicsResource);
5846
+ _inherits$2(Texture, GraphicsResource1);
5793
5847
  var _proto = Texture.prototype;
5794
5848
  /**
5795
5849
  * Generate multi-level textures based on the 0th level data.
@@ -5821,7 +5875,7 @@
5821
5875
  /**
5822
5876
  * @internal
5823
5877
  */ _proto._onDestroy = function _onDestroy() {
5824
- GraphicsResource.prototype._onDestroy.call(this);
5878
+ GraphicsResource1.prototype._onDestroy.call(this);
5825
5879
  this._platformTexture.destroy();
5826
5880
  this._platformTexture = null;
5827
5881
  };
@@ -5960,12 +6014,12 @@
5960
6014
  }(GraphicsResource);
5961
6015
  /**
5962
6016
  * The render target used for off-screen rendering.
5963
- */ var RenderTarget = /*#__PURE__*/ function(GraphicsResource) {
6017
+ */ var RenderTarget = /*#__PURE__*/ function(GraphicsResource1) {
5964
6018
  var RenderTarget = function RenderTarget(engine, width, height, renderTexture, depth, antiAliasing) {
5965
6019
  if (depth === void 0) depth = exports.RenderBufferDepthFormat.Depth;
5966
6020
  if (antiAliasing === void 0) antiAliasing = 1;
5967
6021
  var _this;
5968
- _this = GraphicsResource.call(this, engine) || this;
6022
+ _this = GraphicsResource1.call(this, engine) || this;
5969
6023
  _this._autoGenerateMipmaps = true;
5970
6024
  _this._width = width;
5971
6025
  _this._height = height;
@@ -5996,7 +6050,7 @@
5996
6050
  _this._platformRenderTarget = engine._hardwareRenderer.createPlatformRenderTarget(_assert_this_initialized(_this));
5997
6051
  return _this;
5998
6052
  };
5999
- _inherits$2(RenderTarget, GraphicsResource);
6053
+ _inherits$2(RenderTarget, GraphicsResource1);
6000
6054
  var _proto = RenderTarget.prototype;
6001
6055
  /**
6002
6056
  * Get the render color texture by index.
@@ -6022,7 +6076,7 @@
6022
6076
  * @internal
6023
6077
  */ _proto._onDestroy = function _onDestroy() {
6024
6078
  var _this__depthTexture;
6025
- GraphicsResource.prototype._onDestroy.call(this);
6079
+ GraphicsResource1.prototype._onDestroy.call(this);
6026
6080
  this._platformRenderTarget.destroy();
6027
6081
  var _this = this, colorTextures = _this._colorTextures;
6028
6082
  for(var i = 0, n = colorTextures.length; i < n; i++){
@@ -6107,13 +6161,13 @@
6107
6161
  }(GraphicsResource);
6108
6162
  /**
6109
6163
  * Two-dimensional texture.
6110
- */ var Texture2D = /*#__PURE__*/ function(Texture) {
6164
+ */ var Texture2D = /*#__PURE__*/ function(Texture1) {
6111
6165
  var Texture2D = function Texture2D(engine, width, height, format, mipmap, usage) {
6112
6166
  if (format === void 0) format = exports.TextureFormat.R8G8B8A8;
6113
6167
  if (mipmap === void 0) mipmap = true;
6114
6168
  if (usage === void 0) usage = exports.TextureUsage.Static;
6115
6169
  var _this;
6116
- _this = Texture.call(this, engine) || this;
6170
+ _this = Texture1.call(this, engine) || this;
6117
6171
  _this._mipmap = mipmap;
6118
6172
  _this._width = width;
6119
6173
  _this._height = height;
@@ -6126,7 +6180,7 @@
6126
6180
  _this.wrapModeU = _this.wrapModeV = exports.TextureWrapMode.Repeat;
6127
6181
  return _this;
6128
6182
  };
6129
- _inherits$2(Texture2D, Texture);
6183
+ _inherits$2(Texture2D, Texture1);
6130
6184
  var _proto = Texture2D.prototype;
6131
6185
  /**
6132
6186
  * Setting pixels data through color buffer data, designated area and texture mipmapping level,it's also applicable to compressed formats.
@@ -6177,18 +6231,18 @@
6177
6231
  * @internal
6178
6232
  */ _proto._rebuild = function _rebuild() {
6179
6233
  this._platformTexture = this._engine._hardwareRenderer.createPlatformTexture2D(this);
6180
- Texture.prototype._rebuild.call(this);
6234
+ Texture1.prototype._rebuild.call(this);
6181
6235
  };
6182
6236
  return Texture2D;
6183
6237
  }(Texture);
6184
6238
  /**
6185
6239
  * Two-dimensional texture array.
6186
- */ var Texture2DArray = /*#__PURE__*/ function(Texture) {
6240
+ */ var Texture2DArray = /*#__PURE__*/ function(Texture1) {
6187
6241
  var Texture2DArray = function Texture2DArray(engine, width, height, length1, format, mipmap) {
6188
6242
  if (format === void 0) format = exports.TextureFormat.R8G8B8A8;
6189
6243
  if (mipmap === void 0) mipmap = true;
6190
6244
  var _this;
6191
- _this = Texture.call(this, engine) || this;
6245
+ _this = Texture1.call(this, engine) || this;
6192
6246
  _this._mipmap = mipmap;
6193
6247
  _this._width = width;
6194
6248
  _this._height = height;
@@ -6200,7 +6254,7 @@
6200
6254
  _this.wrapModeU = _this.wrapModeV = exports.TextureWrapMode.Repeat;
6201
6255
  return _this;
6202
6256
  };
6203
- _inherits$2(Texture2DArray, Texture);
6257
+ _inherits$2(Texture2DArray, Texture1);
6204
6258
  var _proto = Texture2DArray.prototype;
6205
6259
  /**
6206
6260
  * Setting pixels data through color buffer data, designated area and texture mipmapping level,it's also applicable to compressed formats.
@@ -6254,7 +6308,7 @@
6254
6308
  * @internal
6255
6309
  */ _proto._rebuild = function _rebuild() {
6256
6310
  this._platformTexture = this._engine._hardwareRenderer.createPlatformTexture2DArray(this);
6257
- Texture.prototype._rebuild.call(this);
6311
+ Texture1.prototype._rebuild.call(this);
6258
6312
  };
6259
6313
  _create_class$3(Texture2DArray, [
6260
6314
  {
@@ -6270,12 +6324,12 @@
6270
6324
  }(Texture);
6271
6325
  /**
6272
6326
  * Cube texture.
6273
- */ var TextureCube = /*#__PURE__*/ function(Texture) {
6327
+ */ var TextureCube = /*#__PURE__*/ function(Texture1) {
6274
6328
  var TextureCube = function TextureCube(engine, size, format, mipmap) {
6275
6329
  if (format === void 0) format = exports.TextureFormat.R8G8B8A8;
6276
6330
  if (mipmap === void 0) mipmap = true;
6277
6331
  var _this;
6278
- _this = Texture.call(this, engine) || this;
6332
+ _this = Texture1.call(this, engine) || this;
6279
6333
  _this._mipmap = mipmap;
6280
6334
  _this._width = size;
6281
6335
  _this._height = size;
@@ -6286,7 +6340,7 @@
6286
6340
  _this.wrapModeU = _this.wrapModeV = exports.TextureWrapMode.Clamp;
6287
6341
  return _this;
6288
6342
  };
6289
- _inherits$2(TextureCube, Texture);
6343
+ _inherits$2(TextureCube, Texture1);
6290
6344
  var _proto = TextureCube.prototype;
6291
6345
  /**
6292
6346
  * Setting pixels data through cube face,color buffer data, designated area and texture mipmapping level,it's also applicable to compressed formats.
@@ -6339,16 +6393,16 @@
6339
6393
  * @internal
6340
6394
  */ _proto._rebuild = function _rebuild() {
6341
6395
  this._platformTexture = this._engine._hardwareRenderer.createPlatformTextureCube(this);
6342
- Texture.prototype._rebuild.call(this);
6396
+ Texture1.prototype._rebuild.call(this);
6343
6397
  };
6344
6398
  return TextureCube;
6345
6399
  }(Texture);
6346
6400
  /**
6347
6401
  * @internal
6348
- */ var FontAtlas = /*#__PURE__*/ function(ReferResource) {
6402
+ */ var FontAtlas = /*#__PURE__*/ function(ReferResource1) {
6349
6403
  var FontAtlas = function FontAtlas(engine) {
6350
6404
  var _this;
6351
- _this = ReferResource.call(this, engine) || this;
6405
+ _this = ReferResource1.call(this, engine) || this;
6352
6406
  _this._charInfoMap = {};
6353
6407
  _this._space = 1;
6354
6408
  _this._curX = 1;
@@ -6356,7 +6410,7 @@
6356
6410
  _this._nextY = 1;
6357
6411
  return _this;
6358
6412
  };
6359
- _inherits$2(FontAtlas, ReferResource);
6413
+ _inherits$2(FontAtlas, ReferResource1);
6360
6414
  var _proto = FontAtlas.prototype;
6361
6415
  _proto.uploadCharTexture = function uploadCharTexture(charInfo) {
6362
6416
  var width = charInfo.w, height = charInfo.h, data = charInfo.data;
@@ -6412,7 +6466,7 @@
6412
6466
  /**
6413
6467
  * @internal
6414
6468
  */ _proto._onDestroy = function _onDestroy() {
6415
- ReferResource.prototype._onDestroy.call(this);
6469
+ ReferResource1.prototype._onDestroy.call(this);
6416
6470
  this.texture.destroy();
6417
6471
  this.texture = null;
6418
6472
  this._charInfoMap = {};
@@ -6956,17 +7010,17 @@
6956
7010
  }();
6957
7011
  /**
6958
7012
  * Font.
6959
- */ var Font = /*#__PURE__*/ function(ReferResource) {
6960
- var Font = function Font(engine, name) {
6961
- if (name === void 0) name = "";
7013
+ */ var Font = /*#__PURE__*/ function(ReferResource1) {
7014
+ var Font = function Font(engine, name1) {
7015
+ if (name1 === void 0) name1 = "";
6962
7016
  var _this;
6963
- _this = ReferResource.call(this, engine) || this;
7017
+ _this = ReferResource1.call(this, engine) || this;
6964
7018
  _this._name = "";
6965
7019
  _this._subFontMap = {};
6966
- _this._name = name;
7020
+ _this._name = name1;
6967
7021
  return _this;
6968
7022
  };
6969
- _inherits$2(Font, ReferResource);
7023
+ _inherits$2(Font, ReferResource1);
6970
7024
  var _proto = Font.prototype;
6971
7025
  /**
6972
7026
  * @internal
@@ -6984,7 +7038,7 @@
6984
7038
  /**
6985
7039
  * @internal
6986
7040
  */ _proto._onDestroy = function _onDestroy() {
6987
- ReferResource.prototype._onDestroy.call(this);
7041
+ ReferResource1.prototype._onDestroy.call(this);
6988
7042
  var subFontMap = this._subFontMap;
6989
7043
  for(var k in subFontMap){
6990
7044
  subFontMap[k].destroy();
@@ -6997,15 +7051,15 @@
6997
7051
  * @param engine - Engine to which the font belongs
6998
7052
  * @param name - The name of font want to create
6999
7053
  * @returns The font object has been create
7000
- */ Font.createFromOS = function createFromOS(engine, name) {
7001
- if (name) {
7054
+ */ Font.createFromOS = function createFromOS(engine, name1) {
7055
+ if (name1) {
7002
7056
  var fontMap = engine._fontMap;
7003
- var font = fontMap[name];
7057
+ var font = fontMap[name1];
7004
7058
  if (font) {
7005
7059
  return font;
7006
7060
  }
7007
- font = new Font(engine, name);
7008
- fontMap[name] = font;
7061
+ font = new Font(engine, name1);
7062
+ fontMap[name1] = font;
7009
7063
  return font;
7010
7064
  }
7011
7065
  return null;
@@ -7189,21 +7243,21 @@
7189
7243
  /**
7190
7244
  * Shader property.
7191
7245
  */ var ShaderProperty = /*#__PURE__*/ function() {
7192
- function ShaderProperty(name) {
7193
- this.name = name;
7246
+ function ShaderProperty(name1) {
7247
+ this.name = name1;
7194
7248
  this._uniqueId = ShaderProperty._propertyNameCounter++;
7195
7249
  }
7196
7250
  /**
7197
7251
  * Get shader property by name.
7198
7252
  * @param name - Name of the shader property
7199
7253
  * @returns Shader property
7200
- */ ShaderProperty.getByName = function getByName(name) {
7254
+ */ ShaderProperty.getByName = function getByName(name1) {
7201
7255
  var propertyNameMap = ShaderProperty._propertyNameMap;
7202
- if (propertyNameMap[name] != null) {
7203
- return propertyNameMap[name];
7256
+ if (propertyNameMap[name1] != null) {
7257
+ return propertyNameMap[name1];
7204
7258
  } else {
7205
- var property = new ShaderProperty(name);
7206
- propertyNameMap[name] = property;
7259
+ var property = new ShaderProperty(name1);
7260
+ propertyNameMap[name1] = property;
7207
7261
  ShaderProperty._propertyIdMap[property._uniqueId] = property;
7208
7262
  return property;
7209
7263
  }
@@ -7211,8 +7265,9 @@
7211
7265
  /**
7212
7266
  * @internal
7213
7267
  */ ShaderProperty._getShaderPropertyGroup = function _getShaderPropertyGroup(propertyName) {
7268
+ var _shaderProperty;
7214
7269
  var shaderProperty = ShaderProperty._propertyNameMap[propertyName];
7215
- return shaderProperty == null ? void 0 : shaderProperty._group;
7270
+ return (_shaderProperty = shaderProperty) == null ? void 0 : _shaderProperty._group;
7216
7271
  };
7217
7272
  _create_class$3(ShaderProperty, [
7218
7273
  {
@@ -7417,10 +7472,10 @@
7417
7472
  })(ActiveChangeFlag || (ActiveChangeFlag = {}));
7418
7473
  /**
7419
7474
  * The base class of the components.
7420
- */ var Component = /*#__PURE__*/ function(EngineObject) {
7475
+ */ var Component = /*#__PURE__*/ function(EngineObject1) {
7421
7476
  var Component = function Component(entity) {
7422
7477
  var _this;
7423
- _this = EngineObject.call(this, entity.engine) || this;
7478
+ _this = EngineObject1.call(this, entity.engine) || this;
7424
7479
  /** @internal */ _this._awoken = false;
7425
7480
  _this._phasedActive = false;
7426
7481
  _this._phasedActiveInScene = false;
@@ -7428,7 +7483,7 @@
7428
7483
  _this._entity = entity;
7429
7484
  return _this;
7430
7485
  };
7431
- _inherits$2(Component, EngineObject);
7486
+ _inherits$2(Component, EngineObject1);
7432
7487
  var _proto = Component.prototype;
7433
7488
  /**
7434
7489
  * @internal
@@ -7489,7 +7544,7 @@
7489
7544
  /**
7490
7545
  * @internal
7491
7546
  */ _proto._onDestroy = function _onDestroy() {
7492
- EngineObject.prototype._onDestroy.call(this);
7547
+ EngineObject1.prototype._onDestroy.call(this);
7493
7548
  var entity = this._entity;
7494
7549
  entity._removeComponent(this);
7495
7550
  if (this._enabled) {
@@ -7958,14 +8013,14 @@
7958
8013
  }();
7959
8014
  /**
7960
8015
  * Bool update flag.
7961
- */ var BoolUpdateFlag = /*#__PURE__*/ function(UpdateFlag) {
8016
+ */ var BoolUpdateFlag = /*#__PURE__*/ function(UpdateFlag1) {
7962
8017
  var BoolUpdateFlag = function BoolUpdateFlag() {
7963
8018
  var _this;
7964
- _this = UpdateFlag.apply(this, arguments) || this;
8019
+ _this = UpdateFlag1.apply(this, arguments) || this;
7965
8020
  /** Bool flag. */ _this.flag = true;
7966
8021
  return _this;
7967
8022
  };
7968
- _inherits$2(BoolUpdateFlag, UpdateFlag);
8023
+ _inherits$2(BoolUpdateFlag, UpdateFlag1);
7969
8024
  var _proto = BoolUpdateFlag.prototype;
7970
8025
  /**
7971
8026
  * @inheritdoc
@@ -8036,10 +8091,10 @@
8036
8091
  }();
8037
8092
  /**
8038
8093
  * Used to implement transformation related functions.
8039
- */ var Transform = /*#__PURE__*/ function(Component) {
8094
+ */ var Transform = /*#__PURE__*/ function(Component1) {
8040
8095
  var Transform = function Transform(entity) {
8041
8096
  var _this;
8042
- _this = Component.call(this, entity) || this;
8097
+ _this = Component1.call(this, entity) || this;
8043
8098
  _this._position = new Vector3();
8044
8099
  _this._rotation = new Vector3();
8045
8100
  _this._rotationQuaternion = new Quaternion();
@@ -8080,7 +8135,7 @@
8080
8135
  _this._scale._onValueChanged = _this._onScaleChanged;
8081
8136
  return _this;
8082
8137
  };
8083
- _inherits$2(Transform, Component);
8138
+ _inherits$2(Transform, Component1);
8084
8139
  var _proto = Transform.prototype;
8085
8140
  /**
8086
8141
  * Set local position by X, Y, Z value.
@@ -8226,7 +8281,7 @@
8226
8281
  return isInvert;
8227
8282
  };
8228
8283
  _proto._onDestroy = function _onDestroy() {
8229
- Component.prototype._onDestroy.call(this);
8284
+ Component1.prototype._onDestroy.call(this);
8230
8285
  //@ts-ignore
8231
8286
  this._worldPosition._onValueChanged = null;
8232
8287
  //@ts-ignore
@@ -8857,10 +8912,10 @@
8857
8912
  }();
8858
8913
  /**
8859
8914
  * Entity, be used as components container.
8860
- */ var Entity = /*#__PURE__*/ function(EngineObject) {
8861
- var Entity = function Entity(engine, name) {
8915
+ */ var Entity = /*#__PURE__*/ function(EngineObject1) {
8916
+ var Entity = function Entity(engine, name1) {
8862
8917
  var _this;
8863
- _this = EngineObject.call(this, engine) || this;
8918
+ _this = EngineObject1.call(this, engine) || this;
8864
8919
  /** The layer the entity belongs to. */ _this.layer = exports.Layer.Layer0;
8865
8920
  /** @internal */ _this._isActiveInHierarchy = false;
8866
8921
  /** @internal */ _this._isActiveInScene = false;
@@ -8873,12 +8928,12 @@
8873
8928
  _this._parent = null;
8874
8929
  //--------------------------------------------------------------deprecated----------------------------------------------------------------
8875
8930
  _this._invModelMatrix = new Matrix();
8876
- _this.name = name;
8931
+ _this.name = name1;
8877
8932
  _this.transform = _this.addComponent(Transform);
8878
8933
  _this._inverseWorldMatFlag = _this.transform.registerWorldChangeFlag();
8879
8934
  return _this;
8880
8935
  };
8881
- _inherits$2(Entity, EngineObject);
8936
+ _inherits$2(Entity, EngineObject1);
8882
8937
  var _proto = Entity.prototype;
8883
8938
  /**
8884
8939
  * Add component based on the component type.
@@ -8996,13 +9051,13 @@
8996
9051
  * Find entity by name.
8997
9052
  * @param name - The name of the entity which want to be found
8998
9053
  * @returns The component which be found
8999
- */ _proto.findByName = function findByName(name) {
9000
- if (name === this.name) {
9054
+ */ _proto.findByName = function findByName(name1) {
9055
+ if (name1 === this.name) {
9001
9056
  return this;
9002
9057
  }
9003
9058
  var children = this._children;
9004
9059
  for(var i = 0, n = children.length; i < n; i++){
9005
- var target = children[i].findByName(name);
9060
+ var target = children[i].findByName(name1);
9006
9061
  if (target) {
9007
9062
  return target;
9008
9063
  }
@@ -9031,8 +9086,8 @@
9031
9086
  * Create child entity.
9032
9087
  * @param name - The child entity's name
9033
9088
  * @returns The child entity
9034
- */ _proto.createChild = function createChild(name) {
9035
- var child = new Entity(this.engine, name);
9089
+ */ _proto.createChild = function createChild(name1) {
9090
+ var child = new Entity(this.engine, name1);
9036
9091
  child.layer = this.layer;
9037
9092
  child.parent = this;
9038
9093
  return child;
@@ -9097,11 +9152,17 @@
9097
9152
  if (this._destroyed) {
9098
9153
  return;
9099
9154
  }
9100
- EngineObject.prototype.destroy.call(this);
9155
+ EngineObject1.prototype.destroy.call(this);
9101
9156
  if (this._hookResource) {
9102
9157
  this._hookResource._addReferCount(-1);
9103
9158
  this._hookResource = null;
9104
9159
  }
9160
+ this.isActive = false;
9161
+ if (this._isRoot) {
9162
+ this._scene.removeRootEntity(this);
9163
+ } else {
9164
+ this._setParent(null);
9165
+ }
9105
9166
  var components = this._components;
9106
9167
  for(var i = components.length - 1; i >= 0; i--){
9107
9168
  components[i].destroy();
@@ -9111,12 +9172,6 @@
9111
9172
  while(children.length > 0){
9112
9173
  children[0].destroy();
9113
9174
  }
9114
- if (this._isRoot) {
9115
- this._scene._removeFromEntityList(this);
9116
- this._isRoot = false;
9117
- } else {
9118
- this._removeFromParent();
9119
- }
9120
9175
  };
9121
9176
  /**
9122
9177
  * @internal
@@ -9324,11 +9379,11 @@
9324
9379
  };
9325
9380
  /**
9326
9381
  * @internal
9327
- */ Entity._findChildByName = function _findChildByName(root, name) {
9382
+ */ Entity._findChildByName = function _findChildByName(root, name1) {
9328
9383
  var children = root._children;
9329
9384
  for(var i = children.length - 1; i >= 0; i--){
9330
9385
  var child = children[i];
9331
- if (child.name === name) {
9386
+ if (child.name === name1) {
9332
9387
  return child;
9333
9388
  }
9334
9389
  }
@@ -9360,8 +9415,9 @@
9360
9415
  if (this._isRoot && this._scene._isActiveInEngine) {
9361
9416
  activeChangeFlag |= ActiveChangeFlag.All;
9362
9417
  } else {
9363
- (parent == null ? void 0 : parent._isActiveInHierarchy) && (activeChangeFlag |= ActiveChangeFlag.Hierarchy);
9364
- (parent == null ? void 0 : parent._isActiveInScene) && (activeChangeFlag |= ActiveChangeFlag.Scene);
9418
+ var _parent, _parent1;
9419
+ ((_parent = parent) == null ? void 0 : _parent._isActiveInHierarchy) && (activeChangeFlag |= ActiveChangeFlag.Hierarchy);
9420
+ ((_parent1 = parent) == null ? void 0 : _parent1._isActiveInScene) && (activeChangeFlag |= ActiveChangeFlag.Scene);
9365
9421
  }
9366
9422
  activeChangeFlag && this._processActive(activeChangeFlag);
9367
9423
  } else {
@@ -9564,6 +9620,7 @@
9564
9620
  RenderStateElementKey[RenderStateElementKey[/** Raster state fill mode key. */ "RasterStateCullMode"] = 25] = "RasterStateCullMode";
9565
9621
  RenderStateElementKey[RenderStateElementKey[/** Raster state cull mode key. */ "RasterStateDepthBias"] = 26] = "RasterStateDepthBias";
9566
9622
  RenderStateElementKey[RenderStateElementKey[/** Raster state depth bias key. */ "RasterStateSlopeScaledDepthBias"] = 27] = "RasterStateSlopeScaledDepthBias";
9623
+ RenderStateElementKey[RenderStateElementKey[/** Render queue type key. */ "RenderQueueType"] = 28] = "RenderQueueType";
9567
9624
  })(exports.RenderStateDataKey || (exports.RenderStateDataKey = {}));
9568
9625
  /**
9569
9626
  * Render queue type.
@@ -9606,27 +9663,27 @@
9606
9663
  /**
9607
9664
  * Shader macro。
9608
9665
  */ var ShaderMacro = /*#__PURE__*/ function() {
9609
- function ShaderMacro(name, value, maskIndex, maskValue) {
9610
- this.name = name;
9666
+ function ShaderMacro(name1, value, maskIndex, maskValue) {
9667
+ this.name = name1;
9611
9668
  this._maskIndex = maskIndex;
9612
9669
  this._maskValue = maskValue;
9613
9670
  this.value = value;
9614
9671
  var macroNameIDMap = ShaderMacro._macroNameIdMap;
9615
- var nameID = macroNameIDMap[name];
9616
- if (macroNameIDMap[name] === undefined) {
9617
- macroNameIDMap[name] = nameID = ShaderMacro._macroNameCounter++;
9672
+ var nameID = macroNameIDMap[name1];
9673
+ if (macroNameIDMap[name1] === undefined) {
9674
+ macroNameIDMap[name1] = nameID = ShaderMacro._macroNameCounter++;
9618
9675
  }
9619
9676
  this._nameId = nameID;
9620
9677
  }
9621
- ShaderMacro.getByName = function getByName(name, value) {
9622
- var key = value ? name + " " + value : name;
9678
+ ShaderMacro.getByName = function getByName(name1, value) {
9679
+ var key = value ? name1 + " " + value : name1;
9623
9680
  var macro = ShaderMacro._macroMap[key];
9624
9681
  if (!macro) {
9625
9682
  var maskMap = ShaderMacro._macroMaskMap;
9626
9683
  var counter = ShaderMacro._macroCounter;
9627
9684
  var index = Math.floor(counter / 32);
9628
9685
  var bit = counter % 32;
9629
- macro = new ShaderMacro(name, value, index, 1 << bit);
9686
+ macro = new ShaderMacro(name1, value, index, 1 << bit);
9630
9687
  ShaderMacro._macroMap[key] = macro;
9631
9688
  if (index == maskMap.length) {
9632
9689
  maskMap.length++;
@@ -10005,14 +10062,6 @@
10005
10062
  return src.replace(regex, replace);
10006
10063
  };
10007
10064
  /**
10008
- * GLSL extension.
10009
- * @param extensions - such as ["GL_EXT_shader_texture_lod"]
10010
- * */ ShaderFactory.parseExtension = function parseExtension(extensions) {
10011
- return extensions.map(function(e) {
10012
- return "#extension " + e + " : enable\n";
10013
- }).join("");
10014
- };
10015
- /**
10016
10065
  * Convert lower GLSL version to GLSL 300 es.
10017
10066
  * @param shader - code
10018
10067
  * @param isFrag - Whether it is a fragment shader.
@@ -10051,21 +10100,30 @@
10051
10100
  };
10052
10101
  return ShaderFactory;
10053
10102
  }();
10103
+ (function() {
10104
+ /** @internal */ ShaderFactory._shaderExtension = [
10105
+ "GL_EXT_shader_texture_lod",
10106
+ "GL_OES_standard_derivatives",
10107
+ "GL_EXT_draw_buffers"
10108
+ ].map(function(e) {
10109
+ return "#extension " + e + " : enable\n";
10110
+ }).join("");
10111
+ })();
10054
10112
  /**
10055
10113
  * Shader tag key.
10056
10114
  */ var ShaderTagKey = /*#__PURE__*/ function() {
10057
- function ShaderTagKey(name) {
10058
- this.name = name;
10115
+ function ShaderTagKey(name1) {
10116
+ this.name = name1;
10059
10117
  this._uniqueId = ShaderTagKey._nameCounter++;
10060
10118
  }
10061
10119
  /**
10062
10120
  * Get shader property by name.
10063
10121
  * @param name - Name of the shader property
10064
10122
  * @returns Shader property
10065
- */ ShaderTagKey.getByName = function getByName(name) {
10123
+ */ ShaderTagKey.getByName = function getByName(name1) {
10066
10124
  var _nameMap, _name;
10067
10125
  var nameMap = ShaderTagKey._nameMap;
10068
- return (_nameMap = nameMap)[_name = name] || (_nameMap[_name] = new ShaderTagKey(name));
10126
+ return (_nameMap = nameMap)[_name = name1] || (_nameMap[_name] = new ShaderTagKey(name1));
10069
10127
  };
10070
10128
  return ShaderTagKey;
10071
10129
  }();
@@ -10096,6 +10154,16 @@
10096
10154
  _proto.getTagValue = function getTagValue(keyOrKeyName) {
10097
10155
  return this._tagsMap[typeof keyOrKeyName == "string" ? ShaderTagKey.getByName(keyOrKeyName)._uniqueId : keyOrKeyName._uniqueId];
10098
10156
  };
10157
+ _create_class$3(ShaderPart, [
10158
+ {
10159
+ key: "name",
10160
+ get: /**
10161
+ * Name.
10162
+ */ function get() {
10163
+ return this._name;
10164
+ }
10165
+ }
10166
+ ]);
10099
10167
  return ShaderPart;
10100
10168
  }();
10101
10169
  /**
@@ -10522,17 +10590,17 @@
10522
10590
  var uniformInfos = this._getUniformInfos();
10523
10591
  var attributeInfos = this._getAttributeInfos();
10524
10592
  uniformInfos.forEach(function(param) {
10525
- var name = param.name, size = param.size, type = param.type;
10593
+ var name1 = param.name, size = param.size, type = param.type;
10526
10594
  var shaderUniform = new ShaderUniform(_this._engine);
10527
10595
  var isArray = false;
10528
10596
  var isTexture = false;
10529
- if (name.indexOf("[0]") > 0) {
10530
- name = name.substr(0, name.length - 3);
10597
+ if (name1.indexOf("[0]") > 0) {
10598
+ name1 = name1.substr(0, name1.length - 3);
10531
10599
  isArray = true;
10532
10600
  }
10533
- var location = gl.getUniformLocation(program, name);
10534
- shaderUniform.name = name;
10535
- shaderUniform.propertyId = ShaderProperty.getByName(name)._uniqueId;
10601
+ var location = gl.getUniformLocation(program, name1);
10602
+ shaderUniform.name = name1;
10603
+ shaderUniform.propertyId = ShaderProperty.getByName(name1)._uniqueId;
10536
10604
  shaderUniform.location = location;
10537
10605
  switch(type){
10538
10606
  case gl.FLOAT:
@@ -10649,12 +10717,12 @@
10649
10717
  default:
10650
10718
  throw new Error("Unsupported uniform type");
10651
10719
  }
10652
- var group = ShaderProperty._getShaderPropertyGroup(name);
10720
+ var group = ShaderProperty._getShaderPropertyGroup(name1);
10653
10721
  _this._groupingUniform(shaderUniform, group, isTexture);
10654
10722
  });
10655
10723
  attributeInfos.forEach(function(param) {
10656
- var name = param.name;
10657
- _this.attributeLocation[name] = gl.getAttribLocation(program, name);
10724
+ var name1 = param.name;
10725
+ _this.attributeLocation[name1] = gl.getAttribLocation(program, name1);
10658
10726
  });
10659
10727
  };
10660
10728
  _proto._getUniformInfos = function _getUniformInfos() {
@@ -10707,19 +10775,29 @@
10707
10775
  })();
10708
10776
  /**
10709
10777
  * Shader pass containing vertex and fragment source.
10710
- */ var ShaderPass = /*#__PURE__*/ function(ShaderPart) {
10711
- _inherits$2(ShaderPass, ShaderPart);
10712
- function ShaderPass(vertexSource, fragmentSource, tags) {
10713
- if (tags === void 0) tags = {
10714
- pipelineStage: exports.PipelineStage.Forward
10715
- };
10778
+ */ var ShaderPass = /*#__PURE__*/ function(ShaderPart1) {
10779
+ _inherits$2(ShaderPass, ShaderPart1);
10780
+ function ShaderPass(nameOrVertexSource, vertexSourceOrFragmentSource, fragmentSourceOrTags, tags) {
10716
10781
  var _this;
10717
- _this = ShaderPart.call(this) || this;
10782
+ _this = ShaderPart1.call(this) || this;
10718
10783
  /** @internal */ _this._shaderPassId = 0;
10719
10784
  /** @internal */ _this._renderStateDataMap = {};
10720
10785
  _this._shaderPassId = ShaderPass._shaderPassCounter++;
10721
- _this._vertexSource = vertexSource;
10722
- _this._fragmentSource = fragmentSource;
10786
+ if (typeof fragmentSourceOrTags === "string") {
10787
+ _this._name = nameOrVertexSource;
10788
+ _this._vertexSource = vertexSourceOrFragmentSource;
10789
+ _this._fragmentSource = fragmentSourceOrTags;
10790
+ tags = tags != null ? tags : {
10791
+ pipelineStage: exports.PipelineStage.Forward
10792
+ };
10793
+ } else {
10794
+ _this._name = "Default";
10795
+ _this._vertexSource = nameOrVertexSource;
10796
+ _this._fragmentSource = vertexSourceOrFragmentSource;
10797
+ tags = fragmentSourceOrTags != null ? fragmentSourceOrTags : {
10798
+ pipelineStage: exports.PipelineStage.Forward
10799
+ };
10800
+ }
10723
10801
  for(var key in tags){
10724
10802
  _this.setTag(key, tags[key]);
10725
10803
  }
@@ -10748,7 +10826,7 @@
10748
10826
  precisionStr += "#define HAS_DERIVATIVES\n";
10749
10827
  }
10750
10828
  var vertexSource = " " + versionStr + "\n " + graphicAPI + "\n " + macroNameStr + "\n " + ShaderFactory.parseIncludes(this._vertexSource);
10751
- var fragmentSource = " " + versionStr + "\n " + graphicAPI + "\n " + (isWebGL2 ? "" : ShaderFactory.parseExtension(Shader._shaderExtension)) + "\n " + precisionStr + "\n " + macroNameStr + "\n " + ShaderFactory.parseIncludes(this._fragmentSource);
10829
+ var fragmentSource = " " + versionStr + "\n " + graphicAPI + "\n " + (isWebGL2 ? "" : ShaderFactory._shaderExtension) + "\n " + precisionStr + "\n " + macroNameStr + "\n " + ShaderFactory.parseIncludes(this._fragmentSource);
10752
10830
  if (isWebGL2) {
10753
10831
  vertexSource = ShaderFactory.convertTo300(vertexSource);
10754
10832
  fragmentSource = ShaderFactory.convertTo300(fragmentSource, true);
@@ -10764,11 +10842,11 @@
10764
10842
  })();
10765
10843
  /**
10766
10844
  * Sub shader.
10767
- */ var SubShader = /*#__PURE__*/ function(ShaderPart) {
10768
- var SubShader = function SubShader(name, passes, tags) {
10845
+ */ var SubShader = /*#__PURE__*/ function(ShaderPart1) {
10846
+ var SubShader = function SubShader(name1, passes, tags) {
10769
10847
  var _this;
10770
- _this = ShaderPart.call(this) || this;
10771
- _this.name = name;
10848
+ _this = ShaderPart1.call(this) || this;
10849
+ _this._name = name1;
10772
10850
  var passCount = passes.length;
10773
10851
  if (passCount < 1) {
10774
10852
  throw " count must large than 0.";
@@ -10779,7 +10857,7 @@
10779
10857
  }
10780
10858
  return _this;
10781
10859
  };
10782
- _inherits$2(SubShader, ShaderPart);
10860
+ _inherits$2(SubShader, ShaderPart1);
10783
10861
  _create_class$3(SubShader, [
10784
10862
  {
10785
10863
  key: "passes",
@@ -11337,6 +11415,11 @@
11337
11415
  this.depthState._applyShaderDataValue(renderStateDataMap, shaderData);
11338
11416
  this.stencilState._applyShaderDataValue(renderStateDataMap, shaderData);
11339
11417
  this.rasterState._applyShaderDataValue(renderStateDataMap, shaderData);
11418
+ var renderQueueType = renderStateDataMap[exports.RenderStateDataKey.RenderQueueType];
11419
+ if (renderQueueType !== undefined) {
11420
+ var _shaderData_getFloat;
11421
+ this.renderQueueType = (_shaderData_getFloat = shaderData.getFloat(renderQueueType)) != null ? _shaderData_getFloat : exports.RenderQueueType.Opaque;
11422
+ }
11340
11423
  };
11341
11424
  /**
11342
11425
  * @internal
@@ -11354,9 +11437,9 @@
11354
11437
  /**
11355
11438
  * Shader for rendering.
11356
11439
  */ var Shader = /*#__PURE__*/ function() {
11357
- var Shader = function Shader(name, subShaders) {
11358
- this.name = name;
11359
- this.name = name;
11440
+ var Shader = function Shader(name1, subShaders) {
11441
+ this.name = name1;
11442
+ this.name = name1;
11360
11443
  this._subShaders = subShaders;
11361
11444
  };
11362
11445
  var _proto = Shader.prototype;
@@ -11400,14 +11483,24 @@
11400
11483
  var shaderInfo = Shader._shaderLab.parseShader(nameOrShaderSource);
11401
11484
  var subShaderList = shaderInfo.subShaders.map(function(subShaderInfo) {
11402
11485
  var passList = subShaderInfo.passes.map(function(passInfo) {
11403
- var shaderPass = new ShaderPass(passInfo.vertexSource, passInfo.fragmentSource, passInfo.tags);
11486
+ if (typeof passInfo === "string") {
11487
+ var _Shader_find_subShaders_find, _Shader_find;
11488
+ // Use pass reference
11489
+ var paths = passInfo.split("/");
11490
+ return (_Shader_find = Shader.find(paths[0])) == null ? void 0 : (_Shader_find_subShaders_find = _Shader_find.subShaders.find(function(subShader) {
11491
+ return subShader.name === paths[1];
11492
+ })) == null ? void 0 : _Shader_find_subShaders_find.passes.find(function(pass) {
11493
+ return pass.name === paths[2];
11494
+ });
11495
+ }
11496
+ var shaderPass = new ShaderPass(passInfo.name, passInfo.vertexSource, passInfo.fragmentSource, passInfo.tags);
11404
11497
  var renderStates = passInfo.renderStates;
11405
11498
  var renderState = new RenderState();
11406
11499
  shaderPass._renderState = renderState;
11407
11500
  // Parse const render state
11408
11501
  var constRenderStateInfo = renderStates[0];
11409
11502
  for(var k in constRenderStateInfo){
11410
- Shader._applyConstRenderStates(renderState, k, constRenderStateInfo[k]);
11503
+ Shader._applyConstRenderStates(renderState, parseInt(k), constRenderStateInfo[k]);
11411
11504
  }
11412
11505
  // Parse variable render state
11413
11506
  var variableRenderStateInfo = renderStates[1];
@@ -11454,8 +11547,8 @@
11454
11547
  /**
11455
11548
  * Find a shader by name.
11456
11549
  * @param name - Name of the shader
11457
- */ Shader.find = function find(name) {
11458
- return Shader._shaderMap[name];
11550
+ */ Shader.find = function find(name1) {
11551
+ return Shader._shaderMap[name1];
11459
11552
  };
11460
11553
  Shader._applyConstRenderStates = function _applyConstRenderStates(renderState, key, value) {
11461
11554
  switch(key){
@@ -11537,10 +11630,13 @@
11537
11630
  case exports.RenderStateDataKey.RasterStateSlopeScaledDepthBias:
11538
11631
  renderState.rasterState.slopeScaledDepthBias = value;
11539
11632
  break;
11633
+ case exports.RenderStateDataKey.RenderQueueType:
11634
+ renderState.renderQueueType = value;
11635
+ break;
11540
11636
  }
11541
11637
  };
11542
- Shader.getMacroByName = function getMacroByName(name, value) {
11543
- return ShaderMacro.getByName(name, value);
11638
+ Shader.getMacroByName = function getMacroByName(name1, value) {
11639
+ return ShaderMacro.getByName(name1, value);
11544
11640
  };
11545
11641
  /**
11546
11642
  * @deprecated Please use `ShaderProperty.getByName` instead
@@ -11548,8 +11644,8 @@
11548
11644
  * Get shader property by name.
11549
11645
  * @param name - Name of the shader property
11550
11646
  * @returns Shader property
11551
- */ Shader.getPropertyByName = function getPropertyByName(name) {
11552
- return ShaderProperty.getByName(name);
11647
+ */ Shader.getPropertyByName = function getPropertyByName(name1) {
11648
+ return ShaderProperty.getByName(name1);
11553
11649
  };
11554
11650
  _create_class$3(Shader, [
11555
11651
  {
@@ -11566,13 +11662,6 @@
11566
11662
  (function() {
11567
11663
  /** @internal */ Shader._compileMacros = new ShaderMacroCollection();
11568
11664
  })();
11569
- (function() {
11570
- /** @internal */ Shader._shaderExtension = [
11571
- "GL_EXT_shader_texture_lod",
11572
- "GL_OES_standard_derivatives",
11573
- "GL_EXT_draw_buffers"
11574
- ];
11575
- })();
11576
11665
  (function() {
11577
11666
  Shader._shaderMap = Object.create(null);
11578
11667
  })();
@@ -11897,10 +11986,10 @@
11897
11986
  })(exports.SpriteMaskInteraction || (exports.SpriteMaskInteraction = {}));
11898
11987
  // @ts-ignore
11899
11988
  var _Renderer;
11900
- exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
11989
+ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component1) {
11901
11990
  var Renderer1 = function Renderer1(entity) {
11902
11991
  var _this;
11903
- _this = Component.call(this, entity) || this;
11992
+ _this = Component1.call(this, entity) || this;
11904
11993
  /** @internal */ _this._onUpdateIndex = -1;
11905
11994
  /** @internal */ _this._rendererIndex = -1;
11906
11995
  /** @internal */ _this._globalShaderMacro = new ShaderMacroCollection();
@@ -11928,7 +12017,7 @@
11928
12017
  shaderData.setVector4(exports.Renderer._rendererLayerProperty, _this._rendererLayer);
11929
12018
  return _this;
11930
12019
  };
11931
- _inherits$2(Renderer1, Component);
12020
+ _inherits$2(Renderer1, Component1);
11932
12021
  var _proto = Renderer1.prototype;
11933
12022
  _proto.getInstanceMaterial = function getInstanceMaterial(index) {
11934
12023
  if (index === void 0) index = 0;
@@ -12047,7 +12136,7 @@
12047
12136
  /**
12048
12137
  * @internal
12049
12138
  */ _proto._onDestroy = function _onDestroy() {
12050
- Component.prototype._onDestroy.call(this);
12139
+ Component1.prototype._onDestroy.call(this);
12051
12140
  this.entity.transform._updateFlagManager.removeListener(this._onTransformChanged);
12052
12141
  this.shaderData._addReferCount(-1);
12053
12142
  var materials = this._materials;
@@ -12438,11 +12527,11 @@
12438
12527
  })(SpriteModifyFlags || (SpriteModifyFlags = {}));
12439
12528
  /**
12440
12529
  * A component for masking Sprites.
12441
- */ var SpriteMask = /*#__PURE__*/ function(Renderer) {
12442
- _inherits$2(SpriteMask, Renderer);
12530
+ */ var SpriteMask = /*#__PURE__*/ function(Renderer1) {
12531
+ _inherits$2(SpriteMask, Renderer1);
12443
12532
  function SpriteMask(entity) {
12444
12533
  var _this;
12445
- _this = Renderer.call(this, entity) || this;
12534
+ _this = Renderer1.call(this, entity) || this;
12446
12535
  /** The mask layers the sprite mask influence to. */ _this.influenceLayers = exports.SpriteMaskLayer.Everything;
12447
12536
  _this._sprite = null;
12448
12537
  _this._automaticWidth = 0;
@@ -12463,7 +12552,7 @@
12463
12552
  /**
12464
12553
  * @internal
12465
12554
  */ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
12466
- Renderer.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
12555
+ Renderer1.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
12467
12556
  target.sprite = this._sprite;
12468
12557
  };
12469
12558
  /**
@@ -12506,7 +12595,7 @@
12506
12595
  * @internal
12507
12596
  * @inheritdoc
12508
12597
  */ _proto._onDestroy = function _onDestroy() {
12509
- Renderer.prototype._onDestroy.call(this);
12598
+ Renderer1.prototype._onDestroy.call(this);
12510
12599
  var sprite = this._sprite;
12511
12600
  if (sprite) {
12512
12601
  sprite._addReferCount(-1);
@@ -12944,12 +13033,12 @@
12944
13033
  })(exports.SetDataOptions || (exports.SetDataOptions = {}));
12945
13034
  /**
12946
13035
  * Buffer.
12947
- */ var Buffer = /*#__PURE__*/ function(GraphicsResource) {
13036
+ */ var Buffer = /*#__PURE__*/ function(GraphicsResource1) {
12948
13037
  var Buffer = function Buffer(engine, type, byteLengthOrData, bufferUsage, readable) {
12949
13038
  if (bufferUsage === void 0) bufferUsage = exports.BufferUsage.Static;
12950
13039
  if (readable === void 0) readable = false;
12951
13040
  var _this;
12952
- _this = GraphicsResource.call(this, engine) || this;
13041
+ _this = GraphicsResource1.call(this, engine) || this;
12953
13042
  /** @internal */ _this._dataUpdateManager = new UpdateFlagManager();
12954
13043
  _this._engine = engine;
12955
13044
  _this._type = type;
@@ -12973,7 +13062,7 @@
12973
13062
  }
12974
13063
  return _this;
12975
13064
  };
12976
- _inherits$2(Buffer, GraphicsResource);
13065
+ _inherits$2(Buffer, GraphicsResource1);
12977
13066
  var _proto = Buffer.prototype;
12978
13067
  /**
12979
13068
  * Bind buffer.
@@ -13017,7 +13106,7 @@
13017
13106
  /**
13018
13107
  * @internal
13019
13108
  */ _proto._onDestroy = function _onDestroy() {
13020
- GraphicsResource.prototype._onDestroy.call(this);
13109
+ GraphicsResource1.prototype._onDestroy.call(this);
13021
13110
  this._platformBuffer.destroy();
13022
13111
  };
13023
13112
  _create_class$3(Buffer, [
@@ -13136,10 +13225,10 @@
13136
13225
  /**
13137
13226
  * @internal
13138
13227
  * Primitive.
13139
- */ var Primitive = /*#__PURE__*/ function(GraphicsResource) {
13228
+ */ var Primitive = /*#__PURE__*/ function(GraphicsResource1) {
13140
13229
  var Primitive = function Primitive(engine) {
13141
13230
  var _this;
13142
- _this = GraphicsResource.call(this, engine) || this;
13231
+ _this = GraphicsResource1.call(this, engine) || this;
13143
13232
  _this.enableVAO = true;
13144
13233
  _this.instanceCount = 0;
13145
13234
  _this.vertexBufferBindings = [];
@@ -13149,7 +13238,7 @@
13149
13238
  _this._platformPrimitive = engine._hardwareRenderer.createPlatformPrimitive(_assert_this_initialized(_this));
13150
13239
  return _this;
13151
13240
  };
13152
- _inherits$2(Primitive, GraphicsResource);
13241
+ _inherits$2(Primitive, GraphicsResource1);
13153
13242
  var _proto = Primitive.prototype;
13154
13243
  _proto.addVertexElement = function addVertexElement(element) {
13155
13244
  var vertexElementMap = this._vertexElementMap;
@@ -13205,9 +13294,9 @@
13205
13294
  var referCount = this._getReferCount();
13206
13295
  var vertexBufferBindings = this.vertexBufferBindings;
13207
13296
  if (referCount > 0) {
13208
- var _vertexBufferBindings_index;
13297
+ var _vertexBufferBindings_index, _binding;
13209
13298
  (_vertexBufferBindings_index = vertexBufferBindings[index]) == null ? void 0 : _vertexBufferBindings_index.buffer._addReferCount(-referCount);
13210
- binding == null ? void 0 : binding.buffer._addReferCount(referCount);
13299
+ (_binding = binding) == null ? void 0 : _binding.buffer._addReferCount(referCount);
13211
13300
  }
13212
13301
  vertexBufferBindings[index] = binding;
13213
13302
  this._bufferStructChanged = true;
@@ -13230,8 +13319,9 @@
13230
13319
  var lastBinding = this.indexBufferBinding;
13231
13320
  var referCount = this._getReferCount();
13232
13321
  if (lastBinding !== binding) {
13322
+ var _lastBinding, _lastBinding1, _binding;
13233
13323
  this._indexBufferBinding = binding;
13234
- referCount > 0 && (lastBinding == null ? void 0 : lastBinding.buffer._addReferCount(-referCount));
13324
+ referCount > 0 && ((_lastBinding = lastBinding) == null ? void 0 : _lastBinding.buffer._addReferCount(-referCount));
13235
13325
  if (binding) {
13236
13326
  referCount > 0 && binding.buffer._addReferCount(referCount);
13237
13327
  this._glIndexType = BufferUtil._getGLIndexType(binding.format);
@@ -13239,7 +13329,7 @@
13239
13329
  } else {
13240
13330
  this._glIndexType = undefined;
13241
13331
  }
13242
- this._bufferStructChanged = (lastBinding == null ? void 0 : lastBinding.buffer) !== (binding == null ? void 0 : binding.buffer);
13332
+ this._bufferStructChanged = ((_lastBinding1 = lastBinding) == null ? void 0 : _lastBinding1.buffer) !== ((_binding = binding) == null ? void 0 : _binding.buffer);
13243
13333
  }
13244
13334
  };
13245
13335
  _proto.draw = function draw(shaderProgram, subMesh) {
@@ -13248,7 +13338,7 @@
13248
13338
  };
13249
13339
  _proto._addReferCount = function _addReferCount(value) {
13250
13340
  var _this_indexBufferBinding;
13251
- GraphicsResource.prototype._addReferCount.call(this, value);
13341
+ GraphicsResource1.prototype._addReferCount.call(this, value);
13252
13342
  var vertexBufferBindings = this.vertexBufferBindings;
13253
13343
  for(var i = 0, n = vertexBufferBindings.length; i < n; i++){
13254
13344
  var _vertexBufferBindings_i;
@@ -13282,14 +13372,14 @@
13282
13372
  }(GraphicsResource);
13283
13373
  /**
13284
13374
  * Mesh.
13285
- */ var Mesh = /*#__PURE__*/ function(ReferResource) {
13286
- var Mesh = function Mesh(engine, name) {
13375
+ */ var Mesh = /*#__PURE__*/ function(ReferResource1) {
13376
+ var Mesh = function Mesh(engine, name1) {
13287
13377
  var _this;
13288
- _this = ReferResource.call(this, engine) || this;
13378
+ _this = ReferResource1.call(this, engine) || this;
13289
13379
  /** @internal */ _this._updateFlagManager = new UpdateFlagManager();
13290
13380
  _this._bounds = new BoundingBox();
13291
13381
  _this._subMeshes = [];
13292
- _this.name = name;
13382
+ _this.name = name1;
13293
13383
  _this._primitive = new Primitive(engine);
13294
13384
  _this._onBoundsChanged = _this._onBoundsChanged.bind(_assert_this_initialized(_this));
13295
13385
  var bounds = _this._bounds;
@@ -13299,7 +13389,7 @@
13299
13389
  bounds.max._onValueChanged = _this._onBoundsChanged;
13300
13390
  return _this;
13301
13391
  };
13302
- _inherits$2(Mesh, ReferResource);
13392
+ _inherits$2(Mesh, ReferResource1);
13303
13393
  var _proto = Mesh.prototype;
13304
13394
  _proto.addSubMesh = function addSubMesh(startOrSubMesh, count, topology) {
13305
13395
  if (topology === void 0) topology = exports.MeshTopology.Triangles;
@@ -13361,13 +13451,13 @@
13361
13451
  this._primitive.setVertexBufferBinding(index, binding);
13362
13452
  };
13363
13453
  _proto._addReferCount = function _addReferCount(value) {
13364
- ReferResource.prototype._addReferCount.call(this, value);
13454
+ ReferResource1.prototype._addReferCount.call(this, value);
13365
13455
  this._primitive._addReferCount(value);
13366
13456
  };
13367
13457
  /**
13368
13458
  * @internal
13369
13459
  */ _proto._onDestroy = function _onDestroy() {
13370
- ReferResource.prototype._onDestroy.call(this);
13460
+ ReferResource1.prototype._onDestroy.call(this);
13371
13461
  this._primitive.destroy();
13372
13462
  };
13373
13463
  /**
@@ -13534,13 +13624,13 @@
13534
13624
  /**
13535
13625
  * BlendShape.
13536
13626
  */ var BlendShape = /*#__PURE__*/ function() {
13537
- var BlendShape = function BlendShape(name) {
13627
+ var BlendShape = function BlendShape(name1) {
13538
13628
  /** @internal */ this._useBlendShapeNormal = true;
13539
13629
  /** @internal */ this._useBlendShapeTangent = true;
13540
13630
  /** @internal */ this._layoutChangeManager = new UpdateFlagManager();
13541
13631
  /** @internal */ this._dataChangeManager = new UpdateFlagManager();
13542
13632
  this._frames = [];
13543
- this.name = name;
13633
+ this.name = name1;
13544
13634
  this._frameDataChangeListener = this._frameDataChangeListener.bind(this);
13545
13635
  };
13546
13636
  var _proto = BlendShape.prototype;
@@ -13609,11 +13699,11 @@
13609
13699
  }();
13610
13700
  /**
13611
13701
  * BufferMesh.
13612
- */ var BufferMesh = /*#__PURE__*/ function(Mesh) {
13702
+ */ var BufferMesh = /*#__PURE__*/ function(Mesh1) {
13613
13703
  var BufferMesh = function BufferMesh() {
13614
- return Mesh.apply(this, arguments);
13704
+ return Mesh1.apply(this, arguments);
13615
13705
  };
13616
- _inherits$2(BufferMesh, Mesh);
13706
+ _inherits$2(BufferMesh, Mesh1);
13617
13707
  var _proto = BufferMesh.prototype;
13618
13708
  /**
13619
13709
  * Set vertex elements.
@@ -13694,20 +13784,20 @@
13694
13784
  }(Mesh);
13695
13785
  /**
13696
13786
  * MeshRenderer Component.
13697
- */ var MeshRenderer = /*#__PURE__*/ function(Renderer) {
13787
+ */ var MeshRenderer = /*#__PURE__*/ function(Renderer1) {
13698
13788
  var MeshRenderer = function MeshRenderer(entity) {
13699
13789
  var _this;
13700
- _this = Renderer.call(this, entity) || this;
13790
+ _this = Renderer1.call(this, entity) || this;
13701
13791
  _this._enableVertexColor = false;
13702
13792
  _this._onMeshChanged = _this._onMeshChanged.bind(_assert_this_initialized(_this));
13703
13793
  return _this;
13704
13794
  };
13705
- _inherits$2(MeshRenderer, Renderer);
13795
+ _inherits$2(MeshRenderer, Renderer1);
13706
13796
  var _proto = MeshRenderer.prototype;
13707
13797
  /**
13708
13798
  * @internal
13709
13799
  */ _proto._onDestroy = function _onDestroy() {
13710
- Renderer.prototype._onDestroy.call(this);
13800
+ Renderer1.prototype._onDestroy.call(this);
13711
13801
  var mesh = this._mesh;
13712
13802
  if (mesh) {
13713
13803
  mesh.destroyed || mesh._addReferCount(-1);
@@ -13718,7 +13808,7 @@
13718
13808
  /**
13719
13809
  * @internal
13720
13810
  */ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
13721
- Renderer.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
13811
+ Renderer1.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
13722
13812
  target.mesh = this._mesh;
13723
13813
  };
13724
13814
  /**
@@ -13728,7 +13818,7 @@
13728
13818
  Logger.error("mesh is null.");
13729
13819
  return;
13730
13820
  }
13731
- Renderer.prototype._prepareRender.call(this, context);
13821
+ Renderer1.prototype._prepareRender.call(this, context);
13732
13822
  };
13733
13823
  /**
13734
13824
  * @internal
@@ -14338,10 +14428,10 @@
14338
14428
  })(exports.VertexAttribute || (exports.VertexAttribute = {}));
14339
14429
  /**
14340
14430
  * Mesh containing common vertex elements of the model.
14341
- */ var ModelMesh = /*#__PURE__*/ function(Mesh) {
14342
- var ModelMesh = function ModelMesh(engine, name) {
14431
+ */ var ModelMesh = /*#__PURE__*/ function(Mesh1) {
14432
+ var ModelMesh = function ModelMesh(engine, name1) {
14343
14433
  var _this;
14344
- _this = Mesh.call(this, engine) || this;
14434
+ _this = Mesh1.call(this, engine) || this;
14345
14435
  /** @internal */ _this._internalVertexBufferIndex = -1;
14346
14436
  _this._vertexCount = 0;
14347
14437
  _this._vertexCountDirty = false;
@@ -14375,23 +14465,24 @@
14375
14465
  _this._indicesFormat = null;
14376
14466
  _this._indicesChangeFlag = false;
14377
14467
  /** @deprecated */ _this._accessible = true;
14378
- _this.name = name;
14468
+ _this.name = name1;
14379
14469
  _this._blendShapeManager = new BlendShapeManager(engine, _assert_this_initialized(_this));
14380
14470
  return _this;
14381
14471
  };
14382
- _inherits$2(ModelMesh, Mesh);
14472
+ _inherits$2(ModelMesh, Mesh1);
14383
14473
  var _proto = ModelMesh.prototype;
14384
14474
  /**
14385
14475
  * Set positions for the mesh.
14386
14476
  * @param positions - The positions for the mesh
14387
14477
  */ _proto.setPositions = function setPositions(positions) {
14478
+ var _positions;
14388
14479
  if (!this._positions && !positions) {
14389
14480
  return;
14390
14481
  }
14391
14482
  this._updateAdvancedVertexDataMarks(0x1, 0);
14392
14483
  this._positions = positions;
14393
14484
  var _positions_length;
14394
- this._vertexCount = (_positions_length = positions == null ? void 0 : positions.length) != null ? _positions_length : 0;
14485
+ this._vertexCount = (_positions_length = (_positions = positions) == null ? void 0 : _positions.length) != null ? _positions_length : 0;
14395
14486
  this._vertexCountDirty = false;
14396
14487
  };
14397
14488
  /**
@@ -14718,9 +14809,10 @@
14718
14809
  var vertexBufferInfos = this._vertexBufferInfos;
14719
14810
  var vertexBufferBindings = this._primitive.vertexBufferBindings;
14720
14811
  for(var i = 0, n = vertexBufferBindings.length; i < n; i++){
14812
+ var _vertexBufferInfo;
14721
14813
  var vertexBufferInfo = vertexBufferInfos[i];
14722
14814
  // VertexBufferInfo maybe undefined
14723
- if (vertexBufferInfo == null ? void 0 : vertexBufferInfo.uploadAdvancedData) {
14815
+ if ((_vertexBufferInfo = vertexBufferInfo) == null ? void 0 : _vertexBufferInfo.uploadAdvancedData) {
14724
14816
  var _vertexBufferBindings_i;
14725
14817
  var buffer = (_vertexBufferBindings_i = vertexBufferBindings[i]) == null ? void 0 : _vertexBufferBindings_i.buffer;
14726
14818
  buffer.setData(buffer.data);
@@ -14735,7 +14827,8 @@
14735
14827
  var indexBuffer = (_this__primitive_indexBufferBinding = this._primitive.indexBufferBinding) == null ? void 0 : _this__primitive_indexBufferBinding._buffer;
14736
14828
  if (indices) {
14737
14829
  if (!indexBuffer || indices.byteLength != indexBuffer.byteLength) {
14738
- indexBuffer == null ? void 0 : indexBuffer.destroy();
14830
+ var _indexBuffer;
14831
+ (_indexBuffer = indexBuffer) == null ? void 0 : _indexBuffer.destroy();
14739
14832
  var newIndexBuffer = new Buffer(this._engine, exports.BufferBindFlag.IndexBuffer, indices);
14740
14833
  this._setIndexBufferBinding(new IndexBufferBinding(newIndexBuffer, this._indicesFormat));
14741
14834
  } else {
@@ -14845,7 +14938,7 @@
14845
14938
  // Remove listener from previous binding
14846
14939
  var previousBinding = vertexBufferBindings[index];
14847
14940
  previousBinding && previousBinding.buffer._dataUpdateManager.removeListener(onVertexBufferChanged);
14848
- Mesh.prototype._setVertexBufferBinding.call(this, index, binding);
14941
+ Mesh1.prototype._setVertexBufferBinding.call(this, index, binding);
14849
14942
  // Add listener to new binding and trigger update
14850
14943
  if (binding) {
14851
14944
  var _updateInfos, _index;
@@ -14877,7 +14970,7 @@
14877
14970
  /**
14878
14971
  * @internal
14879
14972
  */ _proto._onDestroy = function _onDestroy() {
14880
- Mesh.prototype._onDestroy.call(this);
14973
+ Mesh1.prototype._onDestroy.call(this);
14881
14974
  this._releaseCache(true);
14882
14975
  };
14883
14976
  _proto._getVertexElementData = function _getVertexElementData(vertices, vertexAttribute, vertexElementIndex, readVertexData) {
@@ -14953,13 +15046,14 @@
14953
15046
  });
14954
15047
  };
14955
15048
  _proto._readVertexData = function _readVertexData(attributeType, onVertexParse) {
15049
+ var _bufferBinding;
14956
15050
  var primitive = this._primitive;
14957
15051
  var vertexElement = primitive._vertexElementMap[attributeType];
14958
15052
  if (!vertexElement) {
14959
15053
  return null;
14960
15054
  }
14961
15055
  var bufferBinding = primitive.vertexBufferBindings[vertexElement.bindingIndex];
14962
- var buffer = bufferBinding == null ? void 0 : bufferBinding.buffer;
15056
+ var buffer = (_bufferBinding = bufferBinding) == null ? void 0 : _bufferBinding.buffer;
14963
15057
  if (!buffer) {
14964
15058
  return null;
14965
15059
  }
@@ -15113,11 +15207,12 @@
15113
15207
  });
15114
15208
  };
15115
15209
  _proto._writeAdvancedVertexData = function _writeAdvancedVertexData(attribute, elementIndex, onVertexWrite) {
15210
+ var _bufferBinding;
15116
15211
  var primitive = this._primitive;
15117
15212
  var vertexElement = primitive._vertexElementMap[attribute];
15118
15213
  var bindingIndex = vertexElement.bindingIndex;
15119
15214
  var bufferBinding = primitive.vertexBufferBindings[bindingIndex];
15120
- var buffer = bufferBinding == null ? void 0 : bufferBinding.buffer;
15215
+ var buffer = (_bufferBinding = bufferBinding) == null ? void 0 : _bufferBinding.buffer;
15121
15216
  if (!buffer) {
15122
15217
  return;
15123
15218
  }
@@ -15412,14 +15507,14 @@
15412
15507
  })(VertexElementIndex || (VertexElementIndex = {}));
15413
15508
  /**
15414
15509
  * @internal
15415
- */ var PrimitiveMeshRestorer = /*#__PURE__*/ function(ContentRestorer) {
15510
+ */ var PrimitiveMeshRestorer = /*#__PURE__*/ function(ContentRestorer1) {
15416
15511
  var PrimitiveMeshRestorer = function PrimitiveMeshRestorer(resource, primitiveInfo) {
15417
15512
  var _this;
15418
- _this = ContentRestorer.call(this, resource) || this;
15513
+ _this = ContentRestorer1.call(this, resource) || this;
15419
15514
  _this.primitiveInfo = primitiveInfo;
15420
15515
  return _this;
15421
15516
  };
15422
- _inherits$2(PrimitiveMeshRestorer, ContentRestorer);
15517
+ _inherits$2(PrimitiveMeshRestorer, ContentRestorer1);
15423
15518
  var _proto = PrimitiveMeshRestorer.prototype;
15424
15519
  _proto.restoreContent = function restoreContent() {
15425
15520
  var primitiveInfo = this.primitiveInfo;
@@ -16414,26 +16509,26 @@
16414
16509
  })();
16415
16510
  /**
16416
16511
  * Mesh skin data, equal glTF skins define
16417
- */ var Skin = /*#__PURE__*/ function(EngineObject) {
16418
- var Skin = function Skin(name) {
16512
+ */ var Skin = /*#__PURE__*/ function(EngineObject1) {
16513
+ var Skin = function Skin(name1) {
16419
16514
  var _this;
16420
- _this = EngineObject.call(this, null) || this;
16421
- _this.name = name;
16515
+ _this = EngineObject1.call(this, null) || this;
16516
+ _this.name = name1;
16422
16517
  _this._bones = [];
16423
16518
  _this.inverseBindMatrices = []; // inverse bind matrix array
16424
16519
  _this.joints = []; // joints name array, element type: string
16425
16520
  _this.skeleton = "none"; // root bone name
16426
16521
  return _this;
16427
16522
  };
16428
- _inherits$2(Skin, EngineObject);
16523
+ _inherits$2(Skin, EngineObject1);
16429
16524
  return Skin;
16430
16525
  }(EngineObject);
16431
16526
  /**
16432
16527
  * SkinnedMeshRenderer.
16433
- */ var SkinnedMeshRenderer = /*#__PURE__*/ function(MeshRenderer) {
16528
+ */ var SkinnedMeshRenderer = /*#__PURE__*/ function(MeshRenderer1) {
16434
16529
  var SkinnedMeshRenderer = function SkinnedMeshRenderer(entity) {
16435
16530
  var _this;
16436
- _this = MeshRenderer.call(this, entity) || this;
16531
+ _this = MeshRenderer1.call(this, entity) || this;
16437
16532
  _this._jointDataCreateCache = new Vector2(-1, -1);
16438
16533
  _this._localBounds = new BoundingBox();
16439
16534
  _this._skin = null;
@@ -16452,7 +16547,7 @@
16452
16547
  localBounds.max._onValueChanged = _this._onLocalBoundsChanged;
16453
16548
  return _this;
16454
16549
  };
16455
- _inherits$2(SkinnedMeshRenderer, MeshRenderer);
16550
+ _inherits$2(SkinnedMeshRenderer, MeshRenderer1);
16456
16551
  var _proto = SkinnedMeshRenderer.prototype;
16457
16552
  /**
16458
16553
  * @internal
@@ -16532,7 +16627,7 @@
16532
16627
  * @internal
16533
16628
  */ _proto._onDestroy = function _onDestroy() {
16534
16629
  var _this__rootBone, _this__jointTexture;
16535
- MeshRenderer.prototype._onDestroy.call(this);
16630
+ MeshRenderer1.prototype._onDestroy.call(this);
16536
16631
  (_this__rootBone = this._rootBone) == null ? void 0 : _this__rootBone.transform._updateFlagManager.removeListener(this._onTransformChanged);
16537
16632
  this._rootBone = null;
16538
16633
  this._jointDataCreateCache = null;
@@ -16547,7 +16642,7 @@
16547
16642
  /**
16548
16643
  * @internal
16549
16644
  */ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
16550
- MeshRenderer.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
16645
+ MeshRenderer1.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
16551
16646
  var paths = new Array();
16552
16647
  // Clone rootBone
16553
16648
  if (this.rootBone) {
@@ -16581,7 +16676,7 @@
16581
16676
  var worldMatrix = this._rootBone.transform.worldMatrix;
16582
16677
  BoundingBox.transform(localBounds, worldMatrix, worldBounds);
16583
16678
  } else {
16584
- MeshRenderer.prototype._updateBounds.call(this, worldBounds);
16679
+ MeshRenderer1.prototype._updateBounds.call(this, worldBounds);
16585
16680
  }
16586
16681
  };
16587
16682
  _proto._checkBlendShapeWeightLength = function _checkBlendShapeWeightLength() {
@@ -16690,11 +16785,11 @@
16690
16785
  },
16691
16786
  set: function set(value) {
16692
16787
  if (this._bones !== value) {
16693
- var _this__bones;
16788
+ var _this__bones, _value;
16694
16789
  var _this__bones_length;
16695
16790
  var lastBoneCount = (_this__bones_length = (_this__bones = this._bones) == null ? void 0 : _this__bones.length) != null ? _this__bones_length : 0;
16696
16791
  var _value_length;
16697
- var boneCount = (_value_length = value == null ? void 0 : value.length) != null ? _value_length : 0;
16792
+ var boneCount = (_value_length = (_value = value) == null ? void 0 : _value.length) != null ? _value_length : 0;
16698
16793
  if (lastBoneCount !== boneCount) {
16699
16794
  var shaderData = this.shaderData;
16700
16795
  if (boneCount > 0) {
@@ -16938,11 +17033,11 @@
16938
17033
  (function() {
16939
17034
  Basic2DBatcher._canUploadSameBuffer = true;
16940
17035
  })();
16941
- var SpriteMaskBatcher = /*#__PURE__*/ function(Basic2DBatcher) {
17036
+ var SpriteMaskBatcher = /*#__PURE__*/ function(Basic2DBatcher1) {
16942
17037
  var SpriteMaskBatcher = function SpriteMaskBatcher() {
16943
- return Basic2DBatcher.apply(this, arguments);
17038
+ return Basic2DBatcher1.apply(this, arguments);
16944
17039
  };
16945
- _inherits$2(SpriteMaskBatcher, Basic2DBatcher);
17040
+ _inherits$2(SpriteMaskBatcher, Basic2DBatcher1);
16946
17041
  var _proto = SpriteMaskBatcher.prototype;
16947
17042
  _proto.createVertexElements = function createVertexElements(vertexElements) {
16948
17043
  vertexElements[0] = new VertexElement("POSITION", 0, exports.VertexElementFormat.Vector3, 0);
@@ -17076,15 +17171,15 @@
17076
17171
  };
17077
17172
  return SpriteMaskManager;
17078
17173
  }();
17079
- var SpriteMaskRenderData = /*#__PURE__*/ function(RenderData) {
17174
+ var SpriteMaskRenderData = /*#__PURE__*/ function(RenderData1) {
17080
17175
  var SpriteMaskRenderData = function SpriteMaskRenderData() {
17081
17176
  var _this;
17082
- _this = RenderData.call(this) || this;
17177
+ _this = RenderData1.call(this) || this;
17083
17178
  _this.isAdd = true;
17084
17179
  _this.multiRenderData = false;
17085
17180
  return _this;
17086
17181
  };
17087
- _inherits$2(SpriteMaskRenderData, RenderData);
17182
+ _inherits$2(SpriteMaskRenderData, RenderData1);
17088
17183
  var _proto = SpriteMaskRenderData.prototype;
17089
17184
  _proto.set = function set(component, material, verticesData) {
17090
17185
  this.component = component;
@@ -17096,14 +17191,14 @@
17096
17191
  };
17097
17192
  return SpriteMaskRenderData;
17098
17193
  }(RenderData);
17099
- var SpriteRenderData = /*#__PURE__*/ function(RenderData) {
17194
+ var SpriteRenderData = /*#__PURE__*/ function(RenderData1) {
17100
17195
  var SpriteRenderData = function SpriteRenderData() {
17101
17196
  var _this;
17102
- _this = RenderData.call(this) || this;
17197
+ _this = RenderData1.call(this) || this;
17103
17198
  _this.multiRenderData = false;
17104
17199
  return _this;
17105
17200
  };
17106
- _inherits$2(SpriteRenderData, RenderData);
17201
+ _inherits$2(SpriteRenderData, RenderData1);
17107
17202
  var _proto = SpriteRenderData.prototype;
17108
17203
  _proto.set = function set(component, material, verticesData, texture, dataIndex) {
17109
17204
  if (dataIndex === void 0) dataIndex = 0;
@@ -17118,15 +17213,15 @@
17118
17213
  };
17119
17214
  return SpriteRenderData;
17120
17215
  }(RenderData);
17121
- var TextRenderData = /*#__PURE__*/ function(RenderData) {
17216
+ var TextRenderData = /*#__PURE__*/ function(RenderData1) {
17122
17217
  var TextRenderData = function TextRenderData() {
17123
17218
  var _this;
17124
- _this = RenderData.call(this) || this;
17219
+ _this = RenderData1.call(this) || this;
17125
17220
  _this.charsData = [];
17126
17221
  _this.multiRenderData = true;
17127
17222
  return _this;
17128
17223
  };
17129
- _inherits$2(TextRenderData, RenderData);
17224
+ _inherits$2(TextRenderData, RenderData1);
17130
17225
  var _proto = TextRenderData.prototype;
17131
17226
  _proto.dispose = function dispose() {
17132
17227
  this.component = this.material = null;
@@ -17167,6 +17262,7 @@
17167
17262
  AssetType[/** HDR to cube. */ "HDR"] = "HDR";
17168
17263
  AssetType[/** Font. */ "Font"] = "Font";
17169
17264
  AssetType[/** Source Font, include ttf、 otf and woff. */ "SourceFont"] = "SourceFont";
17265
+ AssetType[/** Project asset. */ "Project"] = "project";
17170
17266
  })(exports.AssetType || (exports.AssetType = {}));
17171
17267
  var SafeLoopArray = /*#__PURE__*/ function() {
17172
17268
  var SafeLoopArray = function SafeLoopArray() {
@@ -17788,10 +17884,10 @@
17788
17884
  queryPath: this._getParameterByName("q", path)
17789
17885
  };
17790
17886
  };
17791
- _proto._getParameterByName = function _getParameterByName(name, url) {
17887
+ _proto._getParameterByName = function _getParameterByName(name1, url) {
17792
17888
  if (url === void 0) url = window.location.href;
17793
- name = name.replace(/[\[\]]/g, "\\$&");
17794
- var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);
17889
+ name1 = name1.replace(/[\[\]]/g, "\\$&");
17890
+ var regex = new RegExp("[?&]" + name1 + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);
17795
17891
  if (!results) return null;
17796
17892
  if (!results[2]) return "";
17797
17893
  return decodeURIComponent(results[2].replace(/\+/g, " "));
@@ -18439,16 +18535,16 @@
18439
18535
  CameraClearFlags[CameraClearFlags[/* Clear depth and stencil. */ "DepthStencil"] = 0x6] = "DepthStencil";
18440
18536
  CameraClearFlags[CameraClearFlags[/* Clear color with scene background, depth, and stencil. */ "All"] = 0x7] = "All";
18441
18537
  })(exports.CameraClearFlags || (exports.CameraClearFlags = {}));
18442
- exports.Collider = /*#__PURE__*/ function(Component) {
18538
+ exports.Collider = /*#__PURE__*/ function(Component1) {
18443
18539
  var Collider = function Collider(entity) {
18444
18540
  var _this;
18445
- _this = Component.call(this, entity) || this;
18541
+ _this = Component1.call(this, entity) || this;
18446
18542
  /** @internal */ _this._index = -1;
18447
18543
  _this._shapes = [];
18448
18544
  _this._updateFlag = _this.entity.transform.registerWorldChangeFlag();
18449
18545
  return _this;
18450
18546
  };
18451
- _inherits$2(Collider, Component);
18547
+ _inherits$2(Collider, Component1);
18452
18548
  var _proto = Collider.prototype;
18453
18549
  /**
18454
18550
  * Add collider shape on this collider.
@@ -18518,7 +18614,7 @@
18518
18614
  /**
18519
18615
  * @internal
18520
18616
  */ _proto._onDestroy = function _onDestroy() {
18521
- Component.prototype._onDestroy.call(this);
18617
+ Component1.prototype._onDestroy.call(this);
18522
18618
  this.clearShapes();
18523
18619
  this._nativeCollider.destroy();
18524
18620
  };
@@ -18819,10 +18915,10 @@
18819
18915
  })(exports.ControllerNonWalkableMode || (exports.ControllerNonWalkableMode = {}));
18820
18916
  /**
18821
18917
  * The character controllers.
18822
- */ var CharacterController = /*#__PURE__*/ function(Collider) {
18918
+ */ var CharacterController = /*#__PURE__*/ function(Collider1) {
18823
18919
  var CharacterController = function CharacterController(entity) {
18824
18920
  var _this;
18825
- _this = Collider.call(this, entity) || this;
18921
+ _this = Collider1.call(this, entity) || this;
18826
18922
  _this._stepOffset = 0.5;
18827
18923
  _this._nonWalkableMode = exports.ControllerNonWalkableMode.PreventClimbing;
18828
18924
  _this._upDirection = new Vector3(0, 1, 0);
@@ -18833,7 +18929,7 @@
18833
18929
  _this._upDirection._onValueChanged = _this._setUpDirection;
18834
18930
  return _this;
18835
18931
  };
18836
- _inherits$2(CharacterController, Collider);
18932
+ _inherits$2(CharacterController, Collider1);
18837
18933
  var _proto = CharacterController.prototype;
18838
18934
  /**
18839
18935
  * Moves the character using a "collide-and-slide" algorithm.
@@ -18851,14 +18947,14 @@
18851
18947
  if (this._shapes.length > 0) {
18852
18948
  throw "only allow single shape on controller!";
18853
18949
  }
18854
- Collider.prototype.addShape.call(this, shape);
18950
+ Collider1.prototype.addShape.call(this, shape);
18855
18951
  this._updateFlag.flag = true;
18856
18952
  };
18857
18953
  /**
18858
18954
  * Remove all shape attached.
18859
18955
  */ _proto.clearShapes = function clearShapes() {
18860
18956
  if (this._shapes.length > 0) {
18861
- Collider.prototype.removeShape.call(this, this._shapes[0]);
18957
+ Collider1.prototype.removeShape.call(this, this._shapes[0]);
18862
18958
  }
18863
18959
  };
18864
18960
  /**
@@ -18957,10 +19053,10 @@
18957
19053
  }(exports.Collider);
18958
19054
  /**
18959
19055
  * A dynamic collider can act with self-defined movement or physical force.
18960
- */ var DynamicCollider = /*#__PURE__*/ function(Collider) {
19056
+ */ var DynamicCollider = /*#__PURE__*/ function(Collider1) {
18961
19057
  var DynamicCollider = function DynamicCollider(entity) {
18962
19058
  var _this;
18963
- _this = Collider.call(this, entity) || this;
19059
+ _this = Collider1.call(this, entity) || this;
18964
19060
  _this._linearDamping = 0;
18965
19061
  _this._angularDamping = 0.05;
18966
19062
  _this._linearVelocity = new Vector3();
@@ -18991,7 +19087,7 @@
18991
19087
  _this._inertiaTensor._onValueChanged = _this._setInertiaTensor;
18992
19088
  return _this;
18993
19089
  };
18994
- _inherits$2(DynamicCollider, Collider);
19090
+ _inherits$2(DynamicCollider, Collider1);
18995
19091
  var _proto = DynamicCollider.prototype;
18996
19092
  /**
18997
19093
  * Apply a force to the DynamicCollider.
@@ -19362,15 +19458,15 @@
19362
19458
  /**
19363
19459
  * A static collider component that will not move.
19364
19460
  * @remarks Mostly used for object which always stays at the same place and never moves around.
19365
- */ var StaticCollider = /*#__PURE__*/ function(Collider) {
19461
+ */ var StaticCollider = /*#__PURE__*/ function(Collider1) {
19366
19462
  var StaticCollider = function StaticCollider(entity) {
19367
19463
  var _this;
19368
- _this = Collider.call(this, entity) || this;
19464
+ _this = Collider1.call(this, entity) || this;
19369
19465
  var transform = _this.entity.transform;
19370
19466
  _this._nativeCollider = PhysicsScene._nativePhysics.createStaticCollider(transform.worldPosition, transform.worldRotationQuaternion);
19371
19467
  return _this;
19372
19468
  };
19373
- _inherits$2(StaticCollider, Collider);
19469
+ _inherits$2(StaticCollider, Collider1);
19374
19470
  return StaticCollider;
19375
19471
  }(exports.Collider);
19376
19472
  /**
@@ -19389,10 +19485,10 @@
19389
19485
  ControllerCollisionFlag[ControllerCollisionFlag[/** Character has collision above. */ "Up"] = 2] = "Up";
19390
19486
  ControllerCollisionFlag[ControllerCollisionFlag[/** Character has collision below. */ "Down"] = 4] = "Down";
19391
19487
  })(exports.ControllerCollisionFlag || (exports.ControllerCollisionFlag = {}));
19392
- exports.Joint = /*#__PURE__*/ function(Component) {
19488
+ exports.Joint = /*#__PURE__*/ function(Component1) {
19393
19489
  var Joint = function Joint(entity) {
19394
19490
  var _this;
19395
- _this = Component.call(this, entity) || this;
19491
+ _this = Component1.call(this, entity) || this;
19396
19492
  _this._connectedCollider = new JointCollider();
19397
19493
  _this._collider = new JointCollider();
19398
19494
  _this._force = 0;
@@ -19400,7 +19496,7 @@
19400
19496
  _this._connectedCollider.localPosition = new Vector3();
19401
19497
  return _this;
19402
19498
  };
19403
- _inherits$2(Joint, Component);
19499
+ _inherits$2(Joint, Component1);
19404
19500
  _create_class$3(Joint, [
19405
19501
  {
19406
19502
  key: "connectedCollider",
@@ -19531,11 +19627,11 @@
19531
19627
  };
19532
19628
  /*
19533
19629
  * A fixed joint permits no relative movement between two colliders. ie the colliders are glued together.
19534
- */ var FixedJoint = /*#__PURE__*/ function(Joint) {
19630
+ */ var FixedJoint = /*#__PURE__*/ function(Joint1) {
19535
19631
  var FixedJoint = function FixedJoint() {
19536
- return Joint.apply(this, arguments);
19632
+ return Joint1.apply(this, arguments);
19537
19633
  };
19538
- _inherits$2(FixedJoint, Joint);
19634
+ _inherits$2(FixedJoint, Joint1);
19539
19635
  var _proto = FixedJoint.prototype;
19540
19636
  /**
19541
19637
  * @internal
@@ -19551,22 +19647,23 @@
19551
19647
  * @internal
19552
19648
  */ var HingeJointFlag;
19553
19649
  (function(HingeJointFlag) {
19554
- HingeJointFlag[HingeJointFlag[/** enable the limit */ "LimitEnabled"] = 1] = "LimitEnabled";
19555
- HingeJointFlag[HingeJointFlag[/** enable the drive */ "DriveEnabled"] = 2] = "DriveEnabled";
19556
- HingeJointFlag[HingeJointFlag[/** if the existing velocity is beyond the drive velocity, do not add force */ "DriveFreeSpin"] = 4] = "DriveFreeSpin";
19650
+ HingeJointFlag[HingeJointFlag[/** None. */ "None"] = 0] = "None";
19651
+ HingeJointFlag[HingeJointFlag[/** Enable the limit. */ "LimitEnabled"] = 1] = "LimitEnabled";
19652
+ HingeJointFlag[HingeJointFlag[/** Enable the drive. */ "DriveEnabled"] = 2] = "DriveEnabled";
19653
+ HingeJointFlag[HingeJointFlag[/** If the existing velocity is beyond the drive velocity, do not add force. */ "DriveFreeSpin"] = 4] = "DriveFreeSpin";
19557
19654
  })(HingeJointFlag || (HingeJointFlag = {}));
19558
19655
  /**
19559
19656
  * A joint which behaves in a similar way to a hinge or axle.
19560
- */ var HingeJoint = /*#__PURE__*/ function(Joint) {
19657
+ */ var HingeJoint = /*#__PURE__*/ function(Joint1) {
19561
19658
  var HingeJoint = function HingeJoint() {
19562
19659
  var _this;
19563
- _this = Joint.apply(this, arguments) || this;
19660
+ _this = Joint1.apply(this, arguments) || this;
19564
19661
  _this._axis = new Vector3(1, 0, 0);
19565
- _this._hingeFlags = 0;
19662
+ _this._hingeFlags = HingeJointFlag.None;
19566
19663
  _this._useSpring = false;
19567
19664
  return _this;
19568
19665
  };
19569
- _inherits$2(HingeJoint, Joint);
19666
+ _inherits$2(HingeJoint, Joint1);
19570
19667
  var _proto = HingeJoint.prototype;
19571
19668
  /**
19572
19669
  * @internal
@@ -19632,9 +19729,9 @@
19632
19729
  },
19633
19730
  set: function set(value) {
19634
19731
  if (value !== this.useLimits) {
19635
- this._hingeFlags |= HingeJointFlag.LimitEnabled;
19732
+ value ? this._hingeFlags |= HingeJointFlag.LimitEnabled : this._hingeFlags &= ~HingeJointFlag.LimitEnabled;
19733
+ this._nativeJoint.setHingeJointFlag(HingeJointFlag.LimitEnabled, value);
19636
19734
  }
19637
- this._nativeJoint.setHingeJointFlag(HingeJointFlag.LimitEnabled, value);
19638
19735
  }
19639
19736
  },
19640
19737
  {
@@ -19646,9 +19743,9 @@
19646
19743
  },
19647
19744
  set: function set(value) {
19648
19745
  if (value !== this.useMotor) {
19649
- this._hingeFlags |= HingeJointFlag.DriveEnabled;
19746
+ value ? this._hingeFlags |= HingeJointFlag.DriveEnabled : this._hingeFlags &= ~HingeJointFlag.DriveEnabled;
19747
+ this._nativeJoint.setHingeJointFlag(HingeJointFlag.DriveEnabled, value);
19650
19748
  }
19651
- this._nativeJoint.setHingeJointFlag(HingeJointFlag.DriveEnabled, value);
19652
19749
  }
19653
19750
  },
19654
19751
  {
@@ -19705,10 +19802,10 @@
19705
19802
  }(exports.Joint);
19706
19803
  /**
19707
19804
  * A joint that maintains an upper or lower bound (or both) on the distance between two points on different objects.
19708
- */ var SpringJoint = /*#__PURE__*/ function(Joint) {
19805
+ */ var SpringJoint = /*#__PURE__*/ function(Joint1) {
19709
19806
  var SpringJoint = function SpringJoint() {
19710
19807
  var _this;
19711
- _this = Joint.apply(this, arguments) || this;
19808
+ _this = Joint1.apply(this, arguments) || this;
19712
19809
  _this._minDistance = 0;
19713
19810
  _this._maxDistance = 0;
19714
19811
  _this._tolerance = 0.25;
@@ -19716,7 +19813,7 @@
19716
19813
  _this._damping = 0;
19717
19814
  return _this;
19718
19815
  };
19719
- _inherits$2(SpringJoint, Joint);
19816
+ _inherits$2(SpringJoint, Joint1);
19720
19817
  var _proto = SpringJoint.prototype;
19721
19818
  /**
19722
19819
  * @internal
@@ -19960,10 +20057,10 @@
19960
20057
  })();
19961
20058
  /**
19962
20059
  * Physical collider shape for box.
19963
- */ var BoxColliderShape = /*#__PURE__*/ function(ColliderShape) {
20060
+ */ var BoxColliderShape = /*#__PURE__*/ function(ColliderShape1) {
19964
20061
  var BoxColliderShape = function BoxColliderShape() {
19965
20062
  var _this;
19966
- _this = ColliderShape.call(this) || this;
20063
+ _this = ColliderShape1.call(this) || this;
19967
20064
  _this._size = new Vector3(1, 1, 1);
19968
20065
  _this._nativeShape = PhysicsScene._nativePhysics.createBoxColliderShape(_this._id, _this._size, _this._material._nativeMaterial);
19969
20066
  _this._setSize = _this._setSize.bind(_assert_this_initialized(_this));
@@ -19971,7 +20068,7 @@
19971
20068
  _this._size._onValueChanged = _this._setSize;
19972
20069
  return _this;
19973
20070
  };
19974
- _inherits$2(BoxColliderShape, ColliderShape);
20071
+ _inherits$2(BoxColliderShape, ColliderShape1);
19975
20072
  var _proto = BoxColliderShape.prototype;
19976
20073
  _proto._setSize = function _setSize() {
19977
20074
  this._nativeShape.setSize(this._size);
@@ -19995,15 +20092,15 @@
19995
20092
  }(ColliderShape);
19996
20093
  /**
19997
20094
  * Physical collider shape for sphere.
19998
- */ var SphereColliderShape = /*#__PURE__*/ function(ColliderShape) {
20095
+ */ var SphereColliderShape = /*#__PURE__*/ function(ColliderShape1) {
19999
20096
  var SphereColliderShape = function SphereColliderShape() {
20000
20097
  var _this;
20001
- _this = ColliderShape.call(this) || this;
20098
+ _this = ColliderShape1.call(this) || this;
20002
20099
  _this._radius = 1;
20003
20100
  _this._nativeShape = PhysicsScene._nativePhysics.createSphereColliderShape(_this._id, _this._radius, _this._material._nativeMaterial);
20004
20101
  return _this;
20005
20102
  };
20006
- _inherits$2(SphereColliderShape, ColliderShape);
20103
+ _inherits$2(SphereColliderShape, ColliderShape1);
20007
20104
  _create_class$3(SphereColliderShape, [
20008
20105
  {
20009
20106
  key: "radius",
@@ -20024,29 +20121,29 @@
20024
20121
  }(ColliderShape);
20025
20122
  /**
20026
20123
  * Physical collider shape plane.
20027
- */ var PlaneColliderShape = /*#__PURE__*/ function(ColliderShape) {
20124
+ */ var PlaneColliderShape = /*#__PURE__*/ function(ColliderShape1) {
20028
20125
  var PlaneColliderShape = function PlaneColliderShape() {
20029
20126
  var _this;
20030
- _this = ColliderShape.call(this) || this;
20127
+ _this = ColliderShape1.call(this) || this;
20031
20128
  _this._nativeShape = PhysicsScene._nativePhysics.createPlaneColliderShape(_this._id, _this._material._nativeMaterial);
20032
20129
  return _this;
20033
20130
  };
20034
- _inherits$2(PlaneColliderShape, ColliderShape);
20131
+ _inherits$2(PlaneColliderShape, ColliderShape1);
20035
20132
  return PlaneColliderShape;
20036
20133
  }(ColliderShape);
20037
20134
  /**
20038
20135
  * Physical collider shape for capsule.
20039
- */ var CapsuleColliderShape = /*#__PURE__*/ function(ColliderShape) {
20136
+ */ var CapsuleColliderShape = /*#__PURE__*/ function(ColliderShape1) {
20040
20137
  var CapsuleColliderShape = function CapsuleColliderShape() {
20041
20138
  var _this;
20042
- _this = ColliderShape.call(this) || this;
20139
+ _this = ColliderShape1.call(this) || this;
20043
20140
  _this._radius = 1;
20044
20141
  _this._height = 2;
20045
20142
  _this._upAxis = exports.ColliderShapeUpAxis.Y;
20046
20143
  _this._nativeShape = PhysicsScene._nativePhysics.createCapsuleColliderShape(_this._id, _this._radius, _this._height, _this._material._nativeMaterial);
20047
20144
  return _this;
20048
20145
  };
20049
- _inherits$2(CapsuleColliderShape, ColliderShape);
20146
+ _inherits$2(CapsuleColliderShape, ColliderShape1);
20050
20147
  _create_class$3(CapsuleColliderShape, [
20051
20148
  {
20052
20149
  key: "radius",
@@ -20121,44 +20218,55 @@
20121
20218
  /**
20122
20219
  * @internal
20123
20220
  */ _proto._update = function _update() {
20124
- var _this = this, pointers = _this._pointers, nativeEvents = _this._nativeEvents;
20221
+ var _this = this, pointers = _this._pointers, nativeEvents = _this._nativeEvents, htmlCanvas = _this._htmlCanvas;
20222
+ var _this__canvas = this._canvas, width = _this__canvas.width, height = _this__canvas.height;
20223
+ var clientWidth = htmlCanvas.clientWidth, clientHeight = htmlCanvas.clientHeight;
20224
+ var _htmlCanvas_getBoundingClientRect = htmlCanvas.getBoundingClientRect(), left = _htmlCanvas_getBoundingClientRect.left, top = _htmlCanvas_getBoundingClientRect.top;
20225
+ var widthDPR = width / clientWidth;
20226
+ var heightDPR = height / clientHeight;
20125
20227
  // Clean up the pointer released in the previous frame
20126
- var lastIndex = pointers.length - 1;
20127
- if (lastIndex >= 0) {
20128
- for(var i = lastIndex; i >= 0; i--){
20129
- if (pointers[i].phase === exports.PointerPhase.Leave) {
20130
- pointers.splice(i, 1);
20131
- }
20228
+ for(var i = pointers.length - 1; i >= 0; i--){
20229
+ if (pointers[i].phase === exports.PointerPhase.Leave) {
20230
+ pointers.splice(i, 1);
20132
20231
  }
20133
20232
  }
20134
20233
  // Generate the pointer received for this frame
20135
- lastIndex = nativeEvents.length - 1;
20136
- if (lastIndex >= 0) {
20137
- for(var i1 = 0; i1 <= lastIndex; i1++){
20138
- var _this__getPointer;
20139
- var evt = nativeEvents[i1];
20140
- (_this__getPointer = this._getPointer(evt.pointerId)) == null ? void 0 : _this__getPointer._events.push(evt);
20234
+ for(var i1 = 0, n = nativeEvents.length; i1 < n; i1++){
20235
+ var evt = nativeEvents[i1];
20236
+ var pointerId = evt.pointerId;
20237
+ var pointer = this._getPointerByID(pointerId);
20238
+ if (pointer) {
20239
+ pointer._events.push(evt);
20240
+ } else {
20241
+ var lastCount = pointers.length;
20242
+ if (lastCount === 0 || this._multiPointerEnabled) {
20243
+ var _pointerPool, _i;
20244
+ var _this1 = this, pointerPool = _this1._pointerPool;
20245
+ // Get Pointer smallest index
20246
+ var i2 = 0;
20247
+ for(; i2 < lastCount; i2++){
20248
+ if (pointers[i2].id > i2) {
20249
+ break;
20250
+ }
20251
+ }
20252
+ pointer = (_pointerPool = pointerPool)[_i = i2] || (_pointerPool[_i] = new Pointer(i2));
20253
+ pointer._uniqueID = pointerId;
20254
+ pointer._events.push(evt);
20255
+ pointer.position.set((evt.clientX - left) * widthDPR, (evt.clientY - top) * heightDPR);
20256
+ pointers.splice(i2, 0, pointer);
20257
+ }
20141
20258
  }
20142
- nativeEvents.length = 0;
20143
20259
  }
20260
+ nativeEvents.length = 0;
20144
20261
  // Pointer handles its own events
20145
20262
  this._upList.length = this._downList.length = 0;
20146
20263
  this._buttons = exports.PointerButton.None;
20147
- lastIndex = pointers.length - 1;
20148
- if (lastIndex >= 0) {
20149
- var frameCount = this._engine.time.frameCount;
20150
- var _this__htmlCanvas_getBoundingClientRect = this._htmlCanvas.getBoundingClientRect(), left = _this__htmlCanvas_getBoundingClientRect.left, top = _this__htmlCanvas_getBoundingClientRect.top;
20151
- var _this__htmlCanvas = this._htmlCanvas, clientWidth = _this__htmlCanvas.clientWidth, clientHeight = _this__htmlCanvas.clientHeight;
20152
- var _this__canvas = this._canvas, width = _this__canvas.width, height = _this__canvas.height;
20153
- // Device Pixel Ratio
20154
- var widthDPR = width / clientWidth;
20155
- var heightDPR = height / clientHeight;
20156
- for(var i2 = lastIndex; i2 >= 0; i2--){
20157
- var pointer = pointers[i2];
20158
- pointer._upList.length = pointer._downList.length = 0;
20159
- this._updatePointerInfo(frameCount, pointer, left, top, widthDPR, heightDPR);
20160
- this._buttons |= pointer.pressedButtons;
20161
- }
20264
+ var frameCount = this._engine.time.frameCount;
20265
+ for(var i3 = 0, n1 = pointers.length; i3 < n1; i3++){
20266
+ var pointer1 = pointers[i3];
20267
+ pointer1._upList.length = pointer1._downList.length = 0;
20268
+ this._updatePointerInfo(frameCount, pointer1, left, top, widthDPR, heightDPR);
20269
+ this._buttons |= pointer1.pressedButtons;
20162
20270
  }
20163
20271
  };
20164
20272
  /**
@@ -20257,42 +20365,14 @@
20257
20365
  evt.type === "pointerdown" && this._htmlCanvas.focus();
20258
20366
  this._nativeEvents.push(evt);
20259
20367
  };
20260
- _proto._getIndexByPointerID = function _getIndexByPointerID(pointerId) {
20368
+ _proto._getPointerByID = function _getPointerByID(pointerId) {
20261
20369
  var _this = this, pointers = _this._pointers;
20262
20370
  for(var i = pointers.length - 1; i >= 0; i--){
20263
20371
  if (pointers[i]._uniqueID === pointerId) {
20264
- return i;
20265
- }
20266
- }
20267
- return -1;
20268
- };
20269
- _proto._getPointer = function _getPointer(pointerId) {
20270
- var _this = this, pointers = _this._pointers;
20271
- var index = this._getIndexByPointerID(pointerId);
20272
- if (index >= 0) {
20273
- return pointers[index];
20274
- } else {
20275
- var lastCount = pointers.length;
20276
- if (lastCount === 0 || this._multiPointerEnabled) {
20277
- var _this1 = this, pointerPool = _this1._pointerPool;
20278
- // Get Pointer smallest index
20279
- var i = 0;
20280
- for(; i < lastCount; i++){
20281
- if (pointers[i].id > i) {
20282
- break;
20283
- }
20284
- }
20285
- var pointer = pointerPool[i];
20286
- if (!pointer) {
20287
- pointer = pointerPool[i] = new Pointer(i);
20288
- }
20289
- pointer._uniqueID = pointerId;
20290
- pointers.splice(i, 0, pointer);
20291
- return pointer;
20292
- } else {
20293
- return null;
20372
+ return pointers[i];
20294
20373
  }
20295
20374
  }
20375
+ return null;
20296
20376
  };
20297
20377
  _proto._updatePointerInfo = function _updatePointerInfo(frameCount, pointer, left, top, widthPixelRatio, heightPixelRatio) {
20298
20378
  var events = pointer._events, position = pointer.position;
@@ -20623,17 +20703,17 @@
20623
20703
  }();
20624
20704
  /**
20625
20705
  * Material.
20626
- */ var Material = /*#__PURE__*/ function(ReferResource) {
20706
+ */ var Material = /*#__PURE__*/ function(ReferResource1) {
20627
20707
  var Material = function Material(engine, shader) {
20628
20708
  var _this;
20629
- _this = ReferResource.call(this, engine) || this;
20709
+ _this = ReferResource1.call(this, engine) || this;
20630
20710
  /** @internal */ _this._renderStates = [] // todo: later will as a part of shaderData when shader effect frame is OK, that is more powerful and flexible.
20631
20711
  ;
20632
20712
  _this._shaderData = new ShaderData(ShaderDataGroup.Material);
20633
20713
  _this.shader = shader;
20634
20714
  return _this;
20635
20715
  };
20636
- _inherits$2(Material, ReferResource);
20716
+ _inherits$2(Material, ReferResource1);
20637
20717
  var _proto = Material.prototype;
20638
20718
  /**
20639
20719
  * Clone and return the instance.
@@ -20652,13 +20732,13 @@
20652
20732
  };
20653
20733
  _proto._addReferCount = function _addReferCount(value) {
20654
20734
  if (this._destroyed) return;
20655
- ReferResource.prototype._addReferCount.call(this, value);
20735
+ ReferResource1.prototype._addReferCount.call(this, value);
20656
20736
  this.shaderData._addReferCount(value);
20657
20737
  };
20658
20738
  /**
20659
20739
  * @override
20660
20740
  */ _proto._onDestroy = function _onDestroy() {
20661
- ReferResource.prototype._onDestroy.call(this);
20741
+ ReferResource1.prototype._onDestroy.call(this);
20662
20742
  this._shader = null;
20663
20743
  this._shaderData = null;
20664
20744
  this._renderStates.length = 0;
@@ -20801,33 +20881,6 @@
20801
20881
  };
20802
20882
  return ParticleBufferUtils;
20803
20883
  }();
20804
- function _array_like_to_array$1(arr, len) {
20805
- if (len == null || len > arr.length) len = arr.length;
20806
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
20807
- return arr2;
20808
- }
20809
- function _array_without_holes$1(arr) {
20810
- if (Array.isArray(arr)) return _array_like_to_array$1(arr);
20811
- }
20812
- function _iterable_to_array$1(iter) {
20813
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
20814
- return Array.from(iter);
20815
- }
20816
- }
20817
- function _non_iterable_spread$1() {
20818
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
20819
- }
20820
- function _unsupported_iterable_to_array$1(o, minLen) {
20821
- if (!o) return;
20822
- if (typeof o === "string") return _array_like_to_array$1(o, minLen);
20823
- var n = Object.prototype.toString.call(o).slice(8, -1);
20824
- if (n === "Object" && o.constructor) n = o.constructor.name;
20825
- if (n === "Map" || n === "Set") return Array.from(n);
20826
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
20827
- }
20828
- function _to_consumable_array$1(arr) {
20829
- return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
20830
- }
20831
20884
  var skyProceduralFs = "#define GLSLIFY 1\n#include <common>\nconst float MIE_G=-0.990;const float MIE_G2=0.9801;const float SKY_GROUND_THRESHOLD=0.02;uniform float material_SunSize;uniform float material_SunSizeConvergence;uniform vec4 scene_SunlightColor;uniform vec3 scene_SunlightDirection;varying vec3 v_GroundColor;varying vec3 v_SkyColor;\n#ifdef MATERIAL_SUN_HIGH_QUALITY\nvarying vec3 v_Vertex;\n#elif defined(MATERIAL_SUN_SIMPLE)\nvarying vec3 v_RayDir;\n#else\nvarying float v_SkyGroundFactor;\n#endif\n#if defined(MATERIAL_SUN_HIGH_QUALITY)||defined(MATERIAL_SUN_SIMPLE)\nvarying vec3 v_SunColor;\n#endif\n#if defined(ENGINE_IS_COLORSPACE_GAMMA)\n#define LINEAR_2_OUTPUT(color) sqrt(color)\n#endif\nfloat getMiePhase(float eyeCos,float eyeCos2){float temp=1.0+MIE_G2-2.0*MIE_G*eyeCos;temp=pow(temp,pow(material_SunSize,0.65)*10.0);temp=max(temp,1.0e-4);temp=1.5*((1.0-MIE_G2)/(2.0+MIE_G2))*(1.0+eyeCos2)/temp;return temp;}float calcSunAttenuation(vec3 lightPos,vec3 ray){\n#ifdef MATERIAL_SUN_HIGH_QUALITY\nfloat focusedEyeCos=pow(clamp(dot(lightPos,ray),0.0,1.0),material_SunSizeConvergence);return getMiePhase(-focusedEyeCos,focusedEyeCos*focusedEyeCos);\n#else\nvec3 delta=lightPos-ray;float dist=length(delta);float spot=1.0-smoothstep(0.0,material_SunSize,dist);return spot*spot;\n#endif\n}void main(){vec3 col=vec3(0.0,0.0,0.0);\n#ifdef MATERIAL_SUN_HIGH_QUALITY\nvec3 ray=normalize(v_Vertex);float y=ray.y/SKY_GROUND_THRESHOLD;\n#elif defined(MATERIAL_SUN_SIMPLE)\nvec3 ray=v_RayDir;float y=ray.y/SKY_GROUND_THRESHOLD;\n#else\nfloat y=v_SkyGroundFactor;\n#endif\ncol=mix(v_SkyColor,v_GroundColor,clamp(y,0.0,1.0));\n#if defined(MATERIAL_SUN_HIGH_QUALITY)||defined(MATERIAL_SUN_SIMPLE)\nif(y<0.0)col+=v_SunColor*calcSunAttenuation(-scene_SunlightDirection,-ray);\n#endif\n#ifdef ENGINE_IS_COLORSPACE_GAMMA\ncol=LINEAR_2_OUTPUT(col);\n#endif\ngl_FragColor=vec4(col,1.0);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\ngl_FragColor=linearToGamma(gl_FragColor);\n#endif\n}"; // eslint-disable-line
20832
20885
  var skyProceduralVs = "#define GLSLIFY 1\n#define OUTER_RADIUS 1.025\n#define RAYLEIGH (mix(0.0, 0.0025, pow(material_AtmosphereThickness,2.5)))\n#define MIE 0.0010\n#define SUN_BRIGHTNESS 20.0\n#define MAX_SCATTER 50.0\nconst float SKY_GROUND_THRESHOLD=0.02;const float outerRadius=OUTER_RADIUS;const float outerRadius2=OUTER_RADIUS*OUTER_RADIUS;const float innerRadius=1.0;const float innerRadius2=1.0;const float cameraHeight=0.0001;const float HDSundiskIntensityFactor=15.0;const float simpleSundiskIntensityFactor=27.0;const float sunScale=400.0*SUN_BRIGHTNESS;const float kmESun=MIE*SUN_BRIGHTNESS;const float km4PI=MIE*4.0*3.14159265;const float scale=1.0/(OUTER_RADIUS-1.0);const float scaleDepth=0.25;const float scaleOverScaleDepth=(1.0/(OUTER_RADIUS-1.0))/0.25;const float samples=2.0;const vec3 c_DefaultScatteringWavelength=vec3(0.65,0.57,0.475);const vec3 c_VariableRangeForScatteringWavelength=vec3(0.15,0.15,0.15);attribute vec4 POSITION;uniform mat4 camera_VPMat;uniform vec3 material_SkyTint;uniform vec3 material_GroundTint;uniform float material_Exposure;uniform float material_AtmosphereThickness;uniform vec4 scene_SunlightColor;uniform vec3 scene_SunlightDirection;varying vec3 v_GroundColor;varying vec3 v_SkyColor;\n#ifdef MATERIAL_SUN_HIGH_QUALITY\nvarying vec3 v_Vertex;\n#elif defined(MATERIAL_SUN_SIMPLE)\nvarying vec3 v_RayDir;\n#else\nvarying float v_SkyGroundFactor;\n#endif\n#if defined(MATERIAL_SUN_HIGH_QUALITY)||defined(MATERIAL_SUN_SIMPLE)\nvarying vec3 v_SunColor;\n#endif\n#if defined(ENGINE_IS_COLORSPACE_GAMMA)\n#define COLOR_2_GAMMA(color) color\n#define COLOR_2_LINEAR(color) color*color\n#else\n#define GAMMA 2.2\n#define COLOR_2_GAMMA(color) pow(color,vec3(1.0/GAMMA))\n#define COLOR_2_LINEAR(color) color\n#endif\nfloat getRayleighPhase(vec3 light,vec3 ray){float eyeCos=dot(light,ray);return 0.75+0.75*eyeCos*eyeCos;}float scaleAngle(float inCos){float x=1.0-inCos;return 0.25*exp(-0.00287+x*(0.459+x*(3.83+x*(-6.80+x*5.25))));}void main(){gl_Position=camera_VPMat*vec4(POSITION.xyz,1.0);vec3 skyTintInGammaSpace=COLOR_2_GAMMA(material_SkyTint);vec3 scatteringWavelength=mix(c_DefaultScatteringWavelength-c_VariableRangeForScatteringWavelength,c_DefaultScatteringWavelength+c_VariableRangeForScatteringWavelength,vec3(1.0)-skyTintInGammaSpace);vec3 invWavelength=1.0/pow(scatteringWavelength,vec3(4.0));float krESun=RAYLEIGH*SUN_BRIGHTNESS;float kr4PI=RAYLEIGH*4.0*3.14159265;vec3 cameraPos=vec3(0.0,innerRadius+cameraHeight,0.0);vec3 eyeRay=normalize(POSITION.xyz);float far=0.0;vec3 cIn,cOut;if(eyeRay.y>=0.0){far=sqrt(outerRadius2+innerRadius2*eyeRay.y*eyeRay.y-innerRadius2)-innerRadius*eyeRay.y;float height=innerRadius+cameraHeight;float depth=exp(scaleOverScaleDepth*-cameraHeight);float startAngle=dot(eyeRay,cameraPos)/height;float startOffset=depth*scaleAngle(startAngle);float sampleLength=far/samples;float scaledLength=sampleLength*scale;vec3 sampleRay=eyeRay*sampleLength;vec3 samplePoint=cameraPos+sampleRay*0.5;vec3 frontColor=vec3(0.0);{float height=length(samplePoint);float depth=exp(scaleOverScaleDepth*(innerRadius-height));float lightAngle=dot(-scene_SunlightDirection,samplePoint)/height;float cameraAngle=dot(eyeRay,samplePoint)/height;float scatter=(startOffset+depth*(scaleAngle(lightAngle)-scaleAngle(cameraAngle)));vec3 attenuate=exp(-clamp(scatter,0.0,MAX_SCATTER)*(invWavelength*kr4PI+km4PI));frontColor+=attenuate*(depth*scaledLength);samplePoint+=sampleRay;}{float height=length(samplePoint);float depth=exp(scaleOverScaleDepth*(innerRadius-height));float lightAngle=dot(-scene_SunlightDirection,samplePoint)/height;float cameraAngle=dot(eyeRay,samplePoint)/height;float scatter=(startOffset+depth*(scaleAngle(lightAngle)-scaleAngle(cameraAngle)));vec3 attenuate=exp(-clamp(scatter,0.0,MAX_SCATTER)*(invWavelength*kr4PI+km4PI));frontColor+=attenuate*(depth*scaledLength);samplePoint+=sampleRay;}cIn=frontColor*(invWavelength*krESun);cOut=frontColor*kmESun;}else{far=(-cameraHeight)/(min(-0.001,eyeRay.y));vec3 pos=cameraPos+far*eyeRay;float depth=exp((-cameraHeight)*(1.0/scaleDepth));float cameraAngle=dot(-eyeRay,pos);float lightAngle=dot(-scene_SunlightDirection,pos);float cameraScale=scaleAngle(cameraAngle);float lightScale=scaleAngle(lightAngle);float cameraOffset=depth*cameraScale;float temp=lightScale+cameraScale;float sampleLength=far/samples;float scaledLength=sampleLength*scale;vec3 sampleRay=eyeRay*sampleLength;vec3 samplePoint=cameraPos+sampleRay*0.5;vec3 frontColor=vec3(0.0,0.0,0.0);vec3 attenuate;{float height=length(samplePoint);float depth=exp(scaleOverScaleDepth*(innerRadius-height));float scatter=depth*temp-cameraOffset;attenuate=exp(-clamp(scatter,0.0,MAX_SCATTER)*(invWavelength*kr4PI+km4PI));frontColor+=attenuate*(depth*scaledLength);samplePoint+=sampleRay;}cIn=frontColor*(invWavelength*krESun+kmESun);cOut=clamp(attenuate,0.0,1.0);}\n#ifdef MATERIAL_SUN_HIGH_QUALITY\nv_Vertex=-POSITION.xyz;\n#elif defined(MATERIAL_SUN_SIMPLE)\nv_RayDir=-eyeRay;\n#else\nv_SkyGroundFactor=-eyeRay.y/SKY_GROUND_THRESHOLD;\n#endif\nv_GroundColor=material_Exposure*(cIn+COLOR_2_LINEAR(material_GroundTint)*cOut);v_SkyColor=material_Exposure*(cIn*getRayleighPhase(-scene_SunlightDirection,-eyeRay));float lightColorIntensity=clamp(length(scene_SunlightColor.xyz),0.25,1.0);\n#ifdef MATERIAL_SUN_HIGH_QUALITY\nv_SunColor=HDSundiskIntensityFactor*clamp(cOut,0.0,1.0)*scene_SunlightColor.xyz/lightColorIntensity;\n#elif defined(MATERIAL_SUN_SIMPLE)\nv_SunColor=simpleSundiskIntensityFactor*clamp(cOut*sunScale,0.0,1.0)*scene_SunlightColor.xyz/lightColorIntensity;\n#endif\n}"; // eslint-disable-line
20833
20886
  var backgroundTextureFs = "#define GLSLIFY 1\nuniform sampler2D material_BaseTexture;varying vec2 v_uv;void main(){gl_FragColor=texture2D(material_BaseTexture,v_uv);}"; // eslint-disable-line
@@ -20857,10 +20910,10 @@
20857
20910
  */ var ShaderPool = /*#__PURE__*/ function() {
20858
20911
  var ShaderPool = function ShaderPool() {};
20859
20912
  ShaderPool.init = function init() {
20860
- var shadowCasterPass = new ShaderPass(shadowMapVs, shadowMapFs, {
20913
+ var shadowCasterPass = new ShaderPass("ShadowCaster", shadowMapVs, shadowMapFs, {
20861
20914
  pipelineStage: exports.PipelineStage.ShadowCaster
20862
20915
  });
20863
- var depthOnlyPass = new ShaderPass(depthOnlyVs, depthOnlyFs, {
20916
+ var depthOnlyPass = new ShaderPass("DepthOnly", depthOnlyVs, depthOnlyFs, {
20864
20917
  pipelineStage: exports.PipelineStage.DepthOnly
20865
20918
  });
20866
20919
  var basePasses = [
@@ -20870,35 +20923,27 @@
20870
20923
  var forwardPassTags = {
20871
20924
  pipelineStage: exports.PipelineStage.Forward
20872
20925
  };
20873
- Shader.create("blinn-phong", [
20874
- new ShaderPass(blinnPhongVs, blinnPhongFs, forwardPassTags)
20875
- ].concat(_to_consumable_array$1(basePasses)));
20876
- Shader.create("pbr", [
20877
- new ShaderPass(pbrVs, pbrFs, forwardPassTags)
20878
- ].concat(_to_consumable_array$1(basePasses)));
20879
- Shader.create("pbr-specular", [
20880
- new ShaderPass(pbrVs, pbrSpecularFs, forwardPassTags)
20881
- ].concat(_to_consumable_array$1(basePasses)));
20882
- Shader.create("unlit", [
20883
- new ShaderPass(unlitVs, unlitFs, forwardPassTags)
20884
- ].concat(_to_consumable_array$1(basePasses)));
20926
+ Shader.create("blinn-phong", [].concat(new ShaderPass("Forward", blinnPhongVs, blinnPhongFs, forwardPassTags), basePasses));
20927
+ Shader.create("pbr", [].concat(new ShaderPass("Forward", pbrVs, pbrFs, forwardPassTags), basePasses));
20928
+ Shader.create("pbr-specular", [].concat(new ShaderPass("Forward", pbrVs, pbrSpecularFs, forwardPassTags), basePasses));
20929
+ Shader.create("unlit", [].concat(new ShaderPass("Forward", unlitVs, unlitFs, forwardPassTags), basePasses));
20885
20930
  Shader.create("skybox", [
20886
- new ShaderPass(skyboxVs, skyboxFs, forwardPassTags)
20931
+ new ShaderPass("Forward", skyboxVs, skyboxFs, forwardPassTags)
20887
20932
  ]);
20888
20933
  Shader.create("SkyProcedural", [
20889
- new ShaderPass(skyProceduralVs, skyProceduralFs, forwardPassTags)
20934
+ new ShaderPass("Forward", skyProceduralVs, skyProceduralFs, forwardPassTags)
20890
20935
  ]);
20891
20936
  Shader.create("particle-shader", [
20892
- new ShaderPass(particleVs, particleFs, forwardPassTags)
20937
+ new ShaderPass("Forward", particleVs, particleFs, forwardPassTags)
20893
20938
  ]);
20894
20939
  Shader.create("SpriteMask", [
20895
- new ShaderPass(spriteMaskVs, spriteMaskFs, forwardPassTags)
20940
+ new ShaderPass("Forward", spriteMaskVs, spriteMaskFs, forwardPassTags)
20896
20941
  ]);
20897
20942
  Shader.create("Sprite", [
20898
- new ShaderPass(spriteVs, spriteFs, forwardPassTags)
20943
+ new ShaderPass("Forward", spriteVs, spriteFs, forwardPassTags)
20899
20944
  ]);
20900
20945
  Shader.create("background-texture", [
20901
- new ShaderPass(backgroundTextureVs, backgroundTextureFs, forwardPassTags)
20946
+ new ShaderPass("Forward", backgroundTextureVs, backgroundTextureFs, forwardPassTags)
20902
20947
  ]);
20903
20948
  };
20904
20949
  return ShaderPool;
@@ -20976,11 +21021,11 @@
20976
21021
  ShaderPool.init();
20977
21022
  /**
20978
21023
  * Engine.
20979
- */ var Engine = /*#__PURE__*/ function(EventDispatcher) {
20980
- _inherits$2(Engine, EventDispatcher);
21024
+ */ var Engine = /*#__PURE__*/ function(EventDispatcher1) {
21025
+ _inherits$2(Engine, EventDispatcher1);
20981
21026
  function Engine(canvas, hardwareRenderer, configuration) {
20982
21027
  var _this;
20983
- _this = EventDispatcher.call(this) || this;
21028
+ _this = EventDispatcher1.call(this) || this;
20984
21029
  /** @internal */ _this._physicsInitialized = false;
20985
21030
  /** @internal */ _this._physicalObjectsMap = {};
20986
21031
  /* @internal */ _this._lastRenderState = new RenderState();
@@ -21058,8 +21103,8 @@
21058
21103
  * Create an entity.
21059
21104
  * @param name - The name of the entity
21060
21105
  * @returns Entity
21061
- */ _proto.createEntity = function createEntity(name) {
21062
- return new Entity(this, name);
21106
+ */ _proto.createEntity = function createEntity(name1) {
21107
+ return new Entity(this, name1);
21063
21108
  };
21064
21109
  /**
21065
21110
  * Pause the engine.
@@ -21079,9 +21124,6 @@
21079
21124
  /**
21080
21125
  * Update the engine loop manually. If you call engine.run(), you generally don't need to call this function.
21081
21126
  */ _proto.update = function update() {
21082
- if (this._isDeviceLost) {
21083
- return;
21084
- }
21085
21127
  var time = this._time;
21086
21128
  time._update();
21087
21129
  var deltaTime = time.deltaTime;
@@ -21131,7 +21173,9 @@
21131
21173
  scene4._componentsManager.callScriptOnLateUpdate(deltaTime);
21132
21174
  }
21133
21175
  // Render scene and fire `onBeginRender` and `onEndRender`
21134
- this._render(loopScenes);
21176
+ if (!this._isDeviceLost) {
21177
+ this._render(loopScenes);
21178
+ }
21135
21179
  // Handling invalid scripts and fire `onDestroy`
21136
21180
  for(var i5 = 0; i5 < sceneCount; i5++){
21137
21181
  var scene5 = loopScenes[i5];
@@ -21606,8 +21650,8 @@
21606
21650
  },
21607
21651
  set: function set(value) {
21608
21652
  if (this._material !== value) {
21609
- var _this__material;
21610
- value == null ? void 0 : value._addReferCount(1);
21653
+ var _value, _this__material;
21654
+ (_value = value) == null ? void 0 : _value._addReferCount(1);
21611
21655
  (_this__material = this._material) == null ? void 0 : _this__material._addReferCount(-1);
21612
21656
  this._material = value;
21613
21657
  }
@@ -21622,8 +21666,8 @@
21622
21666
  },
21623
21667
  set: function set(value) {
21624
21668
  if (this._mesh !== value) {
21625
- var _this__mesh;
21626
- value == null ? void 0 : value._addReferCount(1);
21669
+ var _value, _this__mesh;
21670
+ (_value = value) == null ? void 0 : _value._addReferCount(1);
21627
21671
  (_this__mesh = this._mesh) == null ? void 0 : _this__mesh._addReferCount(-1);
21628
21672
  this._mesh = value;
21629
21673
  }
@@ -21748,8 +21792,8 @@
21748
21792
  },
21749
21793
  set: function set(value) {
21750
21794
  if (this._texture !== value) {
21751
- var _this__texture;
21752
- value == null ? void 0 : value._addReferCount(1);
21795
+ var _value, _this__texture;
21796
+ (_value = value) == null ? void 0 : _value._addReferCount(1);
21753
21797
  (_this__texture = this._texture) == null ? void 0 : _this__texture._addReferCount(-1);
21754
21798
  this._texture = value;
21755
21799
  this._engine._backgroundTextureMaterial.shaderData.setTexture("material_BaseTexture", value);
@@ -21969,10 +22013,10 @@
21969
22013
  })(exports.DiffuseMode || (exports.DiffuseMode = {}));
21970
22014
  /**
21971
22015
  * Ambient light.
21972
- */ var AmbientLight = /*#__PURE__*/ function(ReferResource) {
22016
+ */ var AmbientLight = /*#__PURE__*/ function(ReferResource1) {
21973
22017
  var AmbientLight = function AmbientLight(engine) {
21974
22018
  var _this;
21975
- _this = ReferResource.call(this, engine) || this;
22019
+ _this = ReferResource1.call(this, engine) || this;
21976
22020
  _this._diffuseSolidColor = new Color$1(0.212, 0.227, 0.259);
21977
22021
  _this._diffuseIntensity = 1.0;
21978
22022
  _this._specularIntensity = 1.0;
@@ -21982,7 +22026,7 @@
21982
22026
  _this._specularTextureDecodeRGBM = false;
21983
22027
  return _this;
21984
22028
  };
21985
- _inherits$2(AmbientLight, ReferResource);
22029
+ _inherits$2(AmbientLight, ReferResource1);
21986
22030
  var _proto = AmbientLight.prototype;
21987
22031
  /**
21988
22032
  * @internal
@@ -22251,10 +22295,10 @@
22251
22295
  })(exports.ShadowType || (exports.ShadowType = {}));
22252
22296
  /**
22253
22297
  * Light base class.
22254
- */ var Light = /*#__PURE__*/ function(Component) {
22298
+ */ var Light = /*#__PURE__*/ function(Component1) {
22255
22299
  var Light = function Light() {
22256
22300
  var _this;
22257
- _this = Component.apply(this, arguments) || this;
22301
+ _this = Component1.apply(this, arguments) || this;
22258
22302
  /** Light Intensity */ _this.intensity = 1;
22259
22303
  /**
22260
22304
  * Culling mask - which layers the light affect.
@@ -22270,7 +22314,7 @@
22270
22314
  _this._lightColor = new Color$1();
22271
22315
  return _this;
22272
22316
  };
22273
- _inherits$2(Light, Component);
22317
+ _inherits$2(Light, Component1);
22274
22318
  var _proto = Light.prototype;
22275
22319
  /**
22276
22320
  * Light Color, include intensity.
@@ -22329,14 +22373,14 @@
22329
22373
  ], Light.prototype, "_lightIndex", void 0);
22330
22374
  /**
22331
22375
  * Directional light.
22332
- */ var DirectLight = /*#__PURE__*/ function(Light) {
22376
+ */ var DirectLight = /*#__PURE__*/ function(Light1) {
22333
22377
  var DirectLight = function DirectLight() {
22334
22378
  var _this;
22335
- _this = Light.apply(this, arguments) || this;
22379
+ _this = Light1.apply(this, arguments) || this;
22336
22380
  _this._reverseDirection = new Vector3();
22337
22381
  return _this;
22338
22382
  };
22339
- _inherits$2(DirectLight, Light);
22383
+ _inherits$2(DirectLight, Light1);
22340
22384
  var _proto = DirectLight.prototype;
22341
22385
  /**
22342
22386
  * @internal
@@ -22428,14 +22472,14 @@
22428
22472
  })();
22429
22473
  /**
22430
22474
  * Point light.
22431
- */ var PointLight = /*#__PURE__*/ function(Light) {
22475
+ */ var PointLight = /*#__PURE__*/ function(Light1) {
22432
22476
  var PointLight = function PointLight() {
22433
22477
  var _this;
22434
- _this = Light.apply(this, arguments) || this;
22478
+ _this = Light1.apply(this, arguments) || this;
22435
22479
  /** Defines a distance cutoff at which the light's intensity must be considered zero. */ _this.distance = 100;
22436
22480
  return _this;
22437
22481
  };
22438
- _inherits$2(PointLight, Light);
22482
+ _inherits$2(PointLight, Light1);
22439
22483
  var _proto = PointLight.prototype;
22440
22484
  /**
22441
22485
  * @internal
@@ -22525,10 +22569,10 @@
22525
22569
  })();
22526
22570
  /**
22527
22571
  * Spot light.
22528
- */ var SpotLight = /*#__PURE__*/ function(Light) {
22572
+ */ var SpotLight = /*#__PURE__*/ function(Light1) {
22529
22573
  var SpotLight = function SpotLight() {
22530
22574
  var _this;
22531
- _this = Light.apply(this, arguments) || this;
22575
+ _this = Light1.apply(this, arguments) || this;
22532
22576
  /** Defines a distance cutoff at which the light's intensity must be considered zero. */ _this.distance = 100;
22533
22577
  /** Angle, in radians, from centre of spotlight where falloff begins. */ _this.angle = Math.PI / 6;
22534
22578
  /** Angle, in radians, from falloff begins to ends. */ _this.penumbra = Math.PI / 12;
@@ -22536,7 +22580,7 @@
22536
22580
  _this._projectMatrix = new Matrix();
22537
22581
  return _this;
22538
22582
  };
22539
- _inherits$2(SpotLight, Light);
22583
+ _inherits$2(SpotLight, Light1);
22540
22584
  var _proto = SpotLight.prototype;
22541
22585
  /**
22542
22586
  * @internal
@@ -22808,11 +22852,11 @@
22808
22852
  }();
22809
22853
  /**
22810
22854
  * Scene.
22811
- */ var Scene = /*#__PURE__*/ function(EngineObject) {
22812
- _inherits$2(Scene, EngineObject);
22813
- function Scene(engine, name) {
22855
+ */ var Scene = /*#__PURE__*/ function(EngineObject1) {
22856
+ _inherits$2(Scene, EngineObject1);
22857
+ function Scene(engine, name1) {
22814
22858
  var _this;
22815
- _this = EngineObject.call(this, engine) || this;
22859
+ _this = EngineObject1.call(this, engine) || this;
22816
22860
  /** Physics. */ _this.physics = new PhysicsScene(_assert_this_initialized(_this));
22817
22861
  /** If cast shadows. */ _this.castShadows = true;
22818
22862
  /** The resolution of the shadow maps. */ _this.shadowResolution = exports.ShadowResolution.Medium;
@@ -22835,7 +22879,7 @@
22835
22879
  _this._fogEnd = 300;
22836
22880
  _this._fogDensity = 0.01;
22837
22881
  _this._fogParams = new Vector4();
22838
- _this.name = name || "";
22882
+ _this.name = name1 || "";
22839
22883
  var shaderData = _this.shaderData;
22840
22884
  shaderData._addReferCount(1);
22841
22885
  _this.ambientLight = new AmbientLight(engine);
@@ -22853,8 +22897,8 @@
22853
22897
  * Create root entity.
22854
22898
  * @param name - Entity name
22855
22899
  * @returns Entity
22856
- */ _proto.createRootEntity = function createRootEntity(name) {
22857
- var entity = new Entity(this._engine, name);
22900
+ */ _proto.createRootEntity = function createRootEntity(name1) {
22901
+ var entity = new Entity(this._engine, name1);
22858
22902
  this.addRootEntity(entity);
22859
22903
  return entity;
22860
22904
  };
@@ -22928,10 +22972,10 @@
22928
22972
  * Find entity globally by name.
22929
22973
  * @param name - Entity name
22930
22974
  * @returns Entity
22931
- */ _proto.findEntityByName = function findEntityByName(name) {
22975
+ */ _proto.findEntityByName = function findEntityByName(name1) {
22932
22976
  var rootEntities = this._rootEntities;
22933
22977
  for(var i = 0, n = rootEntities.length; i < n; i++){
22934
- var entity = rootEntities[i].findByName(name);
22978
+ var entity = rootEntities[i].findByName(name1);
22935
22979
  if (entity) {
22936
22980
  return entity;
22937
22981
  }
@@ -23039,7 +23083,7 @@
23039
23083
  /**
23040
23084
  * @internal
23041
23085
  */ _proto._onDestroy = function _onDestroy() {
23042
- EngineObject.prototype._onDestroy.call(this);
23086
+ EngineObject1.prototype._onDestroy.call(this);
23043
23087
  // Remove from sceneManager
23044
23088
  var sceneManager = this._engine.sceneManager;
23045
23089
  sceneManager.removeScene(this);
@@ -23239,10 +23283,10 @@
23239
23283
  })();
23240
23284
  /**
23241
23285
  * Script class, used for logic writing.
23242
- */ var Script = /*#__PURE__*/ function(Component) {
23286
+ */ var Script = /*#__PURE__*/ function(Component1) {
23243
23287
  var Script = function Script() {
23244
23288
  var _this;
23245
- _this = Component.apply(this, arguments) || this;
23289
+ _this = Component1.apply(this, arguments) || this;
23246
23290
  /** @internal */ _this._started = false;
23247
23291
  /** @internal */ _this._onStartIndex = -1;
23248
23292
  /** @internal */ _this._onUpdateIndex = -1;
@@ -23253,7 +23297,7 @@
23253
23297
  _this._entityScriptsIndex = -1;
23254
23298
  return _this;
23255
23299
  };
23256
- _inherits$2(Script, Component);
23300
+ _inherits$2(Script, Component1);
23257
23301
  var _proto = Script.prototype;
23258
23302
  /**
23259
23303
  * Called when be enabled first time, only once.
@@ -23398,7 +23442,7 @@
23398
23442
  /**
23399
23443
  * @internal
23400
23444
  */ _proto._onDestroy = function _onDestroy() {
23401
- Component.prototype._onDestroy.call(this);
23445
+ Component1.prototype._onDestroy.call(this);
23402
23446
  this.scene._componentsManager.addPendingDestroyScript(this);
23403
23447
  };
23404
23448
  return Script;
@@ -23438,13 +23482,13 @@
23438
23482
  /**
23439
23483
  * RenderPass.
23440
23484
  */ var RenderPass = /*#__PURE__*/ function() {
23441
- var RenderPass = function RenderPass(name, priority, renderTarget, replaceMaterial, mask) {
23442
- if (name === void 0) name = "RENDER_PASS" + passNum++;
23485
+ var RenderPass = function RenderPass(name1, priority, renderTarget, replaceMaterial, mask) {
23486
+ if (name1 === void 0) name1 = "RENDER_PASS" + passNum++;
23443
23487
  if (priority === void 0) priority = 0;
23444
23488
  if (renderTarget === void 0) renderTarget = null;
23445
23489
  if (replaceMaterial === void 0) replaceMaterial = null;
23446
23490
  if (mask === void 0) mask = null;
23447
- this.name = name;
23491
+ this.name = name1;
23448
23492
  this.enabled = true;
23449
23493
  this.priority = priority;
23450
23494
  this.renderTarget = renderTarget;
@@ -23597,9 +23641,10 @@
23597
23641
  /**
23598
23642
  * Render queue.
23599
23643
  */ var RenderQueue = /*#__PURE__*/ function() {
23600
- var RenderQueue = function RenderQueue(engine) {
23644
+ var RenderQueue = function RenderQueue(engine, renderQueueType) {
23601
23645
  this.elements = [];
23602
23646
  this._initSpriteBatcher(engine);
23647
+ this._renderQueueType = renderQueueType;
23603
23648
  };
23604
23649
  var _proto = RenderQueue.prototype;
23605
23650
  /**
@@ -23618,10 +23663,10 @@
23618
23663
  var sceneData = scene.shaderData;
23619
23664
  var cameraData = camera.shaderData;
23620
23665
  var pipelineStageKey = RenderContext.pipelineStageKey;
23666
+ var renderQueueType = this._renderQueueType;
23621
23667
  for(var i = 0, n = elements.length; i < n; i++){
23622
23668
  var element = elements[i];
23623
23669
  var data = element.data, shaderPasses = element.shaderPasses;
23624
- var renderStates = data.material.renderStates;
23625
23670
  var renderPassFlag = data.component.entity.layer;
23626
23671
  if (!(renderPassFlag & mask)) {
23627
23672
  continue;
@@ -23634,6 +23679,7 @@
23634
23679
  var material = data.material.destroyed ? engine._magentaMaterial : data.material;
23635
23680
  var rendererData = renderer.shaderData;
23636
23681
  var materialData = material.shaderData;
23682
+ var renderStates = material.renderStates;
23637
23683
  // union render global macro and material self macro.
23638
23684
  ShaderMacroCollection.unionCollection(renderer._globalShaderMacro, materialData._macroCollection, compileMacros);
23639
23685
  for(var j = 0, m = shaderPasses.length; j < m; j++){
@@ -23641,6 +23687,10 @@
23641
23687
  if (shaderPass.getTagValue(pipelineStageKey) !== pipelineStageTagValue) {
23642
23688
  continue;
23643
23689
  }
23690
+ var _shaderPass__renderState;
23691
+ if (((_shaderPass__renderState = shaderPass._renderState) != null ? _shaderPass__renderState : renderStates[j]).renderQueueType !== renderQueueType) {
23692
+ continue;
23693
+ }
23644
23694
  var program = shaderPass._getShaderProgram(engine, compileMacros);
23645
23695
  if (!program.isValid) {
23646
23696
  continue;
@@ -23690,8 +23740,8 @@
23690
23740
  program.uploadUnGroupTextures();
23691
23741
  }
23692
23742
  }
23693
- var _shaderPass__renderState;
23694
- var renderState = (_shaderPass__renderState = shaderPass._renderState) != null ? _shaderPass__renderState : renderStates[j];
23743
+ var _shaderPass__renderState1;
23744
+ var renderState = (_shaderPass__renderState1 = shaderPass._renderState) != null ? _shaderPass__renderState1 : renderStates[j];
23695
23745
  renderState._apply(engine, renderer.entity.transform._isFrontFaceInvert(), shaderPass._renderStateDataMap, material.shaderData);
23696
23746
  rhi.drawPrimitive(primitive, data.subPrimitive, program);
23697
23747
  }
@@ -23875,12 +23925,14 @@
23875
23925
  * @param mipmap - Need render target mipmap
23876
23926
  * @returns Render target
23877
23927
  */ PipelineUtils.recreateRenderTargetIfNeeded = function recreateRenderTargetIfNeeded(engine, currentRenderTarget, width, height, colorFormat, depthFormat, mipmap) {
23878
- var currentColorTexture = currentRenderTarget == null ? void 0 : currentRenderTarget.getColorTexture(0);
23879
- var currentDepthTexture = currentRenderTarget == null ? void 0 : currentRenderTarget.depthTexture;
23928
+ var _currentRenderTarget, _currentRenderTarget1;
23929
+ var currentColorTexture = (_currentRenderTarget = currentRenderTarget) == null ? void 0 : _currentRenderTarget.getColorTexture(0);
23930
+ var currentDepthTexture = (_currentRenderTarget1 = currentRenderTarget) == null ? void 0 : _currentRenderTarget1.depthTexture;
23880
23931
  var colorTexture = colorFormat ? PipelineUtils.recreateTextureIfNeeded(engine, currentColorTexture, width, height, colorFormat, mipmap) : null;
23881
23932
  var depthTexture = depthFormat ? PipelineUtils.recreateTextureIfNeeded(engine, currentDepthTexture, width, height, depthFormat, mipmap) : null;
23882
23933
  if (currentColorTexture !== colorTexture || currentDepthTexture !== depthTexture) {
23883
- currentRenderTarget == null ? void 0 : currentRenderTarget.destroy();
23934
+ var _currentRenderTarget2;
23935
+ (_currentRenderTarget2 = currentRenderTarget) == null ? void 0 : _currentRenderTarget2.destroy();
23884
23936
  currentRenderTarget = new RenderTarget(engine, width, height, colorTexture, depthTexture);
23885
23937
  currentRenderTarget.isGCIgnored = true;
23886
23938
  }
@@ -24401,11 +24453,11 @@
24401
24453
  };
24402
24454
  /**
24403
24455
  * Cascade shadow caster pass.
24404
- */ var CascadedShadowCasterPass = /*#__PURE__*/ function(PipelinePass) {
24405
- _inherits$2(CascadedShadowCasterPass, PipelinePass);
24456
+ */ var CascadedShadowCasterPass = /*#__PURE__*/ function(PipelinePass1) {
24457
+ _inherits$2(CascadedShadowCasterPass, PipelinePass1);
24406
24458
  function CascadedShadowCasterPass(camera) {
24407
24459
  var _this;
24408
- _this = PipelinePass.call(this, camera.engine) || this;
24460
+ _this = PipelinePass1.call(this, camera.engine) || this;
24409
24461
  _this._shadowMapSize = new Vector4();
24410
24462
  _this._shadowBias = new Vector2();
24411
24463
  _this._shadowSliceData = new ShadowSliceData();
@@ -24676,9 +24728,9 @@
24676
24728
  * Culling results.
24677
24729
  */ var CullingResults = /*#__PURE__*/ function() {
24678
24730
  var CullingResults = function CullingResults(engine) {
24679
- this.opaqueQueue = new RenderQueue(engine);
24680
- this.transparentQueue = new RenderQueue(engine);
24681
- this.alphaTestQueue = new RenderQueue(engine);
24731
+ this.opaqueQueue = new RenderQueue(engine, exports.RenderQueueType.Opaque);
24732
+ this.transparentQueue = new RenderQueue(engine, exports.RenderQueueType.Transparent);
24733
+ this.alphaTestQueue = new RenderQueue(engine, exports.RenderQueueType.AlphaTest);
24682
24734
  };
24683
24735
  var _proto = CullingResults.prototype;
24684
24736
  _proto.reset = function reset() {
@@ -24701,14 +24753,14 @@
24701
24753
  /**
24702
24754
  * @internal
24703
24755
  * Depth only pass.
24704
- */ var DepthOnlyPass = /*#__PURE__*/ function(PipelinePass) {
24756
+ */ var DepthOnlyPass = /*#__PURE__*/ function(PipelinePass1) {
24705
24757
  var DepthOnlyPass = function DepthOnlyPass(engine) {
24706
24758
  var _this;
24707
- _this = PipelinePass.call(this, engine) || this;
24759
+ _this = PipelinePass1.call(this, engine) || this;
24708
24760
  _this._supportDepthTexture = engine._hardwareRenderer.canIUse(exports.GLCapabilityType.depthTexture);
24709
24761
  return _this;
24710
24762
  };
24711
- _inherits$2(DepthOnlyPass, PipelinePass);
24763
+ _inherits$2(DepthOnlyPass, PipelinePass1);
24712
24764
  var _proto = DepthOnlyPass.prototype;
24713
24765
  _proto.onConfig = function onConfig(camera) {
24714
24766
  var engine = this._engine;
@@ -24787,10 +24839,10 @@
24787
24839
  /**
24788
24840
  * Get render pass by name.
24789
24841
  * @param name - Render pass name
24790
- */ _proto.getRenderPass = function getRenderPass(name) {
24842
+ */ _proto.getRenderPass = function getRenderPass(name1) {
24791
24843
  for(var i = 0, len = this._renderPassArray.length; i < len; i++){
24792
24844
  var pass = this._renderPassArray[i];
24793
- if (pass.name === name) return pass;
24845
+ if (pass.name === name1) return pass;
24794
24846
  }
24795
24847
  return null;
24796
24848
  };
@@ -24838,12 +24890,13 @@
24838
24890
  var opaqueQueue = cullingResults.opaqueQueue, alphaTestQueue = cullingResults.alphaTestQueue, transparentQueue = cullingResults.transparentQueue;
24839
24891
  pass.preRender(camera, opaqueQueue, alphaTestQueue, transparentQueue);
24840
24892
  if (pass.enabled) {
24893
+ var _renderTarget, _renderTarget1, _renderTarget2;
24841
24894
  var engine = camera.engine, scene = camera.scene;
24842
24895
  var background = scene.background;
24843
24896
  var rhi = engine._hardwareRenderer;
24844
24897
  var renderTarget = camera.renderTarget || pass.renderTarget;
24845
24898
  rhi.activeRenderTarget(renderTarget, camera.viewport, mipLevel);
24846
- renderTarget == null ? void 0 : renderTarget._setRenderTargetInfo(cubeFace, mipLevel);
24899
+ (_renderTarget = renderTarget) == null ? void 0 : _renderTarget._setRenderTargetInfo(cubeFace, mipLevel);
24847
24900
  var _pass_clearFlags;
24848
24901
  var clearFlags = (_pass_clearFlags = pass.clearFlags) != null ? _pass_clearFlags : camera.clearFlags;
24849
24902
  var _pass_clearColor;
@@ -24865,8 +24918,8 @@
24865
24918
  }
24866
24919
  cullingResults.transparentQueue.render(camera, pass.mask, exports.PipelineStage.Forward);
24867
24920
  }
24868
- renderTarget == null ? void 0 : renderTarget._blitRenderTarget();
24869
- renderTarget == null ? void 0 : renderTarget.generateMipmaps();
24921
+ (_renderTarget1 = renderTarget) == null ? void 0 : _renderTarget1._blitRenderTarget();
24922
+ (_renderTarget2 = renderTarget) == null ? void 0 : _renderTarget2.generateMipmaps();
24870
24923
  }
24871
24924
  pass.postRender(camera, cullingResults.opaqueQueue, cullingResults.alphaTestQueue, cullingResults.transparentQueue);
24872
24925
  };
@@ -24886,23 +24939,24 @@
24886
24939
  for(var i = 0, n = replacementSubShaders.length; i < n; i++){
24887
24940
  var subShader = replacementSubShaders[i];
24888
24941
  if (subShader.getTagValue(replacementTag) === materialSubShader.getTagValue(replacementTag)) {
24889
- this.pushRenderDataWihShader(context, data, subShader.passes, renderStates);
24942
+ this.pushRenderDataWithShader(context, data, subShader.passes, renderStates);
24890
24943
  break;
24891
24944
  }
24892
24945
  }
24893
24946
  } else {
24894
- this.pushRenderDataWihShader(context, data, replacementSubShaders[0].passes, renderStates);
24947
+ this.pushRenderDataWithShader(context, data, replacementSubShaders[0].passes, renderStates);
24895
24948
  }
24896
24949
  } else {
24897
- this.pushRenderDataWihShader(context, data, materialSubShader.passes, renderStates);
24950
+ this.pushRenderDataWithShader(context, data, materialSubShader.passes, renderStates);
24898
24951
  }
24899
24952
  };
24900
- _proto.pushRenderDataWihShader = function pushRenderDataWihShader(context, element, shaderPasses, renderStates) {
24953
+ _proto.pushRenderDataWithShader = function pushRenderDataWithShader(context, element, shaderPasses, renderStates) {
24901
24954
  var _this__cullingResults = this._cullingResults, opaqueQueue = _this__cullingResults.opaqueQueue, alphaTestQueue = _this__cullingResults.alphaTestQueue, transparentQueue = _this__cullingResults.transparentQueue;
24902
24955
  var renderElementPool = context.camera.engine._renderElementPool;
24903
24956
  var renderQueueAddedFlags = 0x0;
24904
24957
  for(var i = 0, n = shaderPasses.length; i < n; i++){
24905
- var renderQueueType = renderStates[i].renderQueueType;
24958
+ var _shaderPasses_i__renderState;
24959
+ var renderQueueType = ((_shaderPasses_i__renderState = shaderPasses[i]._renderState) != null ? _shaderPasses_i__renderState : renderStates[i]).renderQueueType;
24906
24960
  if (renderQueueAddedFlags & 1 << renderQueueType) {
24907
24961
  continue;
24908
24962
  }
@@ -24991,10 +25045,10 @@
24991
25045
  (function() {
24992
25046
  MathTemp.tempVec2 = new Vector2();
24993
25047
  })();
24994
- exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
25048
+ exports.Camera = (_Camera = /*#__PURE__*/ function(Component1) {
24995
25049
  var Camera1 = function Camera1(entity) {
24996
25050
  var _this;
24997
- _this = Component.call(this, entity) || this;
25051
+ _this = Component1.call(this, entity) || this;
24998
25052
  /** Whether to enable frustum culling, it is enabled by default. */ _this.enableFrustumCulling = true;
24999
25053
  /**
25000
25054
  * Determining what to clear when rendering by a Camera.
@@ -25041,7 +25095,7 @@
25041
25095
  _this._updatePixelViewport();
25042
25096
  return _this;
25043
25097
  };
25044
- _inherits$2(Camera1, Component);
25098
+ _inherits$2(Camera1, Component1);
25045
25099
  var _proto = Camera1.prototype;
25046
25100
  /**
25047
25101
  * Restore the automatic calculation of projection matrix through fieldOfView, nearClipPlane and farClipPlane.
@@ -25223,7 +25277,7 @@
25223
25277
  * @inheritdoc
25224
25278
  */ _proto._onDestroy = function _onDestroy() {
25225
25279
  var _this__renderPipeline;
25226
- Component.prototype._onDestroy.call(this);
25280
+ Component1.prototype._onDestroy.call(this);
25227
25281
  (_this__renderPipeline = this._renderPipeline) == null ? void 0 : _this__renderPipeline.destroy();
25228
25282
  this._isInvViewProjDirty.destroy();
25229
25283
  this._isViewMatrixDirty.destroy();
@@ -25491,8 +25545,8 @@
25491
25545
  },
25492
25546
  set: function set(value) {
25493
25547
  if (this._renderTarget !== value) {
25494
- var _this__renderTarget;
25495
- value == null ? void 0 : value._addReferCount(1);
25548
+ var _value, _this__renderTarget;
25549
+ (_value = value) == null ? void 0 : _value._addReferCount(1);
25496
25550
  (_this__renderTarget = this._renderTarget) == null ? void 0 : _this__renderTarget._addReferCount(-1);
25497
25551
  this._renderTarget = value;
25498
25552
  this._updatePixelViewport();
@@ -25651,8 +25705,8 @@
25651
25705
  xhr.responseType = config.type;
25652
25706
  var headers = config.headers;
25653
25707
  if (headers) {
25654
- Object.keys(headers).forEach(function(name) {
25655
- xhr.setRequestHeader(name, headers[name]);
25708
+ Object.keys(headers).forEach(function(name1) {
25709
+ xhr.setRequestHeader(name1, headers[name1]);
25656
25710
  });
25657
25711
  }
25658
25712
  // @ts-ignore
@@ -25745,11 +25799,11 @@
25745
25799
  RenderFace[RenderFace[/** Render back face. */ "Back"] = 1] = "Back";
25746
25800
  RenderFace[RenderFace[/** Render double face. */ "Double"] = 2] = "Double";
25747
25801
  })(exports.RenderFace || (exports.RenderFace = {}));
25748
- var BaseMaterial = /*#__PURE__*/ function(Material) {
25749
- _inherits$2(BaseMaterial, Material);
25802
+ var BaseMaterial = /*#__PURE__*/ function(Material1) {
25803
+ _inherits$2(BaseMaterial, Material1);
25750
25804
  function BaseMaterial(engine, shader) {
25751
25805
  var _this;
25752
- _this = Material.call(this, engine, shader) || this;
25806
+ _this = Material1.call(this, engine, shader) || this;
25753
25807
  _this._renderFace = exports.RenderFace.Front;
25754
25808
  _this._isTransparent = false;
25755
25809
  _this._blendMode = exports.BlendMode.Normal;
@@ -25838,7 +25892,7 @@
25838
25892
  * Clone to the target material.
25839
25893
  * @param target - target material
25840
25894
  */ _proto.cloneTo = function cloneTo(target) {
25841
- Material.prototype.cloneTo.call(this, target);
25895
+ Material1.prototype.cloneTo.call(this, target);
25842
25896
  target._renderFace = this._renderFace;
25843
25897
  target._isTransparent = this._isTransparent;
25844
25898
  target._blendMode = this._blendMode;
@@ -25988,11 +26042,11 @@
25988
26042
  })();
25989
26043
  /**
25990
26044
  * Blinn-phong Material.
25991
- */ var BlinnPhongMaterial = /*#__PURE__*/ function(BaseMaterial) {
25992
- _inherits$2(BlinnPhongMaterial, BaseMaterial);
26045
+ */ var BlinnPhongMaterial = /*#__PURE__*/ function(BaseMaterial1) {
26046
+ _inherits$2(BlinnPhongMaterial, BaseMaterial1);
25993
26047
  function BlinnPhongMaterial(engine) {
25994
26048
  var _this;
25995
- _this = BaseMaterial.call(this, engine, Shader.find("blinn-phong")) || this;
26049
+ _this = BaseMaterial1.call(this, engine, Shader.find("blinn-phong")) || this;
25996
26050
  var shaderData = _this.shaderData;
25997
26051
  shaderData.enableMacro("MATERIAL_NEED_WORLD_POS");
25998
26052
  shaderData.enableMacro("MATERIAL_NEED_TILING_OFFSET");
@@ -26180,11 +26234,11 @@
26180
26234
  })(exports.TextureCoordinate || (exports.TextureCoordinate = {}));
26181
26235
  /**
26182
26236
  * PBR (Physically-Based Rendering) Material.
26183
- */ var PBRBaseMaterial = /*#__PURE__*/ function(BaseMaterial) {
26184
- _inherits$2(PBRBaseMaterial, BaseMaterial);
26237
+ */ var PBRBaseMaterial = /*#__PURE__*/ function(BaseMaterial1) {
26238
+ _inherits$2(PBRBaseMaterial, BaseMaterial1);
26185
26239
  function PBRBaseMaterial(engine, shader) {
26186
26240
  var _this;
26187
- _this = BaseMaterial.call(this, engine, shader) || this;
26241
+ _this = BaseMaterial1.call(this, engine, shader) || this;
26188
26242
  var shaderData = _this.shaderData;
26189
26243
  shaderData.enableMacro("MATERIAL_NEED_WORLD_POS");
26190
26244
  shaderData.enableMacro("MATERIAL_NEED_TILING_OFFSET");
@@ -26448,11 +26502,11 @@
26448
26502
  })();
26449
26503
  /**
26450
26504
  * PBR (Metallic-Roughness Workflow) Material.
26451
- */ var PBRMaterial = /*#__PURE__*/ function(PBRBaseMaterial) {
26452
- _inherits$2(PBRMaterial, PBRBaseMaterial);
26505
+ */ var PBRMaterial = /*#__PURE__*/ function(PBRBaseMaterial1) {
26506
+ _inherits$2(PBRMaterial, PBRBaseMaterial1);
26453
26507
  function PBRMaterial(engine) {
26454
26508
  var _this;
26455
- _this = PBRBaseMaterial.call(this, engine, Shader.find("pbr")) || this;
26509
+ _this = PBRBaseMaterial1.call(this, engine, Shader.find("pbr")) || this;
26456
26510
  _this.shaderData.setFloat(PBRMaterial._metallicProp, 1);
26457
26511
  _this.shaderData.setFloat(PBRMaterial._roughnessProp, 1);
26458
26512
  _this.shaderData.setFloat(PBRMaterial._iorProp, 1.5);
@@ -26537,11 +26591,11 @@
26537
26591
  })();
26538
26592
  /**
26539
26593
  * PBR (Specular-Glossiness Workflow) Material.
26540
- */ var PBRSpecularMaterial = /*#__PURE__*/ function(PBRBaseMaterial) {
26541
- _inherits$2(PBRSpecularMaterial, PBRBaseMaterial);
26594
+ */ var PBRSpecularMaterial = /*#__PURE__*/ function(PBRBaseMaterial1) {
26595
+ _inherits$2(PBRSpecularMaterial, PBRBaseMaterial1);
26542
26596
  function PBRSpecularMaterial(engine) {
26543
26597
  var _this;
26544
- _this = PBRBaseMaterial.call(this, engine, Shader.find("pbr-specular")) || this;
26598
+ _this = PBRBaseMaterial1.call(this, engine, Shader.find("pbr-specular")) || this;
26545
26599
  _this.shaderData.setColor(PBRSpecularMaterial._specularColorProp, new Color$1(1, 1, 1, 1));
26546
26600
  _this.shaderData.setFloat(PBRSpecularMaterial._glossinessProp, 1.0);
26547
26601
  return _this;
@@ -26614,11 +26668,11 @@
26614
26668
  })();
26615
26669
  /**
26616
26670
  * Unlit Material.
26617
- */ var UnlitMaterial = /*#__PURE__*/ function(BaseMaterial) {
26618
- _inherits$2(UnlitMaterial, BaseMaterial);
26671
+ */ var UnlitMaterial = /*#__PURE__*/ function(BaseMaterial1) {
26672
+ _inherits$2(UnlitMaterial, BaseMaterial1);
26619
26673
  function UnlitMaterial(engine) {
26620
26674
  var _this;
26621
- _this = BaseMaterial.call(this, engine, Shader.find("unlit")) || this;
26675
+ _this = BaseMaterial1.call(this, engine, Shader.find("unlit")) || this;
26622
26676
  var shaderData = _this.shaderData;
26623
26677
  shaderData.enableMacro("MATERIAL_OMIT_NORMAL");
26624
26678
  shaderData.enableMacro("MATERIAL_NEED_TILING_OFFSET");
@@ -26698,24 +26752,24 @@
26698
26752
  })(exports.TextVerticalAlignment || (exports.TextVerticalAlignment = {}));
26699
26753
  /**
26700
26754
  * Sprite Atlas.
26701
- */ var SpriteAtlas = /*#__PURE__*/ function(ReferResource) {
26755
+ */ var SpriteAtlas = /*#__PURE__*/ function(ReferResource1) {
26702
26756
  var SpriteAtlas = function SpriteAtlas(engine) {
26703
26757
  var _this;
26704
- _this = ReferResource.call(this, engine) || this;
26758
+ _this = ReferResource1.call(this, engine) || this;
26705
26759
  _this._sprites = new Array();
26706
26760
  _this._spriteNamesToIndex = {};
26707
26761
  return _this;
26708
26762
  };
26709
- _inherits$2(SpriteAtlas, ReferResource);
26763
+ _inherits$2(SpriteAtlas, ReferResource1);
26710
26764
  var _proto = SpriteAtlas.prototype;
26711
26765
  /**
26712
26766
  * Get the last sprite named 'name' from the atlas.
26713
26767
  * @param name - The name of the sprite you want to find
26714
26768
  * @returns The sprite you want to find
26715
- */ _proto.getSprite = function getSprite(name) {
26716
- var sprite = this._sprites[this._spriteNamesToIndex[name]];
26769
+ */ _proto.getSprite = function getSprite(name1) {
26770
+ var sprite = this._sprites[this._spriteNamesToIndex[name1]];
26717
26771
  if (!sprite) {
26718
- console.warn("There is no sprite named " + name + " in the atlas.");
26772
+ console.warn("There is no sprite named " + name1 + " in the atlas.");
26719
26773
  }
26720
26774
  return sprite;
26721
26775
  };
@@ -26724,14 +26778,14 @@
26724
26778
  * @param name - The name of the sprites you want to find
26725
26779
  * @param outSprites - This array holds the sprites found
26726
26780
  * @returns The sprites you want to find
26727
- */ _proto.getSprites = function getSprites(name, outSprites) {
26781
+ */ _proto.getSprites = function getSprites(name1, outSprites) {
26728
26782
  outSprites.length = 0;
26729
- var i = this._spriteNamesToIndex[name];
26783
+ var i = this._spriteNamesToIndex[name1];
26730
26784
  if (i !== undefined) {
26731
26785
  var _sprites = this._sprites;
26732
26786
  for(; i >= 0; i--){
26733
26787
  var sprite = _sprites[i];
26734
- sprite.name === name && outSprites.push(sprite);
26788
+ sprite.name === name1 && outSprites.push(sprite);
26735
26789
  }
26736
26790
  } else {
26737
26791
  console.warn("The name of the sprite you want to find is not exit in SpriteAtlas.");
@@ -26748,7 +26802,7 @@
26748
26802
  /**
26749
26803
  * @internal
26750
26804
  */ _proto._onDestroy = function _onDestroy() {
26751
- ReferResource.prototype._onDestroy.call(this);
26805
+ ReferResource1.prototype._onDestroy.call(this);
26752
26806
  var _this = this, sprites = _this._sprites;
26753
26807
  for(var i = 0, n = sprites.length; i < n; i++){
26754
26808
  sprites[i].destroy();
@@ -26788,15 +26842,15 @@
26788
26842
  })(exports.SpriteTileMode || (exports.SpriteTileMode = {}));
26789
26843
  /**
26790
26844
  * 2D sprite.
26791
- */ var Sprite = /*#__PURE__*/ function(ReferResource) {
26792
- var Sprite = function Sprite(engine, texture, region, pivot, border, name) {
26845
+ */ var Sprite = /*#__PURE__*/ function(ReferResource1) {
26846
+ var Sprite = function Sprite(engine, texture, region, pivot, border, name1) {
26793
26847
  if (texture === void 0) texture = null;
26794
26848
  if (region === void 0) region = null;
26795
26849
  if (pivot === void 0) pivot = null;
26796
26850
  if (border === void 0) border = null;
26797
- if (name === void 0) name = null;
26851
+ if (name1 === void 0) name1 = null;
26798
26852
  var _this;
26799
- _this = ReferResource.call(this, engine) || this;
26853
+ _this = ReferResource1.call(this, engine) || this;
26800
26854
  _this._automaticWidth = 0;
26801
26855
  _this._automaticHeight = 0;
26802
26856
  _this._customWidth = undefined;
@@ -26836,10 +26890,10 @@
26836
26890
  region && _this._region.copyFrom(region);
26837
26891
  pivot && _this._pivot.copyFrom(pivot);
26838
26892
  border && _this._border.copyFrom(border);
26839
- _this.name = name;
26893
+ _this.name = name1;
26840
26894
  return _this;
26841
26895
  };
26842
- _inherits$2(Sprite, ReferResource);
26896
+ _inherits$2(Sprite, ReferResource1);
26843
26897
  var _proto = Sprite.prototype;
26844
26898
  /**
26845
26899
  * Clone.
@@ -26873,13 +26927,13 @@
26873
26927
  * @internal
26874
26928
  */ _proto._addReferCount = function _addReferCount(value) {
26875
26929
  var _this__atlas;
26876
- ReferResource.prototype._addReferCount.call(this, value);
26930
+ ReferResource1.prototype._addReferCount.call(this, value);
26877
26931
  (_this__atlas = this._atlas) == null ? void 0 : _this__atlas._addReferCount(value);
26878
26932
  };
26879
26933
  /**
26880
26934
  * @internal
26881
26935
  */ _proto._onDestroy = function _onDestroy() {
26882
- ReferResource.prototype._onDestroy.call(this);
26936
+ ReferResource1.prototype._onDestroy.call(this);
26883
26937
  this._positions.length = 0;
26884
26938
  this._positions = null;
26885
26939
  this._uvs.length = 0;
@@ -27638,10 +27692,10 @@
27638
27692
  })(TiledType || (TiledType = {}));
27639
27693
  /**
27640
27694
  * Renders a Sprite for 2D graphics.
27641
- */ var SpriteRenderer = /*#__PURE__*/ function(Renderer) {
27695
+ */ var SpriteRenderer = /*#__PURE__*/ function(Renderer1) {
27642
27696
  var SpriteRenderer = function SpriteRenderer(entity) {
27643
27697
  var _this;
27644
- _this = Renderer.call(this, entity) || this;
27698
+ _this = Renderer1.call(this, entity) || this;
27645
27699
  _this._tileMode = exports.SpriteTileMode.Continuous;
27646
27700
  _this._tiledAdaptiveThreshold = 0.5;
27647
27701
  _this._color = new Color$1(1, 1, 1, 1);
@@ -27660,12 +27714,12 @@
27660
27714
  _this._onSpriteChange = _this._onSpriteChange.bind(_assert_this_initialized(_this));
27661
27715
  return _this;
27662
27716
  };
27663
- _inherits$2(SpriteRenderer, Renderer);
27717
+ _inherits$2(SpriteRenderer, Renderer1);
27664
27718
  var _proto = SpriteRenderer.prototype;
27665
27719
  /**
27666
27720
  * @internal
27667
27721
  */ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
27668
- Renderer.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
27722
+ Renderer1.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
27669
27723
  target._assembler.resetData(target);
27670
27724
  target.sprite = this._sprite;
27671
27725
  target.drawMode = this._drawMode;
@@ -27713,7 +27767,7 @@
27713
27767
  /**
27714
27768
  * @internal
27715
27769
  */ _proto._onDestroy = function _onDestroy() {
27716
- Renderer.prototype._onDestroy.call(this);
27770
+ Renderer1.prototype._onDestroy.call(this);
27717
27771
  var sprite = this._sprite;
27718
27772
  if (sprite) {
27719
27773
  sprite._addReferCount(-1);
@@ -28097,10 +28151,10 @@
28097
28151
  }();
28098
28152
  /**
28099
28153
  * Renders a text for 2D graphics.
28100
- */ var TextRenderer = /*#__PURE__*/ function(Renderer) {
28154
+ */ var TextRenderer = /*#__PURE__*/ function(Renderer1) {
28101
28155
  var TextRenderer = function TextRenderer(entity) {
28102
28156
  var _this;
28103
- _this = Renderer.call(this, entity) || this;
28157
+ _this = Renderer1.call(this, entity) || this;
28104
28158
  /** @internal */ _this._subFont = null;
28105
28159
  /** @internal */ _this._charRenderDatas = [];
28106
28160
  _this._dirtyFlag = 15;
@@ -28122,7 +28176,7 @@
28122
28176
  _this._init();
28123
28177
  return _this;
28124
28178
  };
28125
- _inherits$2(TextRenderer, Renderer);
28179
+ _inherits$2(TextRenderer, Renderer1);
28126
28180
  var _proto = TextRenderer.prototype;
28127
28181
  /**
28128
28182
  * @internal
@@ -28136,7 +28190,7 @@
28136
28190
  /**
28137
28191
  * @internal
28138
28192
  */ _proto._onDestroy = function _onDestroy() {
28139
- Renderer.prototype._onDestroy.call(this);
28193
+ Renderer1.prototype._onDestroy.call(this);
28140
28194
  // Clear render data.
28141
28195
  var charRenderDatas = this._charRenderDatas;
28142
28196
  for(var i = 0, n = charRenderDatas.length; i < n; ++i){
@@ -28152,7 +28206,7 @@
28152
28206
  /**
28153
28207
  * @internal
28154
28208
  */ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
28155
- Renderer.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
28209
+ Renderer1.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
28156
28210
  target.font = this._font;
28157
28211
  target._subFont = this._subFont;
28158
28212
  };
@@ -28384,7 +28438,7 @@
28384
28438
  /**
28385
28439
  * @internal
28386
28440
  */ _proto._onTransformChanged = function _onTransformChanged(bit) {
28387
- Renderer.prototype._onTransformChanged.call(this, bit);
28441
+ Renderer1.prototype._onTransformChanged.call(this, bit);
28388
28442
  this._setDirtyFlagTrue(0x4 | 0x8);
28389
28443
  };
28390
28444
  _create_class$3(TextRenderer, [
@@ -28953,31 +29007,40 @@
28953
29007
  */ var AnimationEvent = function AnimationEvent() {};
28954
29008
  /**
28955
29009
  * Stores keyframe based animations.
28956
- */ var AnimationClip = /*#__PURE__*/ function(EngineObject) {
28957
- var AnimationClip = function AnimationClip(name) {
29010
+ */ var AnimationClip = /*#__PURE__*/ function(EngineObject1) {
29011
+ var AnimationClip = function AnimationClip(name1) {
28958
29012
  var _this;
28959
- _this = EngineObject.call(this, null) || this;
28960
- _this.name = name;
29013
+ _this = EngineObject1.call(this, null) || this;
29014
+ _this.name = name1;
28961
29015
  _this./** @internal */ _curveBindings = [];
28962
29016
  _this._length = 0;
28963
29017
  _this._events = [];
28964
29018
  return _this;
28965
29019
  };
28966
- _inherits$2(AnimationClip, EngineObject);
29020
+ _inherits$2(AnimationClip, EngineObject1);
28967
29021
  var _proto = AnimationClip.prototype;
28968
29022
  _proto.addEvent = function addEvent(param, time, parameter) {
29023
+ var newEvent;
28969
29024
  if (typeof param === "string") {
28970
29025
  var event = new AnimationEvent();
28971
29026
  event.functionName = param;
28972
29027
  event.time = time;
28973
29028
  event.parameter = parameter;
28974
- this._events.push(event);
29029
+ newEvent = event;
28975
29030
  } else {
28976
- this._events.push(param);
29031
+ newEvent = param;
29032
+ }
29033
+ var events = this._events;
29034
+ var count = events.length;
29035
+ var eventTime = newEvent.time;
29036
+ var maxEventTime = count ? events[count - 1].time : 0;
29037
+ if (eventTime >= maxEventTime) {
29038
+ events.push(newEvent);
29039
+ } else {
29040
+ var index = count;
29041
+ while(--index >= 0 && eventTime < events[index].time);
29042
+ events.splice(index + 1, 0, newEvent);
28977
29043
  }
28978
- this._events.sort(function(a, b) {
28979
- return a.time - b.time;
28980
- });
28981
29044
  };
28982
29045
  /**
28983
29046
  * Clears all events from the clip.
@@ -29200,14 +29263,14 @@
29200
29263
  return AnimationCurve;
29201
29264
  }();
29202
29265
  var _AnimationArrayCurve;
29203
- exports.AnimationArrayCurve = (_AnimationArrayCurve = /*#__PURE__*/ function(AnimationCurve) {
29266
+ exports.AnimationArrayCurve = (_AnimationArrayCurve = /*#__PURE__*/ function(AnimationCurve1) {
29204
29267
  var AnimationArrayCurve = function AnimationArrayCurve() {
29205
29268
  var _this;
29206
- _this = AnimationCurve.call(this) || this;
29269
+ _this = AnimationCurve1.call(this) || this;
29207
29270
  _this._evaluateData.value = [];
29208
29271
  return _this;
29209
29272
  };
29210
- _inherits$2(AnimationArrayCurve, AnimationCurve);
29273
+ _inherits$2(AnimationArrayCurve, AnimationCurve1);
29211
29274
  /**
29212
29275
  * @internal
29213
29276
  */ AnimationArrayCurve._initializeOwner = function _initializeOwner(owner) {
@@ -29294,14 +29357,14 @@
29294
29357
  StaticInterfaceImplement()
29295
29358
  ], exports.AnimationArrayCurve);
29296
29359
  var _AnimationBoolCurve;
29297
- exports.AnimationBoolCurve = (_AnimationBoolCurve = /*#__PURE__*/ function(AnimationCurve) {
29360
+ exports.AnimationBoolCurve = (_AnimationBoolCurve = /*#__PURE__*/ function(AnimationCurve1) {
29298
29361
  var AnimationBoolCurve = function AnimationBoolCurve() {
29299
29362
  var _this;
29300
- _this = AnimationCurve.call(this) || this;
29363
+ _this = AnimationCurve1.call(this) || this;
29301
29364
  _this._evaluateData.value = false;
29302
29365
  return _this;
29303
29366
  };
29304
- _inherits$2(AnimationBoolCurve, AnimationCurve);
29367
+ _inherits$2(AnimationBoolCurve, AnimationCurve1);
29305
29368
  /**
29306
29369
  * @internal
29307
29370
  */ AnimationBoolCurve._initializeOwner = function _initializeOwner(owner) {
@@ -29355,14 +29418,14 @@
29355
29418
  StaticInterfaceImplement()
29356
29419
  ], exports.AnimationBoolCurve);
29357
29420
  var _AnimationColorCurve;
29358
- exports.AnimationColorCurve = (_AnimationColorCurve = /*#__PURE__*/ function(AnimationCurve) {
29421
+ exports.AnimationColorCurve = (_AnimationColorCurve = /*#__PURE__*/ function(AnimationCurve1) {
29359
29422
  var AnimationColorCurve = function AnimationColorCurve() {
29360
29423
  var _this;
29361
- _this = AnimationCurve.call(this) || this;
29424
+ _this = AnimationCurve1.call(this) || this;
29362
29425
  _this._evaluateData.value = new Color$1();
29363
29426
  return _this;
29364
29427
  };
29365
- _inherits$2(AnimationColorCurve, AnimationCurve);
29428
+ _inherits$2(AnimationColorCurve, AnimationCurve1);
29366
29429
  /**
29367
29430
  * @internal
29368
29431
  */ AnimationColorCurve._initializeOwner = function _initializeOwner(owner) {
@@ -29456,16 +29519,16 @@
29456
29519
  StaticInterfaceImplement()
29457
29520
  ], exports.AnimationColorCurve);
29458
29521
  var _AnimationFloatArrayCurve;
29459
- exports.AnimationFloatArrayCurve = (_AnimationFloatArrayCurve = /*#__PURE__*/ function(AnimationCurve) {
29522
+ exports.AnimationFloatArrayCurve = (_AnimationFloatArrayCurve = /*#__PURE__*/ function(AnimationCurve1) {
29460
29523
  var AnimationFloatArrayCurve = function AnimationFloatArrayCurve() {
29461
- return AnimationCurve.apply(this, arguments);
29524
+ return AnimationCurve1.apply(this, arguments);
29462
29525
  };
29463
- _inherits$2(AnimationFloatArrayCurve, AnimationCurve);
29526
+ _inherits$2(AnimationFloatArrayCurve, AnimationCurve1);
29464
29527
  var _proto = AnimationFloatArrayCurve.prototype;
29465
29528
  /**
29466
29529
  * @inheritdoc
29467
29530
  */ _proto.addKey = function addKey(key) {
29468
- AnimationCurve.prototype.addKey.call(this, key);
29531
+ AnimationCurve1.prototype.addKey.call(this, key);
29469
29532
  var evaluateData = this._evaluateData;
29470
29533
  if (!evaluateData.value || evaluateData.value.length !== key.value.length) {
29471
29534
  var size = key.value.length;
@@ -29560,14 +29623,14 @@
29560
29623
  StaticInterfaceImplement()
29561
29624
  ], exports.AnimationFloatArrayCurve);
29562
29625
  var _AnimationFloatCurve;
29563
- exports.AnimationFloatCurve = (_AnimationFloatCurve = /*#__PURE__*/ function(AnimationCurve) {
29626
+ exports.AnimationFloatCurve = (_AnimationFloatCurve = /*#__PURE__*/ function(AnimationCurve1) {
29564
29627
  var AnimationFloatCurve = function AnimationFloatCurve() {
29565
29628
  var _this;
29566
- _this = AnimationCurve.call(this) || this;
29629
+ _this = AnimationCurve1.call(this) || this;
29567
29630
  _this._evaluateData.value = 0;
29568
29631
  return _this;
29569
29632
  };
29570
- _inherits$2(AnimationFloatCurve, AnimationCurve);
29633
+ _inherits$2(AnimationFloatCurve, AnimationCurve1);
29571
29634
  /**
29572
29635
  * @internal
29573
29636
  */ AnimationFloatCurve._initializeOwner = function _initializeOwner(owner) {
@@ -29633,14 +29696,14 @@
29633
29696
  StaticInterfaceImplement()
29634
29697
  ], exports.AnimationFloatCurve);
29635
29698
  var _AnimationQuaternionCurve;
29636
- exports.AnimationQuaternionCurve = (_AnimationQuaternionCurve = /*#__PURE__*/ function(AnimationCurve) {
29699
+ exports.AnimationQuaternionCurve = (_AnimationQuaternionCurve = /*#__PURE__*/ function(AnimationCurve1) {
29637
29700
  var AnimationQuaternionCurve1 = function AnimationQuaternionCurve1() {
29638
29701
  var _this;
29639
- _this = AnimationCurve.call(this) || this;
29702
+ _this = AnimationCurve1.call(this) || this;
29640
29703
  _this._evaluateData.value = new Quaternion();
29641
29704
  return _this;
29642
29705
  };
29643
- _inherits$2(AnimationQuaternionCurve1, AnimationCurve);
29706
+ _inherits$2(AnimationQuaternionCurve1, AnimationCurve1);
29644
29707
  /**
29645
29708
  * @internal
29646
29709
  */ AnimationQuaternionCurve1._initializeOwner = function _initializeOwner(owner) {
@@ -29741,14 +29804,14 @@
29741
29804
  StaticInterfaceImplement()
29742
29805
  ], exports.AnimationQuaternionCurve);
29743
29806
  var _AnimationVector2Curve;
29744
- exports.AnimationVector2Curve = (_AnimationVector2Curve = /*#__PURE__*/ function(AnimationCurve) {
29807
+ exports.AnimationVector2Curve = (_AnimationVector2Curve = /*#__PURE__*/ function(AnimationCurve1) {
29745
29808
  var AnimationVector2Curve = function AnimationVector2Curve() {
29746
29809
  var _this;
29747
- _this = AnimationCurve.call(this) || this;
29810
+ _this = AnimationCurve1.call(this) || this;
29748
29811
  _this._evaluateData.value = new Vector2();
29749
29812
  return _this;
29750
29813
  };
29751
- _inherits$2(AnimationVector2Curve, AnimationCurve);
29814
+ _inherits$2(AnimationVector2Curve, AnimationCurve1);
29752
29815
  /**
29753
29816
  * @internal
29754
29817
  */ AnimationVector2Curve._initializeOwner = function _initializeOwner(owner) {
@@ -29830,14 +29893,14 @@
29830
29893
  StaticInterfaceImplement()
29831
29894
  ], exports.AnimationVector2Curve);
29832
29895
  var _AnimationVector3Curve;
29833
- exports.AnimationVector3Curve = (_AnimationVector3Curve = /*#__PURE__*/ function(AnimationCurve) {
29896
+ exports.AnimationVector3Curve = (_AnimationVector3Curve = /*#__PURE__*/ function(AnimationCurve1) {
29834
29897
  var AnimationVector3Curve = function AnimationVector3Curve() {
29835
29898
  var _this;
29836
- _this = AnimationCurve.call(this) || this;
29899
+ _this = AnimationCurve1.call(this) || this;
29837
29900
  _this._evaluateData.value = new Vector3();
29838
29901
  return _this;
29839
29902
  };
29840
- _inherits$2(AnimationVector3Curve, AnimationCurve);
29903
+ _inherits$2(AnimationVector3Curve, AnimationCurve1);
29841
29904
  /**
29842
29905
  * @internal
29843
29906
  */ AnimationVector3Curve._initializeOwner = function _initializeOwner(owner) {
@@ -29931,14 +29994,14 @@
29931
29994
  StaticInterfaceImplement()
29932
29995
  ], exports.AnimationVector3Curve);
29933
29996
  var _AnimationVector4Curve;
29934
- exports.AnimationVector4Curve = (_AnimationVector4Curve = /*#__PURE__*/ function(AnimationCurve) {
29997
+ exports.AnimationVector4Curve = (_AnimationVector4Curve = /*#__PURE__*/ function(AnimationCurve1) {
29935
29998
  var AnimationVector4Curve = function AnimationVector4Curve() {
29936
29999
  var _this;
29937
- _this = AnimationCurve.call(this) || this;
30000
+ _this = AnimationCurve1.call(this) || this;
29938
30001
  _this._evaluateData.value = new Vector4();
29939
30002
  return _this;
29940
30003
  };
29941
- _inherits$2(AnimationVector4Curve, AnimationCurve);
30004
+ _inherits$2(AnimationVector4Curve, AnimationCurve1);
29942
30005
  /**
29943
30006
  * @internal
29944
30007
  */ AnimationVector4Curve._initializeOwner = function _initializeOwner(owner) {
@@ -30032,11 +30095,11 @@
30032
30095
  StaticInterfaceImplement()
30033
30096
  ], exports.AnimationVector4Curve);
30034
30097
  var _AnimationRefCurve;
30035
- exports.AnimationRefCurve = (_AnimationRefCurve = /*#__PURE__*/ function(AnimationCurve) {
30098
+ exports.AnimationRefCurve = (_AnimationRefCurve = /*#__PURE__*/ function(AnimationCurve1) {
30036
30099
  var AnimationRefCurve = function AnimationRefCurve() {
30037
- return AnimationCurve.call(this);
30100
+ return AnimationCurve1.call(this);
30038
30101
  };
30039
- _inherits$2(AnimationRefCurve, AnimationCurve);
30102
+ _inherits$2(AnimationRefCurve, AnimationCurve1);
30040
30103
  /**
30041
30104
  * @internal
30042
30105
  */ AnimationRefCurve._initializeOwner = function _initializeOwner(owner) {};
@@ -30058,14 +30121,14 @@
30058
30121
  StaticInterfaceImplement()
30059
30122
  ], exports.AnimationRefCurve);
30060
30123
  var _AnimationRectCurve;
30061
- exports.AnimationRectCurve = (_AnimationRectCurve = /*#__PURE__*/ function(AnimationCurve) {
30124
+ exports.AnimationRectCurve = (_AnimationRectCurve = /*#__PURE__*/ function(AnimationCurve1) {
30062
30125
  var AnimationRectCurve = function AnimationRectCurve() {
30063
30126
  var _this;
30064
- _this = AnimationCurve.call(this) || this;
30127
+ _this = AnimationCurve1.call(this) || this;
30065
30128
  _this._evaluateData.value = new Rect();
30066
30129
  return _this;
30067
30130
  };
30068
- _inherits$2(AnimationRectCurve, AnimationCurve);
30131
+ _inherits$2(AnimationRectCurve, AnimationCurve1);
30069
30132
  /**
30070
30133
  * @internal
30071
30134
  */ AnimationRectCurve._initializeOwner = function _initializeOwner(owner) {
@@ -30160,6 +30223,7 @@
30160
30223
  this.playState = AnimatorStatePlayState.UnStarted;
30161
30224
  this.clipTime = state.clipStartTime * state.clip.length;
30162
30225
  this.currentEventIndex = 0;
30226
+ this.currentTransitionIndex = 0;
30163
30227
  };
30164
30228
  _proto.update = function update(isBackwards) {
30165
30229
  var state = this.state;
@@ -30213,10 +30277,10 @@
30213
30277
  };
30214
30278
  /**
30215
30279
  * The controller of the animation system.
30216
- */ var Animator = /*#__PURE__*/ function(Component) {
30280
+ */ var Animator = /*#__PURE__*/ function(Component1) {
30217
30281
  var Animator = function Animator(entity) {
30218
30282
  var _this;
30219
- _this = Component.call(this, entity) || this;
30283
+ _this = Component1.call(this, entity) || this;
30220
30284
  /** Culling mode of this Animator. */ _this.cullingMode = exports.AnimatorCullingMode.None;
30221
30285
  /** The playback speed of the Animator, 1.0 is normal playback speed. */ _this.speed = 1.0;
30222
30286
  /** @internal */ _this._onUpdateIndex = -1;
@@ -30231,7 +30295,7 @@
30231
30295
  _this._controlledRenderers = [];
30232
30296
  return _this;
30233
30297
  };
30234
- _inherits$2(Animator, Component);
30298
+ _inherits$2(Animator, Component1);
30235
30299
  var _proto = Animator.prototype;
30236
30300
  /**
30237
30301
  * Play a state by name.
@@ -30281,7 +30345,7 @@
30281
30345
  manuallyTransition.duration = normalizedTransitionDuration;
30282
30346
  manuallyTransition.offset = normalizedTimeOffset;
30283
30347
  manuallyTransition.destinationState = state;
30284
- if (this._crossFadeByTransition(manuallyTransition, layerIndex)) {
30348
+ if (this._crossFadeByTransition(manuallyTransition, playLayerIndex)) {
30285
30349
  this.update(0);
30286
30350
  }
30287
30351
  };
@@ -30324,7 +30388,7 @@
30324
30388
  * Get the playing state from the target layerIndex.
30325
30389
  * @param layerIndex - The layer index
30326
30390
  */ _proto.getCurrentAnimatorState = function getCurrentAnimatorState(layerIndex) {
30327
- var _this__animatorLayersData_layerIndex, _this__animatorLayersData_layerIndex_srcPlayData;
30391
+ var _this__animatorLayersData_layerIndex_srcPlayData, _this__animatorLayersData_layerIndex;
30328
30392
  return (_this__animatorLayersData_layerIndex = this._animatorLayersData[layerIndex]) == null ? void 0 : (_this__animatorLayersData_layerIndex_srcPlayData = _this__animatorLayersData_layerIndex.srcPlayData) == null ? void 0 : _this__animatorLayersData_layerIndex_srcPlayData.state;
30329
30393
  };
30330
30394
  /**
@@ -30515,11 +30579,9 @@
30515
30579
  _proto._updateLayer = function _updateLayer(layerIndex, firstLayer, deltaTime, aniUpdate) {
30516
30580
  var _this__animatorController_layers_layerIndex = this._animatorController.layers[layerIndex], blendingMode = _this__animatorController_layers_layerIndex.blendingMode, weight = _this__animatorController_layers_layerIndex.weight;
30517
30581
  var layerData = this._animatorLayersData[layerIndex];
30518
- var srcPlayData = layerData.srcPlayData, destPlayData = layerData.destPlayData, crossFadeTransitionInfo = layerData.crossFadeTransition;
30582
+ var srcPlayData = layerData.srcPlayData, destPlayData = layerData.destPlayData;
30519
30583
  var additive = blendingMode === exports.AnimatorLayerBlendingMode.Additive;
30520
30584
  firstLayer && (weight = 1.0);
30521
- //@todo: All situations should be checked, optimizations will follow later.
30522
- layerData.layerState !== LayerState.FixedCrossFading && this._checkTransition(srcPlayData, crossFadeTransitionInfo, layerIndex);
30523
30585
  switch(layerData.layerState){
30524
30586
  case LayerState.Playing:
30525
30587
  this._updatePlayingState(srcPlayData, layerData, layerIndex, weight, deltaTime, additive, aniUpdate);
@@ -30538,6 +30600,7 @@
30538
30600
  _proto._updatePlayingState = function _updatePlayingState(playData, layerData, layerIndex, weight, delta, additive, aniUpdate) {
30539
30601
  var _playData_stateData = playData.stateData, curveLayerOwner = _playData_stateData.curveLayerOwner, eventHandlers = _playData_stateData.eventHandlers;
30540
30602
  var state = playData.state, lastPlayState = playData.playState, lastClipTime = playData.clipTime;
30603
+ var transitions = state.transitions;
30541
30604
  var _state_clip = state.clip, curveBindings = _state_clip._curveBindings;
30542
30605
  var speed = state.speed * this.speed;
30543
30606
  playData.frameTime += speed * delta;
@@ -30546,8 +30609,9 @@
30546
30609
  var finished = playState === AnimatorStatePlayState.Finished;
30547
30610
  if (aniUpdate || finished) {
30548
30611
  for(var i = curveBindings.length - 1; i >= 0; i--){
30612
+ var _layerOwner;
30549
30613
  var layerOwner = curveLayerOwner[i];
30550
- var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
30614
+ var owner = (_layerOwner = layerOwner) == null ? void 0 : _layerOwner.curveOwner;
30551
30615
  if (!owner) continue;
30552
30616
  var curve = curveBindings[i].curve;
30553
30617
  if (curve.keys.length) {
@@ -30570,6 +30634,12 @@
30570
30634
  } else {
30571
30635
  this._callAnimatorScriptOnUpdate(state, layerIndex);
30572
30636
  }
30637
+ if (transitions.length) {
30638
+ var layerState = layerData.layerState;
30639
+ if (layerState !== LayerState.CrossFading && layerState !== LayerState.FixedCrossFading) {
30640
+ this._checkTransition(playData, transitions, layerIndex, lastClipTime, clipTime);
30641
+ }
30642
+ }
30573
30643
  };
30574
30644
  _proto._updateCrossFade = function _updateCrossFade(srcPlayData, destPlayData, layerData, layerIndex, weight, delta, additive, aniUpdate) {
30575
30645
  var speed = this.speed;
@@ -30596,8 +30666,9 @@
30596
30666
  var finished = destPlayData.playState === AnimatorStatePlayState.Finished;
30597
30667
  if (aniUpdate || finished) {
30598
30668
  for(var i = crossLayerOwnerCollection.length - 1; i >= 0; i--){
30669
+ var _layerOwner;
30599
30670
  var layerOwner = crossLayerOwnerCollection[i];
30600
- var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
30671
+ var owner = (_layerOwner = layerOwner) == null ? void 0 : _layerOwner.curveOwner;
30601
30672
  if (!owner) continue;
30602
30673
  var srcCurveIndex = layerOwner.crossSrcCurveIndex;
30603
30674
  var destCurveIndex = layerOwner.crossDestCurveIndex;
@@ -30644,8 +30715,9 @@
30644
30715
  // When the animator is culled (aniUpdate=false), if the play state has finished, the final value needs to be calculated and saved to be applied directly.
30645
30716
  if (aniUpdate || finished) {
30646
30717
  for(var i = crossLayerOwnerCollection.length - 1; i >= 0; i--){
30718
+ var _layerOwner;
30647
30719
  var layerOwner = crossLayerOwnerCollection[i];
30648
- var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
30720
+ var owner = (_layerOwner = layerOwner) == null ? void 0 : _layerOwner.curveOwner;
30649
30721
  if (!owner) continue;
30650
30722
  var curveIndex = layerOwner.crossDestCurveIndex;
30651
30723
  this._checkRevertOwner(owner, additive);
@@ -30673,8 +30745,9 @@
30673
30745
  var curveLayerOwner = playData.stateData.curveLayerOwner;
30674
30746
  var _playData_state_clip = playData.state.clip, curveBindings = _playData_state_clip._curveBindings;
30675
30747
  for(var i = curveBindings.length - 1; i >= 0; i--){
30748
+ var _layerOwner;
30676
30749
  var layerOwner = curveLayerOwner[i];
30677
- var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
30750
+ var owner = (_layerOwner = layerOwner) == null ? void 0 : _layerOwner.curveOwner;
30678
30751
  if (!owner) continue;
30679
30752
  this._checkRevertOwner(owner, additive);
30680
30753
  owner.applyValue(layerOwner.finalValue, weight, additive);
@@ -30710,21 +30783,60 @@
30710
30783
  }
30711
30784
  }
30712
30785
  };
30713
- _proto._checkTransition = function _checkTransition(stateData, crossFadeTransition, layerIndex) {
30714
- var state = stateData.state, clipTime = stateData.clipTime;
30715
- var transitions = state.transitions;
30716
- var duration = state._getDuration();
30717
- for(var i = 0, n = transitions.length; i < n; ++i){
30718
- var transition = transitions[i];
30719
- if (duration * transition.exitTime <= clipTime) {
30720
- crossFadeTransition !== transition && this._crossFadeByTransition(transition, layerIndex);
30786
+ _proto._checkTransition = function _checkTransition(playState, transitions, layerIndex, lastClipTime, clipTime) {
30787
+ var state = playState.state;
30788
+ var clipDuration = state.clip.length;
30789
+ if (this.speed * state.speed >= 0) {
30790
+ console.log(999, clipTime, lastClipTime);
30791
+ if (clipTime < lastClipTime) {
30792
+ this._checkSubTransition(playState, transitions, layerIndex, lastClipTime, state.clipEndTime * clipDuration);
30793
+ playState.currentTransitionIndex = 0;
30794
+ this._checkSubTransition(playState, transitions, layerIndex, state.clipStartTime * clipDuration, clipTime);
30795
+ } else {
30796
+ this._checkSubTransition(playState, transitions, layerIndex, lastClipTime, clipTime);
30797
+ }
30798
+ } else {
30799
+ if (clipTime > lastClipTime) {
30800
+ this._checkBackwardsSubTransition(playState, transitions, layerIndex, lastClipTime, state.clipStartTime * clipDuration);
30801
+ playState.currentTransitionIndex = transitions.length - 1;
30802
+ this._checkBackwardsSubTransition(playState, transitions, layerIndex, clipTime, state.clipEndTime * clipDuration);
30803
+ } else {
30804
+ this._checkBackwardsSubTransition(playState, transitions, layerIndex, lastClipTime, clipTime);
30805
+ }
30806
+ }
30807
+ };
30808
+ _proto._checkSubTransition = function _checkSubTransition(playState, transitions, layerIndex, lastClipTime, curClipTime) {
30809
+ var transitionIndex = playState.currentTransitionIndex;
30810
+ var duration = playState.state._getDuration();
30811
+ for(var n = transitions.length; transitionIndex < n; transitionIndex++){
30812
+ var transition = transitions[transitionIndex];
30813
+ var exitTime = transition.exitTime * duration;
30814
+ if (exitTime > curClipTime) {
30815
+ break;
30816
+ }
30817
+ if (exitTime >= lastClipTime) {
30818
+ this._crossFadeByTransition(transition, layerIndex);
30819
+ playState.currentTransitionIndex = Math.min(transitionIndex + 1, n - 1);
30820
+ }
30821
+ }
30822
+ };
30823
+ _proto._checkBackwardsSubTransition = function _checkBackwardsSubTransition(playState, transitions, layerIndex, lastClipTime, curClipTime) {
30824
+ var transitionIndex = playState.currentTransitionIndex;
30825
+ var duration = playState.state._getDuration();
30826
+ for(; transitionIndex >= 0; transitionIndex--){
30827
+ var transition = transitions[transitionIndex];
30828
+ var exitTime = transition.exitTime * duration;
30829
+ if (exitTime < curClipTime) {
30830
+ break;
30831
+ }
30832
+ if (exitTime <= lastClipTime) {
30833
+ this._crossFadeByTransition(transition, layerIndex);
30834
+ playState.currentTransitionIndex = Math.max(transitionIndex - 1, 0);
30721
30835
  }
30722
30836
  }
30723
30837
  };
30724
30838
  _proto._crossFadeByTransition = function _crossFadeByTransition(transition, layerIndex) {
30725
- var name = transition.destinationState.name;
30726
- var stateInfo = this._getAnimatorStateInfo(name, layerIndex);
30727
- var crossState = stateInfo.state, playLayerIndex = stateInfo.layerIndex;
30839
+ var crossState = transition.destinationState;
30728
30840
  if (!crossState) {
30729
30841
  return false;
30730
30842
  }
@@ -30732,10 +30844,10 @@
30732
30844
  Logger.warn("The state named " + name + " has no AnimationClip data.");
30733
30845
  return false;
30734
30846
  }
30735
- var animatorLayerData = this._getAnimatorLayerData(playLayerIndex);
30847
+ var animatorLayerData = this._getAnimatorLayerData(layerIndex);
30736
30848
  var layerState = animatorLayerData.layerState;
30737
30849
  var destPlayData = animatorLayerData.destPlayData;
30738
- var animatorStateData = this._getAnimatorStateData(name, crossState, animatorLayerData, playLayerIndex);
30850
+ var animatorStateData = this._getAnimatorStateData(crossState.name, crossState, animatorLayerData, layerIndex);
30739
30851
  var duration = crossState._getDuration();
30740
30852
  var offset = duration * transition.offset;
30741
30853
  destPlayData.reset(crossState, animatorStateData, offset);
@@ -30838,8 +30950,9 @@
30838
30950
  _proto._checkAutoPlay = function _checkAutoPlay() {
30839
30951
  var layers = this._animatorController.layers;
30840
30952
  for(var i = 0, n = layers.length; i < n; ++i){
30953
+ var _stateMachine;
30841
30954
  var stateMachine = layers[i].stateMachine;
30842
- if (stateMachine == null ? void 0 : stateMachine.defaultState) {
30955
+ if ((_stateMachine = stateMachine) == null ? void 0 : _stateMachine.defaultState) {
30843
30956
  this.play(stateMachine.defaultState.name, i);
30844
30957
  }
30845
30958
  }
@@ -30906,8 +31019,8 @@
30906
31019
  /**
30907
31020
  * Get the layer by name.
30908
31021
  * @param name - The layer's name.
30909
- */ _proto.findLayerByName = function findLayerByName(name) {
30910
- return this._layersMap[name];
31022
+ */ _proto.findLayerByName = function findLayerByName(name1) {
31023
+ return this._layersMap[name1];
30911
31024
  };
30912
31025
  /**
30913
31026
  * Add a layer to the controller.
@@ -30930,8 +31043,8 @@
30930
31043
  * Clear layers.
30931
31044
  */ _proto.clearLayers = function clearLayers() {
30932
31045
  this._layers.length = 0;
30933
- for(var name in this._layersMap){
30934
- delete this._layersMap[name];
31046
+ for(var name1 in this._layersMap){
31047
+ delete this._layersMap[name1];
30935
31048
  }
30936
31049
  this._updateFlagManager.dispatch();
30937
31050
  };
@@ -30954,8 +31067,8 @@
30954
31067
  }();
30955
31068
  /**
30956
31069
  * The Animation Layer contains a state machine that controls animations of a model or part of it.
30957
- */ var AnimatorControllerLayer = function AnimatorControllerLayer(name) {
30958
- this.name = name;
31070
+ */ var AnimatorControllerLayer = function AnimatorControllerLayer(name1) {
31071
+ this.name = name1;
30959
31072
  this./** The blending weight that the layers has. It is not taken into account for the first layer. */ weight = 1.0;
30960
31073
  this./** The blending mode used by the layer. It is not taken into account for the first layer. */ blendingMode = exports.AnimatorLayerBlendingMode.Override;
30961
31074
  };
@@ -30998,8 +31111,8 @@
30998
31111
  /**
30999
31112
  * States are the basic building blocks of a state machine. Each state contains a AnimationClip which will play while the character is in that state.
31000
31113
  */ var AnimatorState = /*#__PURE__*/ function() {
31001
- var AnimatorState = function AnimatorState(name) {
31002
- this.name = name;
31114
+ var AnimatorState = function AnimatorState(name1) {
31115
+ this.name = name1;
31003
31116
  this./** The speed of the clip. 1 is normal speed, default 1. */ speed = 1.0;
31004
31117
  this./** The wrap mode used in the state. */ wrapMode = exports.WrapMode.Loop;
31005
31118
  this./** @internal */ _onStateEnterScripts = [];
@@ -31014,7 +31127,17 @@
31014
31127
  * Add an outgoing transition to the destination state.
31015
31128
  * @param transition - The transition
31016
31129
  */ _proto.addTransition = function addTransition(transition) {
31017
- this._transitions.push(transition);
31130
+ var transitions = this._transitions;
31131
+ var count = transitions.length;
31132
+ var time = transition.exitTime;
31133
+ var maxExitTime = count ? transitions[count - 1].exitTime : 0;
31134
+ if (time >= maxExitTime) {
31135
+ transitions.push(transition);
31136
+ } else {
31137
+ var index = count;
31138
+ while(--index >= 0 && time < transitions[index].exitTime);
31139
+ transitions.splice(index + 1, 0, transition);
31140
+ }
31018
31141
  };
31019
31142
  /**
31020
31143
  * Remove a transition from the state.
@@ -31128,14 +31251,14 @@
31128
31251
  /**
31129
31252
  * Add a state to the state machine.
31130
31253
  * @param name - The name of the new state
31131
- */ _proto.addState = function addState(name) {
31132
- var state = this.findStateByName(name);
31254
+ */ _proto.addState = function addState(name1) {
31255
+ var state = this.findStateByName(name1);
31133
31256
  if (!state) {
31134
- state = new AnimatorState(name);
31257
+ state = new AnimatorState(name1);
31135
31258
  this.states.push(state);
31136
- this._statesMap[name] = state;
31259
+ this._statesMap[name1] = state;
31137
31260
  } else {
31138
- console.warn("The state named " + name + " has existed.");
31261
+ console.warn("The state named " + name1 + " has existed.");
31139
31262
  }
31140
31263
  return state;
31141
31264
  };
@@ -31143,32 +31266,32 @@
31143
31266
  * Remove a state from the state machine.
31144
31267
  * @param state - The state
31145
31268
  */ _proto.removeState = function removeState(state) {
31146
- var name = state.name;
31269
+ var name1 = state.name;
31147
31270
  var index = this.states.indexOf(state);
31148
31271
  if (index > -1) {
31149
31272
  this.states.splice(index, 1);
31150
31273
  }
31151
- delete this._statesMap[name];
31274
+ delete this._statesMap[name1];
31152
31275
  };
31153
31276
  /**
31154
31277
  * Get the state by name.
31155
31278
  * @param name - The layer's name
31156
- */ _proto.findStateByName = function findStateByName(name) {
31157
- return this._statesMap[name];
31279
+ */ _proto.findStateByName = function findStateByName(name1) {
31280
+ return this._statesMap[name1];
31158
31281
  };
31159
31282
  /**
31160
31283
  * Makes a unique state name in the state machine.
31161
31284
  * @param name - Desired name for the state.
31162
31285
  * @returns Unique name.
31163
- */ _proto.makeUniqueStateName = function makeUniqueStateName(name) {
31286
+ */ _proto.makeUniqueStateName = function makeUniqueStateName(name1) {
31164
31287
  var _statesMap = this._statesMap;
31165
- var originName = name;
31288
+ var originName = name1;
31166
31289
  var index = 0;
31167
- while(_statesMap[name]){
31168
- name = originName + " " + index;
31290
+ while(_statesMap[name1]){
31291
+ name1 = originName + " " + index;
31169
31292
  index++;
31170
31293
  }
31171
- return name;
31294
+ return name1;
31172
31295
  };
31173
31296
  return AnimatorStateMachine;
31174
31297
  }();
@@ -31187,11 +31310,11 @@
31187
31310
  */ var Keyframe = function Keyframe() {};
31188
31311
  /**
31189
31312
  * SkyBoxMaterial.
31190
- */ var SkyBoxMaterial = /*#__PURE__*/ function(Material) {
31191
- _inherits$2(SkyBoxMaterial, Material);
31313
+ */ var SkyBoxMaterial = /*#__PURE__*/ function(Material1) {
31314
+ _inherits$2(SkyBoxMaterial, Material1);
31192
31315
  function SkyBoxMaterial(engine) {
31193
31316
  var _this;
31194
- _this = Material.call(this, engine, Shader.find("skybox")) || this;
31317
+ _this = Material1.call(this, engine, Shader.find("skybox")) || this;
31195
31318
  _this._textureDecodeRGBM = false;
31196
31319
  _this._tintColor = new Color$1(1, 1, 1, 1);
31197
31320
  _this.renderState.rasterState.cullMode = exports.CullMode.Off;
@@ -31296,10 +31419,10 @@
31296
31419
  })(exports.SunMode || (exports.SunMode = {}));
31297
31420
  /**
31298
31421
  * Sky procedural material.
31299
- */ var SkyProceduralMaterial = /*#__PURE__*/ function(Material) {
31422
+ */ var SkyProceduralMaterial = /*#__PURE__*/ function(Material1) {
31300
31423
  var SkyProceduralMaterial = function SkyProceduralMaterial(engine) {
31301
31424
  var _this;
31302
- _this = Material.call(this, engine, Shader.find("SkyProcedural")) || this;
31425
+ _this = Material1.call(this, engine, Shader.find("SkyProcedural")) || this;
31303
31426
  _this.sunMode = 2;
31304
31427
  _this.sunSize = 0.04;
31305
31428
  _this.sunSizeConvergence = 5;
@@ -31311,7 +31434,7 @@
31311
31434
  _this.renderState.depthState.compareFunction = exports.CompareFunction.LessEqual;
31312
31435
  return _this;
31313
31436
  };
31314
- _inherits$2(SkyProceduralMaterial, Material);
31437
+ _inherits$2(SkyProceduralMaterial, Material1);
31315
31438
  var _proto = SkyProceduralMaterial.prototype;
31316
31439
  /**
31317
31440
  * @inheritDoc
@@ -31835,10 +31958,10 @@
31835
31958
  ], ParticleGeneratorModule.prototype, "_generator", void 0);
31836
31959
  /**
31837
31960
  * Color over lifetime module.
31838
- */ var ColorOverLifetimeModule = /*#__PURE__*/ function(ParticleGeneratorModule) {
31961
+ */ var ColorOverLifetimeModule = /*#__PURE__*/ function(ParticleGeneratorModule1) {
31839
31962
  var ColorOverLifetimeModule = function ColorOverLifetimeModule() {
31840
31963
  var _this;
31841
- _this = ParticleGeneratorModule.apply(this, arguments) || this;
31964
+ _this = ParticleGeneratorModule1.apply(this, arguments) || this;
31842
31965
  /** Color gradient over lifetime. */ _this.color = new ParticleCompositeGradient(new ParticleGradient([
31843
31966
  new GradientColorKey(0.0, new Color$1(1, 1, 1)),
31844
31967
  new GradientColorKey(1.0, new Color$1(1, 1, 1))
@@ -31851,7 +31974,7 @@
31851
31974
  ;
31852
31975
  return _this;
31853
31976
  };
31854
- _inherits$2(ColorOverLifetimeModule, ParticleGeneratorModule);
31977
+ _inherits$2(ColorOverLifetimeModule, ParticleGeneratorModule1);
31855
31978
  var _proto = ColorOverLifetimeModule.prototype;
31856
31979
  /**
31857
31980
  * @internal
@@ -31996,10 +32119,10 @@
31996
32119
  ], ParticleCompositeCurve.prototype, "curveMax", void 0);
31997
32120
  /**
31998
32121
  * The EmissionModule of a Particle Generator.
31999
- */ var EmissionModule = /*#__PURE__*/ function(ParticleGeneratorModule) {
32122
+ */ var EmissionModule = /*#__PURE__*/ function(ParticleGeneratorModule1) {
32000
32123
  var EmissionModule = function EmissionModule() {
32001
32124
  var _this;
32002
- _this = ParticleGeneratorModule.apply(this, arguments) || this;
32125
+ _this = ParticleGeneratorModule1.apply(this, arguments) || this;
32003
32126
  /** The rate of particle emission. */ _this.rateOverTime = new ParticleCompositeCurve(10);
32004
32127
  /** The rate at which the emitter spawns new particles over distance. */ _this.rateOverDistance = new ParticleCompositeCurve(0);
32005
32128
  /** @internal */ _this._shapeRand = new Rand(0, ParticleRandomSubSeeds.Shape);
@@ -32009,7 +32132,7 @@
32009
32132
  _this._burstRand = new Rand(0, ParticleRandomSubSeeds.Burst);
32010
32133
  return _this;
32011
32134
  };
32012
- _inherits$2(EmissionModule, ParticleGeneratorModule);
32135
+ _inherits$2(EmissionModule, ParticleGeneratorModule1);
32013
32136
  var _proto = EmissionModule.prototype;
32014
32137
  /**
32015
32138
  * Add a single burst.
@@ -32369,10 +32492,10 @@
32369
32492
  ], MainModule.prototype, "_startRotationRand", void 0);
32370
32493
  /**
32371
32494
  * Rotate particles throughout their lifetime.
32372
- */ var RotationOverLifetimeModule = /*#__PURE__*/ function(ParticleGeneratorModule) {
32495
+ */ var RotationOverLifetimeModule = /*#__PURE__*/ function(ParticleGeneratorModule1) {
32373
32496
  var RotationOverLifetimeModule = function RotationOverLifetimeModule() {
32374
32497
  var _this;
32375
- _this = ParticleGeneratorModule.apply(this, arguments) || this;
32498
+ _this = ParticleGeneratorModule1.apply(this, arguments) || this;
32376
32499
  /** Specifies whether the rotation is separate on each axis, when disabled only z axis is used. */ _this.separateAxes = false;
32377
32500
  /** Rotation over lifetime for z axis. */ _this.rotationX = new ParticleCompositeCurve(0);
32378
32501
  /** Rotation over lifetime for z axis. */ _this.rotationY = new ParticleCompositeCurve(0);
@@ -32382,7 +32505,7 @@
32382
32505
  _this._rotationMaxConstant = new Vector3();
32383
32506
  return _this;
32384
32507
  };
32385
- _inherits$2(RotationOverLifetimeModule, ParticleGeneratorModule);
32508
+ _inherits$2(RotationOverLifetimeModule, ParticleGeneratorModule1);
32386
32509
  var _proto = RotationOverLifetimeModule.prototype;
32387
32510
  /**
32388
32511
  * @internal
@@ -32597,17 +32720,17 @@
32597
32720
  };
32598
32721
  /**
32599
32722
  * Size over lifetime module.
32600
- */ var SizeOverLifetimeModule = /*#__PURE__*/ function(ParticleGeneratorModule) {
32723
+ */ var SizeOverLifetimeModule = /*#__PURE__*/ function(ParticleGeneratorModule1) {
32601
32724
  var SizeOverLifetimeModule = function SizeOverLifetimeModule() {
32602
32725
  var _this;
32603
- _this = ParticleGeneratorModule.apply(this, arguments) || this;
32726
+ _this = ParticleGeneratorModule1.apply(this, arguments) || this;
32604
32727
  /** Specifies whether the Size is separate on each axis. */ _this.separateAxes = false;
32605
32728
  /** Size curve over lifetime for x axis. */ _this.sizeX = new ParticleCompositeCurve(new ParticleCurve(new CurveKey(0, 0), new CurveKey(1, 1)));
32606
32729
  /** Size curve over lifetime for y axis. */ _this.sizeY = new ParticleCompositeCurve(new ParticleCurve(new CurveKey(0, 0), new CurveKey(1, 1)));
32607
32730
  /** Size curve over lifetime for z axis. */ _this.sizeZ = new ParticleCompositeCurve(new ParticleCurve(new CurveKey(0, 0), new CurveKey(1, 1)));
32608
32731
  return _this;
32609
32732
  };
32610
- _inherits$2(SizeOverLifetimeModule, ParticleGeneratorModule);
32733
+ _inherits$2(SizeOverLifetimeModule, ParticleGeneratorModule1);
32611
32734
  var _proto = SizeOverLifetimeModule.prototype;
32612
32735
  /**
32613
32736
  * @internal
@@ -32708,10 +32831,10 @@
32708
32831
  ], SizeOverLifetimeModule.prototype, "_isRandomTwoMacro", void 0);
32709
32832
  /**
32710
32833
  * Texture sheet animation module.
32711
- */ var TextureSheetAnimationModule = /*#__PURE__*/ function(ParticleGeneratorModule) {
32834
+ */ var TextureSheetAnimationModule = /*#__PURE__*/ function(ParticleGeneratorModule1) {
32712
32835
  var TextureSheetAnimationModule = function TextureSheetAnimationModule() {
32713
32836
  var _this;
32714
- _this = ParticleGeneratorModule.apply(this, arguments) || this;
32837
+ _this = ParticleGeneratorModule1.apply(this, arguments) || this;
32715
32838
  /** Start frame of the texture sheet. */ _this.startFrame = new ParticleCompositeCurve(0);
32716
32839
  /** Frame over time curve of the texture sheet. */ _this.frameOverTime = new ParticleCompositeCurve(new ParticleCurve(new CurveKey(0, 0), new CurveKey(1, 1)));
32717
32840
  /** Texture sheet animation type. */ _this.type = /** Animate over the whole texture sheet from left to right, top to bottom. */ 0;
@@ -32722,7 +32845,7 @@
32722
32845
  _this._tiling = new Vector2(1, 1);
32723
32846
  return _this;
32724
32847
  };
32725
- _inherits$2(TextureSheetAnimationModule, ParticleGeneratorModule);
32848
+ _inherits$2(TextureSheetAnimationModule, ParticleGeneratorModule1);
32726
32849
  var _proto = TextureSheetAnimationModule.prototype;
32727
32850
  /**
32728
32851
  * @inheritDoc
@@ -32812,10 +32935,10 @@
32812
32935
  })(TextureSheetAnimationType || (TextureSheetAnimationType = {}));
32813
32936
  /**
32814
32937
  * Velocity over lifetime module.
32815
- */ var VelocityOverLifetimeModule = /*#__PURE__*/ function(ParticleGeneratorModule) {
32938
+ */ var VelocityOverLifetimeModule = /*#__PURE__*/ function(ParticleGeneratorModule1) {
32816
32939
  var VelocityOverLifetimeModule = function VelocityOverLifetimeModule() {
32817
32940
  var _this;
32818
- _this = ParticleGeneratorModule.apply(this, arguments) || this;
32941
+ _this = ParticleGeneratorModule1.apply(this, arguments) || this;
32819
32942
  /** Velocity over lifetime for x axis. */ _this.velocityX = new ParticleCompositeCurve(0);
32820
32943
  /** Velocity over lifetime for z axis. */ _this.velocityY = new ParticleCompositeCurve(0);
32821
32944
  /** Velocity over lifetime for z axis. */ _this.velocityZ = new ParticleCompositeCurve(0);
@@ -32825,7 +32948,7 @@
32825
32948
  _this._velocityMaxConstant = new Vector3();
32826
32949
  return _this;
32827
32950
  };
32828
- _inherits$2(VelocityOverLifetimeModule, ParticleGeneratorModule);
32951
+ _inherits$2(VelocityOverLifetimeModule, ParticleGeneratorModule1);
32829
32952
  var _proto = VelocityOverLifetimeModule.prototype;
32830
32953
  /**
32831
32954
  * @internal
@@ -33476,11 +33599,11 @@
33476
33599
  ], ParticleGenerator.prototype, "_instanceVertices", void 0);
33477
33600
  /**
33478
33601
  * Particle Renderer Component.
33479
- */ var ParticleRenderer = /*#__PURE__*/ function(Renderer) {
33480
- _inherits$2(ParticleRenderer, Renderer);
33602
+ */ var ParticleRenderer = /*#__PURE__*/ function(Renderer1) {
33603
+ _inherits$2(ParticleRenderer, Renderer1);
33481
33604
  function ParticleRenderer(entity) {
33482
33605
  var _this;
33483
- _this = Renderer.call(this, entity) || this;
33606
+ _this = Renderer1.call(this, entity) || this;
33484
33607
  /** Particle generator. */ _this.generator = new ParticleGenerator(_assert_this_initialized(_this));
33485
33608
  /** Specifies how much particles stretch depending on their velocity. */ _this.velocityScale = 0;
33486
33609
  /** How much are the particles stretched in their direction of motion, defined as the length of the particle compared to its width. */ _this.lengthScale = 2;
@@ -33515,7 +33638,7 @@
33515
33638
  if (generator._firstActiveElement === generator._firstFreeElement) {
33516
33639
  return;
33517
33640
  }
33518
- Renderer.prototype._prepareRender.call(this, context);
33641
+ Renderer1.prototype._prepareRender.call(this, context);
33519
33642
  };
33520
33643
  /**
33521
33644
  * @internal
@@ -33604,9 +33727,10 @@
33604
33727
  set: function set(value) {
33605
33728
  var lastMesh = this._mesh;
33606
33729
  if (lastMesh !== value) {
33730
+ var _lastMesh, _value;
33607
33731
  this._mesh = value;
33608
- lastMesh == null ? void 0 : lastMesh._addReferCount(-1);
33609
- value == null ? void 0 : value._addReferCount(1);
33732
+ (_lastMesh = lastMesh) == null ? void 0 : _lastMesh._addReferCount(-1);
33733
+ (_value = value) == null ? void 0 : _value._addReferCount(1);
33610
33734
  if (this.renderMode === exports.ParticleRenderMode.Mesh) {
33611
33735
  this.generator._reorganizeGeometryBuffers();
33612
33736
  }
@@ -33734,15 +33858,15 @@
33734
33858
  })(ParticleShapeType || (ParticleShapeType = {}));
33735
33859
  /**
33736
33860
  * Particle shape that emits particles from a box.
33737
- */ var BoxShape = /*#__PURE__*/ function(BaseShape) {
33861
+ */ var BoxShape = /*#__PURE__*/ function(BaseShape1) {
33738
33862
  var BoxShape = function BoxShape() {
33739
33863
  var _this;
33740
- _this = BaseShape.call(this) || this;
33864
+ _this = BaseShape1.call(this) || this;
33741
33865
  /** The size of the box. */ _this.size = new Vector3(1, 1, 1);
33742
33866
  _this.shapeType = ParticleShapeType.Box;
33743
33867
  return _this;
33744
33868
  };
33745
- _inherits$2(BoxShape, BaseShape);
33869
+ _inherits$2(BoxShape, BaseShape1);
33746
33870
  var _proto = BoxShape.prototype;
33747
33871
  /**
33748
33872
  * @internal
@@ -33771,10 +33895,10 @@
33771
33895
  })(exports.ParticleShapeArcMode || (exports.ParticleShapeArcMode = {}));
33772
33896
  /**
33773
33897
  * Particle shape that emits particles from a circle.
33774
- */ var CircleShape = /*#__PURE__*/ function(BaseShape) {
33898
+ */ var CircleShape = /*#__PURE__*/ function(BaseShape1) {
33775
33899
  var CircleShape = function CircleShape() {
33776
33900
  var _this;
33777
- _this = BaseShape.call(this) || this;
33901
+ _this = BaseShape1.call(this) || this;
33778
33902
  /** Radius of the shape to emit particles from. */ _this.radius = 1.0;
33779
33903
  /** Angle of the circle arc to emit particles from. */ _this.arc = 360.0;
33780
33904
  /** The mode to generate particles around the arc. */ _this.arcMode = exports.ParticleShapeArcMode.Random;
@@ -33782,7 +33906,7 @@
33782
33906
  _this.shapeType = ParticleShapeType.Circle;
33783
33907
  return _this;
33784
33908
  };
33785
- _inherits$2(CircleShape, BaseShape);
33909
+ _inherits$2(CircleShape, BaseShape1);
33786
33910
  var _proto = CircleShape.prototype;
33787
33911
  /**
33788
33912
  * @internal
@@ -33811,10 +33935,10 @@
33811
33935
  })();
33812
33936
  /**
33813
33937
  * Cone shape.
33814
- */ var ConeShape = /*#__PURE__*/ function(BaseShape) {
33938
+ */ var ConeShape = /*#__PURE__*/ function(BaseShape1) {
33815
33939
  var ConeShape = function ConeShape() {
33816
33940
  var _this;
33817
- _this = BaseShape.call(this) || this;
33941
+ _this = BaseShape1.call(this) || this;
33818
33942
  /** Angle of the cone to emit particles from. */ _this.angle = 25.0;
33819
33943
  /** Radius of the shape to emit particles from. */ _this.radius = 1.0;
33820
33944
  /** Length of the cone to emit particles from. */ _this.length = 5.0;
@@ -33822,7 +33946,7 @@
33822
33946
  _this.shapeType = ParticleShapeType.Cone;
33823
33947
  return _this;
33824
33948
  };
33825
- _inherits$2(ConeShape, BaseShape);
33949
+ _inherits$2(ConeShape, BaseShape1);
33826
33950
  var _proto = ConeShape.prototype;
33827
33951
  /**
33828
33952
  * @internal
@@ -33875,15 +33999,15 @@
33875
33999
  })(exports.ConeEmitType || (exports.ConeEmitType = {}));
33876
34000
  /**
33877
34001
  * Particle shape that emits particles from a hemisphere.
33878
- */ var HemisphereShape = /*#__PURE__*/ function(BaseShape) {
34002
+ */ var HemisphereShape = /*#__PURE__*/ function(BaseShape1) {
33879
34003
  var HemisphereShape = function HemisphereShape() {
33880
34004
  var _this;
33881
- _this = BaseShape.call(this) || this;
34005
+ _this = BaseShape1.call(this) || this;
33882
34006
  /** Radius of the shape to emit particles from. */ _this.radius = 1.0;
33883
34007
  _this.shapeType = ParticleShapeType.Hemisphere;
33884
34008
  return _this;
33885
34009
  };
33886
- _inherits$2(HemisphereShape, BaseShape);
34010
+ _inherits$2(HemisphereShape, BaseShape1);
33887
34011
  var _proto = HemisphereShape.prototype;
33888
34012
  /**
33889
34013
  * @internal
@@ -33899,15 +34023,15 @@
33899
34023
  }(BaseShape);
33900
34024
  /**
33901
34025
  * Particle shape that emits particles from a sphere.
33902
- */ var SphereShape = /*#__PURE__*/ function(BaseShape) {
34026
+ */ var SphereShape = /*#__PURE__*/ function(BaseShape1) {
33903
34027
  var SphereShape = function SphereShape() {
33904
34028
  var _this;
33905
- _this = BaseShape.call(this) || this;
34029
+ _this = BaseShape1.call(this) || this;
33906
34030
  /** Radius of the shape to emit particles from. */ _this.radius = 1.0;
33907
34031
  _this.shapeType = ParticleShapeType.Sphere;
33908
34032
  return _this;
33909
34033
  };
33910
- _inherits$2(SphereShape, BaseShape);
34034
+ _inherits$2(SphereShape, BaseShape1);
33911
34035
  var _proto = SphereShape.prototype;
33912
34036
  /**
33913
34037
  * @internal
@@ -33922,10 +34046,10 @@
33922
34046
  var FRAG_SHADER = "#define GLSLIFY 1\nvarying vec2 v_uv;uniform sampler2D u_texture;void main(void){gl_FragColor=texture2D(u_texture,v_uv);}"; // eslint-disable-line
33923
34047
  var VERT_SHADER = "#define GLSLIFY 1\nattribute vec3 POSITION;attribute vec2 TEXCOORD_0;varying vec2 v_uv;uniform mat4 camera_ProjMat;uniform mat4 camera_ViewMat;void main(){gl_Position=camera_ProjMat*camera_ViewMat*vec4(POSITION,1.0);v_uv=TEXCOORD_0;}"; // eslint-disable-line
33924
34048
  Shader.create("trail", VERT_SHADER, FRAG_SHADER);
33925
- var TrailMaterial = /*#__PURE__*/ function(Material) {
34049
+ var TrailMaterial = /*#__PURE__*/ function(Material1) {
33926
34050
  var TrailMaterial = function TrailMaterial(engine) {
33927
34051
  var _this;
33928
- _this = Material.call(this, engine, Shader.find("trail")) || this;
34052
+ _this = Material1.call(this, engine, Shader.find("trail")) || this;
33929
34053
  var target = _this.renderState.blendState.targetBlendState;
33930
34054
  target.enabled = true;
33931
34055
  target.sourceColorBlendFactor = target.sourceAlphaBlendFactor = exports.BlendFactor.SourceAlpha;
@@ -33933,16 +34057,16 @@
33933
34057
  _this.renderState.depthState.writeEnabled = false;
33934
34058
  return _this;
33935
34059
  };
33936
- _inherits$2(TrailMaterial, Material);
34060
+ _inherits$2(TrailMaterial, Material1);
33937
34061
  return TrailMaterial;
33938
34062
  }(Material);
33939
34063
  var _tempVector3 = new Vector3();
33940
34064
  /**
33941
34065
  * @deprecated
33942
- */ var TrailRenderer = /*#__PURE__*/ function(MeshRenderer) {
34066
+ */ var TrailRenderer = /*#__PURE__*/ function(MeshRenderer1) {
33943
34067
  var TrailRenderer = function TrailRenderer(entity, props) {
33944
34068
  var _this;
33945
- _this = MeshRenderer.call(this, entity) || this;
34069
+ _this = MeshRenderer1.call(this, entity) || this;
33946
34070
  _this._stroke = props.stroke || 0.2;
33947
34071
  _this._minSeg = props.minSeg || 0.02;
33948
34072
  _this._lifetime = props.lifetime || 1000;
@@ -33963,7 +34087,7 @@
33963
34087
  _this._initGeometry();
33964
34088
  return _this;
33965
34089
  };
33966
- _inherits$2(TrailRenderer, MeshRenderer);
34090
+ _inherits$2(TrailRenderer, MeshRenderer1);
33967
34091
  var _proto = TrailRenderer.prototype;
33968
34092
  /**
33969
34093
  * @internal
@@ -34012,7 +34136,7 @@
34012
34136
  this._updateStrapVertices(context.camera, this._points);
34013
34137
  this._updateStrapCoords();
34014
34138
  this._vertexBuffer.setData(this._vertices);
34015
- MeshRenderer.prototype._render.call(this, context);
34139
+ MeshRenderer1.prototype._render.call(this, context);
34016
34140
  };
34017
34141
  _proto._initGeometry = function _initGeometry() {
34018
34142
  var mesh = new BufferMesh(this._entity.engine);
@@ -34126,10 +34250,10 @@
34126
34250
  * skybox.specularTexture = cubeTexture;
34127
34251
  * }
34128
34252
  * ```
34129
- */ var Probe = /*#__PURE__*/ function(Script) {
34253
+ */ var Probe = /*#__PURE__*/ function(Script1) {
34130
34254
  var Probe = function Probe() {
34131
34255
  var _this;
34132
- _this = Script.apply(this, arguments) || this;
34256
+ _this = Script1.apply(this, arguments) || this;
34133
34257
  /**
34134
34258
  * Probe's layer, render everything by default.
34135
34259
  */ _this.probeLayer = exports.Layer.Everything;
@@ -34147,7 +34271,7 @@
34147
34271
  */ _this._isCube = false;
34148
34272
  return _this;
34149
34273
  };
34150
- _inherits$2(Probe, Script);
34274
+ _inherits$2(Probe, Script1);
34151
34275
  var _proto = Probe.prototype;
34152
34276
  /**
34153
34277
  * Provide hooks for users to exchange Texture.
@@ -34192,10 +34316,10 @@
34192
34316
  var cacheDir = new Vector3();
34193
34317
  /**
34194
34318
  * Cube probe, generate cubeTexture, used for dynamic environment reflection and other effects.
34195
- */ var CubeProbe = /*#__PURE__*/ function(Probe) {
34319
+ */ var CubeProbe = /*#__PURE__*/ function(Probe1) {
34196
34320
  var CubeProbe = function CubeProbe() {
34197
34321
  var _this;
34198
- _this = Probe.apply(this, arguments) || this;
34322
+ _this = Probe1.apply(this, arguments) || this;
34199
34323
  /**
34200
34324
  * The position of the probe can be set, the default is the origin [0,0,0].
34201
34325
  */ _this.position = new Vector3(0, 0, 0);
@@ -34203,11 +34327,11 @@
34203
34327
  _this.oriViewMatrix = new Matrix();
34204
34328
  return _this;
34205
34329
  };
34206
- _inherits$2(CubeProbe, Probe);
34330
+ _inherits$2(CubeProbe, Probe1);
34207
34331
  var _proto = CubeProbe.prototype;
34208
34332
  _proto.onBeginRender = function onBeginRender(camera) {
34209
34333
  if (!this.enabled) return;
34210
- Probe.prototype.onBeginRender.call(this, camera);
34334
+ Probe1.prototype.onBeginRender.call(this, camera);
34211
34335
  this._storeCamera(camera);
34212
34336
  // Render 6 faces
34213
34337
  for(var faceIndex = 0; faceIndex < 6; faceIndex++){
@@ -34216,7 +34340,7 @@
34216
34340
  camera.render(exports.TextureCubeFace.PositiveX + faceIndex);
34217
34341
  }
34218
34342
  this._restoreCamera(camera);
34219
- Probe.prototype._reset.call(this);
34343
+ Probe1.prototype._reset.call(this);
34220
34344
  };
34221
34345
  /**
34222
34346
  * Store original camera parameters.
@@ -34680,11 +34804,11 @@
34680
34804
  }
34681
34805
  /**
34682
34806
  * WebGL platform engine,support includes WebGL1.0 and WebGL2.0.
34683
- */ var WebGLEngine = /*#__PURE__*/ function(Engine) {
34807
+ */ var WebGLEngine = /*#__PURE__*/ function(Engine1) {
34684
34808
  var WebGLEngine = function WebGLEngine() {
34685
- return Engine.apply(this, arguments);
34809
+ return Engine1.apply(this, arguments);
34686
34810
  };
34687
- _inherits$1(WebGLEngine, Engine);
34811
+ _inherits$1(WebGLEngine, Engine1);
34688
34812
  /**
34689
34813
  * Create a WebGL engine.
34690
34814
  * @param configuration - WebGL engine configuration
@@ -34874,10 +34998,11 @@
34874
34998
  var ext = null;
34875
34999
  if (ext = rhi.requireExtension(capabilityType)) {
34876
35000
  for(var glKey in flatItem){
35001
+ var _extensionVal;
34877
35002
  var extensionKey = flatItem[glKey];
34878
35003
  var extensionVal = ext[extensionKey];
34879
35004
  // Mini game hack the native function,use “.bind” to smooth out if is “Funcion”.
34880
- if (extensionVal == null ? void 0 : extensionVal.bind) {
35005
+ if ((_extensionVal = extensionVal) == null ? void 0 : _extensionVal.bind) {
34881
35006
  gl[glKey] = extensionVal.bind(ext);
34882
35007
  } else {
34883
35008
  gl[glKey] = extensionVal;
@@ -36772,19 +36897,19 @@
36772
36897
  });
36773
36898
  if (superClass) _set_prototype_of(subClass, superClass);
36774
36899
  }
36775
- /******************************************************************************
36776
- Copyright (c) Microsoft Corporation.
36777
-
36778
- Permission to use, copy, modify, and/or distribute this software for any
36779
- purpose with or without fee is hereby granted.
36780
-
36781
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
36782
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36783
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
36784
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
36785
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
36786
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
36787
- PERFORMANCE OF THIS SOFTWARE.
36900
+ /******************************************************************************
36901
+ Copyright (c) Microsoft Corporation.
36902
+
36903
+ Permission to use, copy, modify, and/or distribute this software for any
36904
+ purpose with or without fee is hereby granted.
36905
+
36906
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
36907
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36908
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
36909
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
36910
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
36911
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
36912
+ PERFORMANCE OF THIS SOFTWARE.
36788
36913
  ***************************************************************************** */ function __decorate(decorators, target, key, desc) {
36789
36914
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
36790
36915
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -36886,6 +37011,10 @@
36886
37011
  return this;
36887
37012
  }), g;
36888
37013
  }
37014
+ typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
37015
+ var e = new Error(message);
37016
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
37017
+ };
36889
37018
  function _defineProperties(target, props) {
36890
37019
  for(var i = 0; i < props.length; i++){
36891
37020
  var descriptor = props[i];
@@ -37404,7 +37533,7 @@
37404
37533
  return _this.parseBasicType(param, engine, resourceManager);
37405
37534
  })).then(function(result) {
37406
37535
  var _instance;
37407
- return (_instance = instance)[methodName].apply(_instance, result);
37536
+ return (_instance = instance)[methodName].apply(_instance, [].concat(result));
37408
37537
  });
37409
37538
  };
37410
37539
  ReflectionParser._isClass = function _isClass(value) {
@@ -37769,11 +37898,11 @@
37769
37898
  };
37770
37899
  return SceneParser;
37771
37900
  }();
37772
- exports.MeshLoader = /*#__PURE__*/ function(Loader) {
37901
+ exports.MeshLoader = /*#__PURE__*/ function(Loader1) {
37773
37902
  var MeshLoader = function MeshLoader() {
37774
- return Loader.apply(this, arguments);
37903
+ return Loader1.apply(this, arguments);
37775
37904
  };
37776
- _inherits(MeshLoader, Loader);
37905
+ _inherits(MeshLoader, Loader1);
37777
37906
  var _proto = MeshLoader.prototype;
37778
37907
  _proto.load = function load(item, resourceManager) {
37779
37908
  var _this = this;
@@ -37794,11 +37923,11 @@
37794
37923
  "prefab"
37795
37924
  ], true)
37796
37925
  ], exports.MeshLoader);
37797
- exports.EditorTextureLoader = /*#__PURE__*/ function(Loader) {
37926
+ exports.EditorTextureLoader = /*#__PURE__*/ function(Loader1) {
37798
37927
  var EditorTextureLoader = function EditorTextureLoader() {
37799
- return Loader.apply(this, arguments);
37928
+ return Loader1.apply(this, arguments);
37800
37929
  };
37801
- _inherits(EditorTextureLoader, Loader);
37930
+ _inherits(EditorTextureLoader, Loader1);
37802
37931
  var _proto = EditorTextureLoader.prototype;
37803
37932
  _proto.load = function load(item, resourceManager) {
37804
37933
  var _this = this;
@@ -37832,11 +37961,11 @@
37832
37961
  return object;
37833
37962
  });
37834
37963
  }
37835
- var AnimationClipLoader = /*#__PURE__*/ function(Loader) {
37964
+ var AnimationClipLoader = /*#__PURE__*/ function(Loader1) {
37836
37965
  var AnimationClipLoader = function AnimationClipLoader() {
37837
- return Loader.apply(this, arguments);
37966
+ return Loader1.apply(this, arguments);
37838
37967
  };
37839
- _inherits(AnimationClipLoader, Loader);
37968
+ _inherits(AnimationClipLoader, Loader1);
37840
37969
  var _proto = AnimationClipLoader.prototype;
37841
37970
  _proto.load = function load(item, resourceManager) {
37842
37971
  var _this = this;
@@ -37899,6 +38028,7 @@
37899
38028
  var states = stateMachineData.states;
37900
38029
  var stateMachine = layer.stateMachine = new AnimatorStateMachine();
37901
38030
  states.forEach(function(stateData, stateIndex) {
38031
+ var _scriptsObject;
37902
38032
  var name = stateData.name, speed = stateData.speed, wrapMode = stateData.wrapMode, clipStartNormalizedTime = stateData.clipStartNormalizedTime, clipEndNormalizedTime = stateData.clipEndNormalizedTime, isDefaultState = stateData.isDefaultState, clipData = stateData.clip, scripts = stateData.scripts;
37903
38033
  var state = stateMachine.addState(name);
37904
38034
  isDefaultState && (stateMachine.defaultState = state);
@@ -37907,7 +38037,7 @@
37907
38037
  state.clipStartTime = clipStartNormalizedTime;
37908
38038
  state.clipEndTime = clipEndNormalizedTime;
37909
38039
  var scriptsObject = JSON.parse(scripts);
37910
- scriptsObject == null ? void 0 : scriptsObject.forEach(function(script) {
38040
+ (_scriptsObject = scriptsObject) == null ? void 0 : _scriptsObject.forEach(function(script) {
37911
38041
  state.addStateMachineScript(Loader.getClass(script));
37912
38042
  });
37913
38043
  if (clipData) {
@@ -37960,11 +38090,11 @@
37960
38090
  function isBase64(url) {
37961
38091
  return /^data:(.+?);base64,/.test(url);
37962
38092
  }
37963
- var BufferLoader = /*#__PURE__*/ function(Loader) {
38093
+ var BufferLoader = /*#__PURE__*/ function(Loader1) {
37964
38094
  var BufferLoader = function BufferLoader() {
37965
- return Loader.apply(this, arguments);
38095
+ return Loader1.apply(this, arguments);
37966
38096
  };
37967
- _inherits(BufferLoader, Loader);
38097
+ _inherits(BufferLoader, Loader1);
37968
38098
  var _proto = BufferLoader.prototype;
37969
38099
  _proto.load = function load(item) {
37970
38100
  var url = item.url;
@@ -37989,11 +38119,11 @@
37989
38119
  "r3bin"
37990
38120
  ], false)
37991
38121
  ], BufferLoader);
37992
- var EnvLoader = /*#__PURE__*/ function(Loader) {
38122
+ var EnvLoader = /*#__PURE__*/ function(Loader1) {
37993
38123
  var EnvLoader = function EnvLoader() {
37994
- return Loader.apply(this, arguments);
38124
+ return Loader1.apply(this, arguments);
37995
38125
  };
37996
- _inherits(EnvLoader, Loader);
38126
+ _inherits(EnvLoader, Loader1);
37997
38127
  var _proto = EnvLoader.prototype;
37998
38128
  _proto.load = function load(item, resourceManager) {
37999
38129
  var _this = this;
@@ -38001,10 +38131,10 @@
38001
38131
  _this.request(item.url, {
38002
38132
  type: "arraybuffer"
38003
38133
  }).then(function(arraybuffer) {
38004
- var _ref;
38134
+ var _this;
38005
38135
  var shArray = new Float32Array(arraybuffer, 0, 27);
38006
38136
  var shByteLength = 27 * 4;
38007
- var size = (_ref = new Uint16Array(arraybuffer, shByteLength, 1)) == null ? void 0 : _ref[0];
38137
+ var size = (_this = new Uint16Array(arraybuffer, shByteLength, 1)) == null ? void 0 : _this[0];
38008
38138
  var engine = resourceManager.engine;
38009
38139
  var texture = new TextureCube(engine, size);
38010
38140
  texture.filterMode = exports.TextureFilterMode.Trilinear;
@@ -38065,11 +38195,11 @@
38065
38195
  });
38066
38196
  };
38067
38197
  }
38068
- var FontLoader = /*#__PURE__*/ function(Loader) {
38198
+ var FontLoader = /*#__PURE__*/ function(Loader1) {
38069
38199
  var FontLoader = function FontLoader() {
38070
- return Loader.apply(this, arguments);
38200
+ return Loader1.apply(this, arguments);
38071
38201
  };
38072
- _inherits(FontLoader, Loader);
38202
+ _inherits(FontLoader, Loader1);
38073
38203
  var _proto = FontLoader.prototype;
38074
38204
  _proto.load = function load(item, resourceManager) {
38075
38205
  var _this = this;
@@ -38124,14 +38254,14 @@
38124
38254
  ], FontLoader);
38125
38255
  /**
38126
38256
  * Product after glTF parser, usually, `defaultSceneRoot` is only needed to use.
38127
- */ var GLTFResource = /*#__PURE__*/ function(ReferResource) {
38257
+ */ var GLTFResource = /*#__PURE__*/ function(ReferResource1) {
38128
38258
  var GLTFResource = function GLTFResource(engine, url) {
38129
38259
  var _this;
38130
- _this = ReferResource.call(this, engine) || this;
38260
+ _this = ReferResource1.call(this, engine) || this;
38131
38261
  _this.url = url;
38132
38262
  return _this;
38133
38263
  };
38134
- _inherits(GLTFResource, ReferResource);
38264
+ _inherits(GLTFResource, ReferResource1);
38135
38265
  return GLTFResource;
38136
38266
  }(ReferResource);
38137
38267
  /**
@@ -39322,11 +39452,11 @@
39322
39452
  }
39323
39453
  };
39324
39454
  }
39325
- /** @internal */ var BinomialLLCTranscoder = /*#__PURE__*/ function(AbstractTranscoder) {
39455
+ /** @internal */ var BinomialLLCTranscoder = /*#__PURE__*/ function(AbstractTranscoder1) {
39326
39456
  var BinomialLLCTranscoder = function BinomialLLCTranscoder(workerLimitCount) {
39327
- return AbstractTranscoder.call(this, workerLimitCount);
39457
+ return AbstractTranscoder1.call(this, workerLimitCount);
39328
39458
  };
39329
- _inherits(BinomialLLCTranscoder, AbstractTranscoder);
39459
+ _inherits(BinomialLLCTranscoder, AbstractTranscoder1);
39330
39460
  var _proto = BinomialLLCTranscoder.prototype;
39331
39461
  _proto._initTranscodeWorkerPool = function _initTranscodeWorkerPool() {
39332
39462
  var _this = this;
@@ -39500,14 +39630,14 @@
39500
39630
  }
39501
39631
  };
39502
39632
  }
39503
- /** @internal */ var KhronosTranscoder = /*#__PURE__*/ function(AbstractTranscoder) {
39633
+ /** @internal */ var KhronosTranscoder = /*#__PURE__*/ function(AbstractTranscoder1) {
39504
39634
  var KhronosTranscoder = function KhronosTranscoder(workerLimitCount, type) {
39505
39635
  var _this;
39506
- _this = AbstractTranscoder.call(this, workerLimitCount) || this;
39636
+ _this = AbstractTranscoder1.call(this, workerLimitCount) || this;
39507
39637
  _this.type = type;
39508
39638
  return _this;
39509
39639
  };
39510
- _inherits(KhronosTranscoder, AbstractTranscoder);
39640
+ _inherits(KhronosTranscoder, AbstractTranscoder1);
39511
39641
  var _proto = KhronosTranscoder.prototype;
39512
39642
  _proto._initTranscodeWorkerPool = function _initTranscodeWorkerPool() {
39513
39643
  var _this = this;
@@ -39570,11 +39700,11 @@
39570
39700
  KhronosTranscoder.transcoderMap = (_obj = {}, _obj[exports.KTX2TargetFormat.ASTC] = "https://mdn.alipayobjects.com/rms/afts/file/A*0jiKRK6D1-kAAAAAAAAAAAAAARQnAQ/uastc_astc.wasm", _obj);
39571
39701
  })();
39572
39702
  var _KTX2Loader;
39573
- exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader) {
39703
+ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
39574
39704
  var KTX2Loader1 = function KTX2Loader1() {
39575
- return Loader.apply(this, arguments);
39705
+ return Loader1.apply(this, arguments);
39576
39706
  };
39577
- _inherits(KTX2Loader1, Loader);
39707
+ _inherits(KTX2Loader1, Loader1);
39578
39708
  var _proto = KTX2Loader1.prototype;
39579
39709
  _proto.initialize = function initialize(engine, configuration) {
39580
39710
  if (configuration.ktx2Loader) {
@@ -39629,8 +39759,9 @@
39629
39759
  this._isBinomialInit = false;
39630
39760
  };
39631
39761
  /** @internal */ KTX2Loader1._parseBuffer = function _parseBuffer(buffer, engine, params) {
39762
+ var _params;
39632
39763
  var ktx2Container = new KTX2Container(buffer);
39633
- var formatPriorities = params == null ? void 0 : params.priorityFormats;
39764
+ var formatPriorities = (_params = params) == null ? void 0 : _params.priorityFormats;
39634
39765
  var targetFormat = exports.KTX2Loader._decideTargetFormat(engine, ktx2Container, formatPriorities);
39635
39766
  var transcodeResultPromise;
39636
39767
  if (exports.KTX2Loader._isBinomialInit || !KhronosTranscoder.transcoderMap[targetFormat] || !ktx2Container.isUASTC) {
@@ -39767,17 +39898,17 @@
39767
39898
  ], exports.KTX2Loader);
39768
39899
  /**
39769
39900
  * @internal
39770
- */ var GLTFContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
39901
+ */ var GLTFContentRestorer = /*#__PURE__*/ function(ContentRestorer1) {
39771
39902
  var GLTFContentRestorer = function GLTFContentRestorer() {
39772
39903
  var _this;
39773
- _this = ContentRestorer.apply(this, arguments) || this;
39904
+ _this = ContentRestorer1.apply(this, arguments) || this;
39774
39905
  _this.bufferRequests = [];
39775
39906
  _this.glbBufferSlices = [];
39776
39907
  _this.bufferTextures = [];
39777
39908
  _this.meshes = [];
39778
39909
  return _this;
39779
39910
  };
39780
- _inherits(GLTFContentRestorer, ContentRestorer);
39911
+ _inherits(GLTFContentRestorer, ContentRestorer1);
39781
39912
  var _proto = GLTFContentRestorer.prototype;
39782
39913
  _proto.restoreContent = function restoreContent() {
39783
39914
  var _this = this;
@@ -39938,20 +40069,6 @@
39938
40069
  this.byteOffset = byteOffset;
39939
40070
  this.count = count;
39940
40071
  };
39941
- function _array_without_holes(arr) {
39942
- if (Array.isArray(arr)) return _array_like_to_array(arr);
39943
- }
39944
- function _iterable_to_array(iter) {
39945
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
39946
- return Array.from(iter);
39947
- }
39948
- }
39949
- function _non_iterable_spread() {
39950
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
39951
- }
39952
- function _to_consumable_array(arr) {
39953
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
39954
- }
39955
40072
  /**
39956
40073
  * Base class of glTF extension parser.
39957
40074
  */ var GLTFExtensionParser = /*#__PURE__*/ function() {
@@ -40017,12 +40134,7 @@
40017
40134
  var _GLTFParser;
40018
40135
  var extensionName = extensionArray[i];
40019
40136
  var extensionSchema = extensions[extensionName];
40020
- resource = (_GLTFParser = GLTFParser)._createAndParse.apply(_GLTFParser, [
40021
- extensionName,
40022
- context,
40023
- extensionSchema,
40024
- ownerSchema
40025
- ].concat(_to_consumable_array(extra)));
40137
+ resource = (_GLTFParser = GLTFParser)._createAndParse.apply(_GLTFParser, [].concat(extensionName, context, extensionSchema, ownerSchema, extra));
40026
40138
  if (resource) {
40027
40139
  return resource;
40028
40140
  }
@@ -40042,13 +40154,7 @@
40042
40154
  for(var extensionName in extensions){
40043
40155
  var _GLTFParser;
40044
40156
  var extensionSchema = extensions[extensionName];
40045
- (_GLTFParser = GLTFParser)._additiveParse.apply(_GLTFParser, [
40046
- extensionName,
40047
- context,
40048
- parseResource,
40049
- extensionSchema,
40050
- ownerSchema
40051
- ].concat(_to_consumable_array(extra)));
40157
+ (_GLTFParser = GLTFParser)._additiveParse.apply(_GLTFParser, [].concat(extensionName, context, parseResource, extensionSchema, ownerSchema, extra));
40052
40158
  }
40053
40159
  };
40054
40160
  /**
@@ -40065,8 +40171,9 @@
40065
40171
  * @param mode - GLTF extension mode
40066
40172
  * @returns GLTF extension parser
40067
40173
  */ GLTFParser.getExtensionParser = function getExtensionParser(extensionName, mode) {
40174
+ var _parsers;
40068
40175
  var parsers = GLTFParser._extensionParsers[extensionName];
40069
- var length = parsers == null ? void 0 : parsers.length;
40176
+ var length = (_parsers = parsers) == null ? void 0 : _parsers.length;
40070
40177
  if (length) {
40071
40178
  // only use the last parser.
40072
40179
  for(var i = length - 1; i >= 0; --i){
@@ -40092,11 +40199,7 @@
40092
40199
  var parser = GLTFParser.getExtensionParser(extensionName, exports.GLTFExtensionMode.CreateAndParse);
40093
40200
  if (parser) {
40094
40201
  var _parser;
40095
- return (_parser = parser).createAndParse.apply(_parser, [
40096
- context,
40097
- extensionSchema,
40098
- ownerSchema
40099
- ].concat(_to_consumable_array(extra)));
40202
+ return (_parser = parser).createAndParse.apply(_parser, [].concat(context, extensionSchema, ownerSchema, extra));
40100
40203
  }
40101
40204
  };
40102
40205
  GLTFParser._additiveParse = function _additiveParse(extensionName, context, parseResource, extensionSchema, ownerSchema) {
@@ -40106,12 +40209,7 @@
40106
40209
  var parser = GLTFParser.getExtensionParser(extensionName, exports.GLTFExtensionMode.AdditiveParse);
40107
40210
  if (parser) {
40108
40211
  var _parser;
40109
- (_parser = parser).additiveParse.apply(_parser, [
40110
- context,
40111
- parseResource,
40112
- extensionSchema,
40113
- ownerSchema
40114
- ].concat(_to_consumable_array(extra)));
40212
+ (_parser = parser).additiveParse.apply(_parser, [].concat(context, parseResource, extensionSchema, ownerSchema, extra));
40115
40213
  }
40116
40214
  };
40117
40215
  return GLTFParser;
@@ -40129,11 +40227,11 @@
40129
40227
  GLTFParser._addExtensionParser(extensionName, extensionParser);
40130
40228
  };
40131
40229
  }
40132
- exports.GLTFSchemaParser = /*#__PURE__*/ function(GLTFParser) {
40230
+ exports.GLTFSchemaParser = /*#__PURE__*/ function(GLTFParser1) {
40133
40231
  var GLTFSchemaParser = function GLTFSchemaParser() {
40134
- return GLTFParser.apply(this, arguments);
40232
+ return GLTFParser1.apply(this, arguments);
40135
40233
  };
40136
- _inherits(GLTFSchemaParser, GLTFParser);
40234
+ _inherits(GLTFSchemaParser, GLTFParser1);
40137
40235
  var _proto = GLTFSchemaParser.prototype;
40138
40236
  _proto.parse = function parse(context) {
40139
40237
  var glTFResource = context.glTFResource, contentRestorer = context.contentRestorer;
@@ -40346,11 +40444,11 @@
40346
40444
  exports.GLTFAnimationParser = __decorate([
40347
40445
  registerGLTFParser(exports.GLTFParserType.Animation)
40348
40446
  ], exports.GLTFAnimationParser);
40349
- exports.GLTFBufferParser = /*#__PURE__*/ function(GLTFParser) {
40447
+ exports.GLTFBufferParser = /*#__PURE__*/ function(GLTFParser1) {
40350
40448
  var GLTFBufferParser = function GLTFBufferParser() {
40351
- return GLTFParser.apply(this, arguments);
40449
+ return GLTFParser1.apply(this, arguments);
40352
40450
  };
40353
- _inherits(GLTFBufferParser, GLTFParser);
40451
+ _inherits(GLTFBufferParser, GLTFParser1);
40354
40452
  var _proto = GLTFBufferParser.prototype;
40355
40453
  _proto.parse = function parse(context, index) {
40356
40454
  var buffers = context.glTF.buffers;
@@ -40965,11 +41063,11 @@
40965
41063
  exports.GLTFSceneParser = __decorate([
40966
41064
  registerGLTFParser(exports.GLTFParserType.Scene)
40967
41065
  ], exports.GLTFSceneParser);
40968
- exports.GLTFSkinParser = /*#__PURE__*/ function(GLTFParser) {
41066
+ exports.GLTFSkinParser = /*#__PURE__*/ function(GLTFParser1) {
40969
41067
  var GLTFSkinParser = function GLTFSkinParser() {
40970
- return GLTFParser.apply(this, arguments);
41068
+ return GLTFParser1.apply(this, arguments);
40971
41069
  };
40972
- _inherits(GLTFSkinParser, GLTFParser);
41070
+ _inherits(GLTFSkinParser, GLTFParser1);
40973
41071
  var _proto = GLTFSkinParser.prototype;
40974
41072
  _proto.parse = function parse(context, index) {
40975
41073
  var _this = this;
@@ -41063,6 +41161,7 @@
41063
41161
  var useSampler = sampler !== undefined;
41064
41162
  var samplerInfo = sampler !== undefined && GLTFUtils.getSamplerInfo(glTF.samplers[sampler]);
41065
41163
  if (uri) {
41164
+ var _samplerInfo;
41066
41165
  // TODO: deleted in 2.0
41067
41166
  var extIndex = uri.lastIndexOf(".");
41068
41167
  var ext = uri.substring(extIndex + 1);
@@ -41071,7 +41170,7 @@
41071
41170
  url: Utils.resolveAbsoluteUrl(url, uri),
41072
41171
  type: type,
41073
41172
  params: {
41074
- mipmap: samplerInfo == null ? void 0 : samplerInfo.mipmap
41173
+ mipmap: (_samplerInfo = samplerInfo) == null ? void 0 : _samplerInfo.mipmap
41075
41174
  }
41076
41175
  }).then(function(texture) {
41077
41176
  var _texture;
@@ -41085,7 +41184,8 @@
41085
41184
  var buffer = buffers[bufferView.buffer];
41086
41185
  var imageBuffer = new Uint8Array(buffer, bufferView.byteOffset, bufferView.byteLength);
41087
41186
  return GLTFUtils.loadImageBuffer(imageBuffer, mimeType).then(function(image) {
41088
- var texture = new Texture2D(engine, image.width, image.height, undefined, samplerInfo == null ? void 0 : samplerInfo.mipmap);
41187
+ var _samplerInfo;
41188
+ var texture = new Texture2D(engine, image.width, image.height, undefined, (_samplerInfo = samplerInfo) == null ? void 0 : _samplerInfo.mipmap);
41089
41189
  texture.setImageSource(image);
41090
41190
  texture.generateMipmaps();
41091
41191
  texture.name = textureName || imageName || "texture_" + index;
@@ -41147,17 +41247,18 @@
41147
41247
  exports.GLTFValidator = __decorate([
41148
41248
  registerGLTFParser(exports.GLTFParserType.Validator)
41149
41249
  ], exports.GLTFValidator);
41150
- var GLTFLoader = /*#__PURE__*/ function(Loader) {
41250
+ var GLTFLoader = /*#__PURE__*/ function(Loader1) {
41151
41251
  var GLTFLoader = function GLTFLoader() {
41152
- return Loader.apply(this, arguments);
41252
+ return Loader1.apply(this, arguments);
41153
41253
  };
41154
- _inherits(GLTFLoader, Loader);
41254
+ _inherits(GLTFLoader, Loader1);
41155
41255
  var _proto = GLTFLoader.prototype;
41156
41256
  _proto.load = function load(item, resourceManager) {
41257
+ var _params;
41157
41258
  var url = item.url;
41158
41259
  var params = item.params;
41159
41260
  var glTFResource = new GLTFResource(resourceManager.engine, url);
41160
- var context = new GLTFParserContext(glTFResource, resourceManager, !!(params == null ? void 0 : params.keepMeshData));
41261
+ var context = new GLTFParserContext(glTFResource, resourceManager, !!((_params = params) == null ? void 0 : _params.keepMeshData));
41161
41262
  return context.parse();
41162
41263
  };
41163
41264
  return GLTFLoader;
@@ -41170,11 +41271,11 @@
41170
41271
  ], GLTFLoader);
41171
41272
  var _HDRLoader;
41172
41273
  var PI = Math.PI;
41173
- var HDRLoader = (_HDRLoader = /*#__PURE__*/ function(Loader) {
41274
+ var HDRLoader = (_HDRLoader = /*#__PURE__*/ function(Loader1) {
41174
41275
  var HDRLoader1 = function HDRLoader1() {
41175
- return Loader.apply(this, arguments);
41276
+ return Loader1.apply(this, arguments);
41176
41277
  };
41177
- _inherits(HDRLoader1, Loader);
41278
+ _inherits(HDRLoader1, Loader1);
41178
41279
  var _proto = HDRLoader1.prototype;
41179
41280
  _proto.load = function load(item, resourceManager) {
41180
41281
  var _this = this;
@@ -41483,11 +41584,11 @@
41483
41584
  "hdr"
41484
41585
  ])
41485
41586
  ], HDRLoader);
41486
- var JSONLoader = /*#__PURE__*/ function(Loader) {
41587
+ var JSONLoader = /*#__PURE__*/ function(Loader1) {
41487
41588
  var JSONLoader = function JSONLoader() {
41488
- return Loader.apply(this, arguments);
41589
+ return Loader1.apply(this, arguments);
41489
41590
  };
41490
- _inherits(JSONLoader, Loader);
41591
+ _inherits(JSONLoader, Loader1);
41491
41592
  var _proto = JSONLoader.prototype;
41492
41593
  _proto.load = function load(item) {
41493
41594
  return this.request(item.url, _extends({}, item, {
@@ -41684,11 +41785,11 @@
41684
41785
  height: height
41685
41786
  };
41686
41787
  }
41687
- var KTXCubeLoader = /*#__PURE__*/ function(Loader) {
41788
+ var KTXCubeLoader = /*#__PURE__*/ function(Loader1) {
41688
41789
  var KTXCubeLoader = function KTXCubeLoader() {
41689
- return Loader.apply(this, arguments);
41790
+ return Loader1.apply(this, arguments);
41690
41791
  };
41691
- _inherits(KTXCubeLoader, Loader);
41792
+ _inherits(KTXCubeLoader, Loader1);
41692
41793
  var _proto = KTXCubeLoader.prototype;
41693
41794
  _proto.load = function load(item, resourceManager) {
41694
41795
  var _this = this;
@@ -41720,11 +41821,11 @@
41720
41821
  KTXCubeLoader = __decorate([
41721
41822
  resourceLoader(exports.AssetType.KTXCube, [])
41722
41823
  ], KTXCubeLoader);
41723
- var KTXLoader = /*#__PURE__*/ function(Loader) {
41824
+ var KTXLoader = /*#__PURE__*/ function(Loader1) {
41724
41825
  var KTXLoader = function KTXLoader() {
41725
- return Loader.apply(this, arguments);
41826
+ return Loader1.apply(this, arguments);
41726
41827
  };
41727
- _inherits(KTXLoader, Loader);
41828
+ _inherits(KTXLoader, Loader1);
41728
41829
  var _proto = KTXLoader.prototype;
41729
41830
  _proto.load = function load(item, resourceManager) {
41730
41831
  var _this = this;
@@ -41762,11 +41863,11 @@
41762
41863
  object[key] = value;
41763
41864
  }
41764
41865
  }
41765
- var MaterialLoader = /*#__PURE__*/ function(Loader) {
41866
+ var MaterialLoader = /*#__PURE__*/ function(Loader1) {
41766
41867
  var MaterialLoader = function MaterialLoader() {
41767
- return Loader.apply(this, arguments);
41868
+ return Loader1.apply(this, arguments);
41768
41869
  };
41769
- _inherits(MaterialLoader, Loader);
41870
+ _inherits(MaterialLoader, Loader1);
41770
41871
  var _proto = MaterialLoader.prototype;
41771
41872
  _proto.load = function load(item, resourceManager) {
41772
41873
  var _this = this;
@@ -41828,11 +41929,11 @@
41828
41929
  "json"
41829
41930
  ])
41830
41931
  ], MaterialLoader);
41831
- var MeshLoader = /*#__PURE__*/ function(Loader) {
41932
+ var MeshLoader = /*#__PURE__*/ function(Loader1) {
41832
41933
  var MeshLoader = function MeshLoader() {
41833
- return Loader.apply(this, arguments);
41934
+ return Loader1.apply(this, arguments);
41834
41935
  };
41835
- _inherits(MeshLoader, Loader);
41936
+ _inherits(MeshLoader, Loader1);
41836
41937
  var _proto = MeshLoader.prototype;
41837
41938
  _proto.load = function load(item, resourceManager) {
41838
41939
  var _this = this;
@@ -41853,11 +41954,11 @@
41853
41954
  "mesh"
41854
41955
  ])
41855
41956
  ], MeshLoader);
41856
- var SourceFontLoader = /*#__PURE__*/ function(Loader) {
41957
+ var SourceFontLoader = /*#__PURE__*/ function(Loader1) {
41857
41958
  var SourceFontLoader = function SourceFontLoader() {
41858
- return Loader.apply(this, arguments);
41959
+ return Loader1.apply(this, arguments);
41859
41960
  };
41860
- _inherits(SourceFontLoader, Loader);
41961
+ _inherits(SourceFontLoader, Loader1);
41861
41962
  var _proto = SourceFontLoader.prototype;
41862
41963
  _proto.load = function load(item, resourceManager) {
41863
41964
  var _this = this;
@@ -41901,16 +42002,16 @@
41901
42002
  "woff"
41902
42003
  ], false)
41903
42004
  ], SourceFontLoader);
41904
- var SpriteAtlasLoader = /*#__PURE__*/ function(Loader) {
42005
+ var SpriteAtlasLoader = /*#__PURE__*/ function(Loader1) {
41905
42006
  var SpriteAtlasLoader = function SpriteAtlasLoader() {
41906
42007
  var _this;
41907
- _this = Loader.apply(this, arguments) || this;
42008
+ _this = Loader1.apply(this, arguments) || this;
41908
42009
  _this._tempRect = new Rect();
41909
42010
  _this._tempVec2 = new Vector2();
41910
42011
  _this._tempVec4 = new Vector4();
41911
42012
  return _this;
41912
42013
  };
41913
- _inherits(SpriteAtlasLoader, Loader);
42014
+ _inherits(SpriteAtlasLoader, Loader1);
41914
42015
  var _proto = SpriteAtlasLoader.prototype;
41915
42016
  _proto.load = function load(item, resourceManager) {
41916
42017
  var _this = this;
@@ -41992,11 +42093,11 @@
41992
42093
  "atlas"
41993
42094
  ], false)
41994
42095
  ], SpriteAtlasLoader);
41995
- var SpriteLoader = /*#__PURE__*/ function(Loader) {
42096
+ var SpriteLoader = /*#__PURE__*/ function(Loader1) {
41996
42097
  var SpriteLoader = function SpriteLoader() {
41997
- return Loader.apply(this, arguments);
42098
+ return Loader1.apply(this, arguments);
41998
42099
  };
41999
- _inherits(SpriteLoader, Loader);
42100
+ _inherits(SpriteLoader, Loader1);
42000
42101
  var _proto = SpriteLoader.prototype;
42001
42102
  _proto.load = function load(item, resourceManager) {
42002
42103
  var _this = this;
@@ -42029,15 +42130,15 @@
42029
42130
  ], SpriteLoader);
42030
42131
  /**
42031
42132
  * @internal
42032
- */ var Texture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
42133
+ */ var Texture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer1) {
42033
42134
  var Texture2DContentRestorer = function Texture2DContentRestorer(resource, url, requestConfig) {
42034
42135
  var _this;
42035
- _this = ContentRestorer.call(this, resource) || this;
42136
+ _this = ContentRestorer1.call(this, resource) || this;
42036
42137
  _this.url = url;
42037
42138
  _this.requestConfig = requestConfig;
42038
42139
  return _this;
42039
42140
  };
42040
- _inherits(Texture2DContentRestorer, ContentRestorer);
42141
+ _inherits(Texture2DContentRestorer, ContentRestorer1);
42041
42142
  var _proto = Texture2DContentRestorer.prototype;
42042
42143
  _proto.restoreContent = function restoreContent() {
42043
42144
  var _this = this;
@@ -42050,11 +42151,11 @@
42050
42151
  };
42051
42152
  return Texture2DContentRestorer;
42052
42153
  }(ContentRestorer);
42053
- var Texture2DLoader = /*#__PURE__*/ function(Loader) {
42154
+ var Texture2DLoader = /*#__PURE__*/ function(Loader1) {
42054
42155
  var Texture2DLoader = function Texture2DLoader() {
42055
- return Loader.apply(this, arguments);
42156
+ return Loader1.apply(this, arguments);
42056
42157
  };
42057
- _inherits(Texture2DLoader, Loader);
42158
+ _inherits(Texture2DLoader, Loader1);
42058
42159
  var _proto = Texture2DLoader.prototype;
42059
42160
  _proto.load = function load(item, resourceManager) {
42060
42161
  var _this = this;
@@ -42064,8 +42165,9 @@
42064
42165
  type: "image"
42065
42166
  });
42066
42167
  _this.request(url, requestConfig).then(function(image) {
42168
+ var _params, _params1;
42067
42169
  var params = item.params;
42068
- var texture = new Texture2D(resourceManager.engine, image.width, image.height, params == null ? void 0 : params.format, params == null ? void 0 : params.mipmap);
42170
+ var texture = new Texture2D(resourceManager.engine, image.width, image.height, (_params = params) == null ? void 0 : _params.format, (_params1 = params) == null ? void 0 : _params1.mipmap);
42069
42171
  texture.setImageSource(image);
42070
42172
  texture.generateMipmaps();
42071
42173
  if (url.indexOf("data:") !== 0) {
@@ -42091,15 +42193,15 @@
42091
42193
  ], Texture2DLoader);
42092
42194
  /**
42093
42195
  * @internal
42094
- */ var TextureCubeContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
42196
+ */ var TextureCubeContentRestorer = /*#__PURE__*/ function(ContentRestorer1) {
42095
42197
  var TextureCubeContentRestorer = function TextureCubeContentRestorer(resource, urls, requestConfig) {
42096
42198
  var _this;
42097
- _this = ContentRestorer.call(this, resource) || this;
42199
+ _this = ContentRestorer1.call(this, resource) || this;
42098
42200
  _this.urls = urls;
42099
42201
  _this.requestConfig = requestConfig;
42100
42202
  return _this;
42101
42203
  };
42102
- _inherits(TextureCubeContentRestorer, ContentRestorer);
42204
+ _inherits(TextureCubeContentRestorer, ContentRestorer1);
42103
42205
  var _proto = TextureCubeContentRestorer.prototype;
42104
42206
  _proto.restoreContent = function restoreContent() {
42105
42207
  var _this = this;
@@ -42120,11 +42222,11 @@
42120
42222
  };
42121
42223
  return TextureCubeContentRestorer;
42122
42224
  }(ContentRestorer);
42123
- var TextureCubeLoader = /*#__PURE__*/ function(Loader) {
42225
+ var TextureCubeLoader = /*#__PURE__*/ function(Loader1) {
42124
42226
  var TextureCubeLoader = function TextureCubeLoader() {
42125
- return Loader.apply(this, arguments);
42227
+ return Loader1.apply(this, arguments);
42126
42228
  };
42127
- _inherits(TextureCubeLoader, Loader);
42229
+ _inherits(TextureCubeLoader, Loader1);
42128
42230
  var _proto = TextureCubeLoader.prototype;
42129
42231
  _proto.load = function load(item, resourceManager) {
42130
42232
  var _this = this;
@@ -42160,11 +42262,11 @@
42160
42262
  ""
42161
42263
  ])
42162
42264
  ], TextureCubeLoader);
42163
- var SceneLoader = /*#__PURE__*/ function(Loader) {
42265
+ var SceneLoader = /*#__PURE__*/ function(Loader1) {
42164
42266
  var SceneLoader = function SceneLoader() {
42165
- return Loader.apply(this, arguments);
42267
+ return Loader1.apply(this, arguments);
42166
42268
  };
42167
- _inherits(SceneLoader, Loader);
42269
+ _inherits(SceneLoader, Loader1);
42168
42270
  var _proto = SceneLoader.prototype;
42169
42271
  _proto.load = function load(item, resourceManager) {
42170
42272
  var _this = this;
@@ -42257,7 +42359,7 @@
42257
42359
  }(Loader);
42258
42360
  SceneLoader = __decorate([
42259
42361
  resourceLoader(exports.AssetType.Scene, [
42260
- "prefab"
42362
+ "scene"
42261
42363
  ], true)
42262
42364
  ], SceneLoader);
42263
42365
  ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _async_to_generator(function(instance, item, engine) {
@@ -42275,11 +42377,11 @@
42275
42377
  });
42276
42378
  }));
42277
42379
  var _KHR_draco_mesh_compression;
42278
- var KHR_draco_mesh_compression = (_KHR_draco_mesh_compression = /*#__PURE__*/ function(GLTFExtensionParser) {
42380
+ var KHR_draco_mesh_compression = (_KHR_draco_mesh_compression = /*#__PURE__*/ function(GLTFExtensionParser1) {
42279
42381
  var KHR_draco_mesh_compression1 = function KHR_draco_mesh_compression1() {
42280
- return GLTFExtensionParser.apply(this, arguments);
42382
+ return GLTFExtensionParser1.apply(this, arguments);
42281
42383
  };
42282
- _inherits(KHR_draco_mesh_compression1, GLTFExtensionParser);
42384
+ _inherits(KHR_draco_mesh_compression1, GLTFExtensionParser1);
42283
42385
  var _proto = KHR_draco_mesh_compression1.prototype;
42284
42386
  _proto.createAndParse = function createAndParse(context, schema, glTFPrimitive, glTFMesh) {
42285
42387
  var _this = this;
@@ -42437,11 +42539,11 @@
42437
42539
  KHR_draco_mesh_compression = __decorate([
42438
42540
  registerGLTFExtension("KHR_draco_mesh_compression", exports.GLTFExtensionMode.CreateAndParse)
42439
42541
  ], KHR_draco_mesh_compression);
42440
- var KHR_lights_punctual = /*#__PURE__*/ function(GLTFExtensionParser) {
42542
+ var KHR_lights_punctual = /*#__PURE__*/ function(GLTFExtensionParser1) {
42441
42543
  var KHR_lights_punctual = function KHR_lights_punctual() {
42442
- return GLTFExtensionParser.apply(this, arguments);
42544
+ return GLTFExtensionParser1.apply(this, arguments);
42443
42545
  };
42444
- _inherits(KHR_lights_punctual, GLTFExtensionParser);
42546
+ _inherits(KHR_lights_punctual, GLTFExtensionParser1);
42445
42547
  var _proto = KHR_lights_punctual.prototype;
42446
42548
  _proto.additiveParse = function additiveParse(context, entity, extensionSchema) {
42447
42549
  var _glTFResource;
@@ -42477,11 +42579,11 @@
42477
42579
  KHR_lights_punctual = __decorate([
42478
42580
  registerGLTFExtension("KHR_lights_punctual", exports.GLTFExtensionMode.AdditiveParse)
42479
42581
  ], KHR_lights_punctual);
42480
- var KHR_materials_clearcoat = /*#__PURE__*/ function(GLTFExtensionParser) {
42582
+ var KHR_materials_clearcoat = /*#__PURE__*/ function(GLTFExtensionParser1) {
42481
42583
  var KHR_materials_clearcoat = function KHR_materials_clearcoat() {
42482
- return GLTFExtensionParser.apply(this, arguments);
42584
+ return GLTFExtensionParser1.apply(this, arguments);
42483
42585
  };
42484
- _inherits(KHR_materials_clearcoat, GLTFExtensionParser);
42586
+ _inherits(KHR_materials_clearcoat, GLTFExtensionParser1);
42485
42587
  var _proto = KHR_materials_clearcoat.prototype;
42486
42588
  _proto.additiveParse = function additiveParse(context, material, schema) {
42487
42589
  var _schema_clearcoatFactor = schema.clearcoatFactor, clearcoatFactor = _schema_clearcoatFactor === void 0 ? 0 : _schema_clearcoatFactor, clearcoatTexture = schema.clearcoatTexture, _schema_clearcoatRoughnessFactor = schema.clearcoatRoughnessFactor, clearcoatRoughnessFactor = _schema_clearcoatRoughnessFactor === void 0 ? 0 : _schema_clearcoatRoughnessFactor, clearcoatRoughnessTexture = schema.clearcoatRoughnessTexture, clearcoatNormalTexture = schema.clearcoatNormalTexture;
@@ -42511,11 +42613,11 @@
42511
42613
  KHR_materials_clearcoat = __decorate([
42512
42614
  registerGLTFExtension("KHR_materials_clearcoat", exports.GLTFExtensionMode.AdditiveParse)
42513
42615
  ], KHR_materials_clearcoat);
42514
- var KHR_materials_ior = /*#__PURE__*/ function(GLTFExtensionParser) {
42616
+ var KHR_materials_ior = /*#__PURE__*/ function(GLTFExtensionParser1) {
42515
42617
  var KHR_materials_ior = function KHR_materials_ior() {
42516
- return GLTFExtensionParser.apply(this, arguments);
42618
+ return GLTFExtensionParser1.apply(this, arguments);
42517
42619
  };
42518
- _inherits(KHR_materials_ior, GLTFExtensionParser);
42620
+ _inherits(KHR_materials_ior, GLTFExtensionParser1);
42519
42621
  var _proto = KHR_materials_ior.prototype;
42520
42622
  _proto.additiveParse = function additiveParse(context, material, schema) {
42521
42623
  var _schema_ior = schema.ior, ior = _schema_ior === void 0 ? 1.5 : _schema_ior;
@@ -42526,11 +42628,11 @@
42526
42628
  KHR_materials_ior = __decorate([
42527
42629
  registerGLTFExtension("KHR_materials_ior", exports.GLTFExtensionMode.AdditiveParse)
42528
42630
  ], KHR_materials_ior);
42529
- var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionParser) {
42631
+ var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionParser1) {
42530
42632
  var KHR_materials_pbrSpecularGlossiness = function KHR_materials_pbrSpecularGlossiness() {
42531
- return GLTFExtensionParser.apply(this, arguments);
42633
+ return GLTFExtensionParser1.apply(this, arguments);
42532
42634
  };
42533
- _inherits(KHR_materials_pbrSpecularGlossiness, GLTFExtensionParser);
42635
+ _inherits(KHR_materials_pbrSpecularGlossiness, GLTFExtensionParser1);
42534
42636
  var _proto = KHR_materials_pbrSpecularGlossiness.prototype;
42535
42637
  _proto.createAndParse = function createAndParse(context, schema, ownerSchema) {
42536
42638
  var engine = context.glTFResource.engine;
@@ -42566,11 +42668,11 @@
42566
42668
  KHR_materials_pbrSpecularGlossiness = __decorate([
42567
42669
  registerGLTFExtension("KHR_materials_pbrSpecularGlossiness", exports.GLTFExtensionMode.CreateAndParse)
42568
42670
  ], KHR_materials_pbrSpecularGlossiness);
42569
- var KHR_materials_unlit = /*#__PURE__*/ function(GLTFExtensionParser) {
42671
+ var KHR_materials_unlit = /*#__PURE__*/ function(GLTFExtensionParser1) {
42570
42672
  var KHR_materials_unlit = function KHR_materials_unlit() {
42571
- return GLTFExtensionParser.apply(this, arguments);
42673
+ return GLTFExtensionParser1.apply(this, arguments);
42572
42674
  };
42573
- _inherits(KHR_materials_unlit, GLTFExtensionParser);
42675
+ _inherits(KHR_materials_unlit, GLTFExtensionParser1);
42574
42676
  var _proto = KHR_materials_unlit.prototype;
42575
42677
  _proto.createAndParse = function createAndParse(context, _, ownerSchema) {
42576
42678
  var engine = context.glTFResource.engine;
@@ -42584,11 +42686,11 @@
42584
42686
  KHR_materials_unlit = __decorate([
42585
42687
  registerGLTFExtension("KHR_materials_unlit", exports.GLTFExtensionMode.CreateAndParse)
42586
42688
  ], KHR_materials_unlit);
42587
- var KHR_materials_variants = /*#__PURE__*/ function(GLTFExtensionParser) {
42689
+ var KHR_materials_variants = /*#__PURE__*/ function(GLTFExtensionParser1) {
42588
42690
  var KHR_materials_variants = function KHR_materials_variants() {
42589
- return GLTFExtensionParser.apply(this, arguments);
42691
+ return GLTFExtensionParser1.apply(this, arguments);
42590
42692
  };
42591
- _inherits(KHR_materials_variants, GLTFExtensionParser);
42693
+ _inherits(KHR_materials_variants, GLTFExtensionParser1);
42592
42694
  var _proto = KHR_materials_variants.prototype;
42593
42695
  _proto.additiveParse = function additiveParse(context, renderer, schema) {
42594
42696
  var _loop = function _loop(i) {
@@ -42616,21 +42718,21 @@
42616
42718
  KHR_materials_variants = __decorate([
42617
42719
  registerGLTFExtension("KHR_materials_variants", exports.GLTFExtensionMode.AdditiveParse)
42618
42720
  ], KHR_materials_variants);
42619
- var KHR_mesh_quantization = /*#__PURE__*/ function(GLTFExtensionParser) {
42721
+ var KHR_mesh_quantization = /*#__PURE__*/ function(GLTFExtensionParser1) {
42620
42722
  var KHR_mesh_quantization = function KHR_mesh_quantization() {
42621
- return GLTFExtensionParser.apply(this, arguments);
42723
+ return GLTFExtensionParser1.apply(this, arguments);
42622
42724
  };
42623
- _inherits(KHR_mesh_quantization, GLTFExtensionParser);
42725
+ _inherits(KHR_mesh_quantization, GLTFExtensionParser1);
42624
42726
  return KHR_mesh_quantization;
42625
42727
  }(GLTFExtensionParser);
42626
42728
  KHR_mesh_quantization = __decorate([
42627
42729
  registerGLTFExtension("KHR_mesh_quantization", exports.GLTFExtensionMode.AdditiveParse)
42628
42730
  ], KHR_mesh_quantization);
42629
- var KHR_texture_basisu = /*#__PURE__*/ function(GLTFExtensionParser) {
42731
+ var KHR_texture_basisu = /*#__PURE__*/ function(GLTFExtensionParser1) {
42630
42732
  var KHR_texture_basisu = function KHR_texture_basisu() {
42631
- return GLTFExtensionParser.apply(this, arguments);
42733
+ return GLTFExtensionParser1.apply(this, arguments);
42632
42734
  };
42633
- _inherits(KHR_texture_basisu, GLTFExtensionParser);
42735
+ _inherits(KHR_texture_basisu, GLTFExtensionParser1);
42634
42736
  var _proto = KHR_texture_basisu.prototype;
42635
42737
  _proto.createAndParse = function createAndParse(context, schema, textureInfo) {
42636
42738
  return _async_to_generator(function() {
@@ -42688,11 +42790,11 @@
42688
42790
  KHR_texture_basisu = __decorate([
42689
42791
  registerGLTFExtension("KHR_texture_basisu", exports.GLTFExtensionMode.CreateAndParse)
42690
42792
  ], KHR_texture_basisu);
42691
- var KHR_texture_transform = /*#__PURE__*/ function(GLTFExtensionParser) {
42793
+ var KHR_texture_transform = /*#__PURE__*/ function(GLTFExtensionParser1) {
42692
42794
  var KHR_texture_transform = function KHR_texture_transform() {
42693
- return GLTFExtensionParser.apply(this, arguments);
42795
+ return GLTFExtensionParser1.apply(this, arguments);
42694
42796
  };
42695
- _inherits(KHR_texture_transform, GLTFExtensionParser);
42797
+ _inherits(KHR_texture_transform, GLTFExtensionParser1);
42696
42798
  var _proto = KHR_texture_transform.prototype;
42697
42799
  _proto.additiveParse = function additiveParse(context, material, schema) {
42698
42800
  var offset = schema.offset, rotation = schema.rotation, scale = schema.scale, texCoord = schema.texCoord;
@@ -42716,11 +42818,11 @@
42716
42818
  KHR_texture_transform = __decorate([
42717
42819
  registerGLTFExtension("KHR_texture_transform", exports.GLTFExtensionMode.AdditiveParse)
42718
42820
  ], KHR_texture_transform);
42719
- var GALACEAN_materials_remap = /*#__PURE__*/ function(GLTFExtensionParser) {
42821
+ var GALACEAN_materials_remap = /*#__PURE__*/ function(GLTFExtensionParser1) {
42720
42822
  var GALACEAN_materials_remap = function GALACEAN_materials_remap() {
42721
- return GLTFExtensionParser.apply(this, arguments);
42823
+ return GLTFExtensionParser1.apply(this, arguments);
42722
42824
  };
42723
- _inherits(GALACEAN_materials_remap, GLTFExtensionParser);
42825
+ _inherits(GALACEAN_materials_remap, GLTFExtensionParser1);
42724
42826
  var _proto = GALACEAN_materials_remap.prototype;
42725
42827
  _proto.createAndParse = function createAndParse(context, schema) {
42726
42828
  var engine = context.glTFResource.engine;
@@ -42732,11 +42834,11 @@
42732
42834
  GALACEAN_materials_remap = __decorate([
42733
42835
  registerGLTFExtension("GALACEAN_materials_remap", exports.GLTFExtensionMode.CreateAndParse)
42734
42836
  ], GALACEAN_materials_remap);
42735
- var GALACEAN_animation_event = /*#__PURE__*/ function(GLTFExtensionParser) {
42837
+ var GALACEAN_animation_event = /*#__PURE__*/ function(GLTFExtensionParser1) {
42736
42838
  var GALACEAN_animation_event = function GALACEAN_animation_event() {
42737
- return GLTFExtensionParser.apply(this, arguments);
42839
+ return GLTFExtensionParser1.apply(this, arguments);
42738
42840
  };
42739
- _inherits(GALACEAN_animation_event, GLTFExtensionParser);
42841
+ _inherits(GALACEAN_animation_event, GLTFExtensionParser1);
42740
42842
  var _proto = GALACEAN_animation_event.prototype;
42741
42843
  _proto.additiveParse = function additiveParse(context, animationClip, schema) {
42742
42844
  context.glTFResource.engine;
@@ -42756,7 +42858,7 @@
42756
42858
  ], GALACEAN_animation_event);
42757
42859
 
42758
42860
  //@ts-ignore
42759
- var version = "1.1.0-alpha.4";
42861
+ var version = "1.1.0-beta.0";
42760
42862
  console.log("Galacean engine version: " + version);
42761
42863
  for(var key in CoreObjects){
42762
42864
  Loader.registerClass(key, CoreObjects[key]);