@galacean/engine-core 1.1.0-beta.0 → 1.1.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/main.js +745 -396
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +745 -396
  4. package/dist/module.js +734 -397
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/Background.d.ts +8 -0
  8. package/types/Component.d.ts +1 -1
  9. package/types/DisorderedArray.d.ts +1 -1
  10. package/types/RenderPipeline/MeshRenderElement.d.ts +3 -1
  11. package/types/RenderPipeline/SpriteElement.d.ts +3 -1
  12. package/types/RenderPipeline/SpriteMaskElement.d.ts +3 -1
  13. package/types/RenderPipeline/TextRenderElement.d.ts +3 -1
  14. package/types/Scene.d.ts +6 -0
  15. package/types/lighting/DirectLight.d.ts +8 -1
  16. package/types/lighting/Light.d.ts +0 -4
  17. package/types/lighting/LightManager.d.ts +7 -0
  18. package/types/lighting/PointLight.d.ts +9 -1
  19. package/types/lighting/SpotLight.d.ts +12 -1
  20. package/types/particle/ParticleGenerator.d.ts +0 -2
  21. package/types/particle/index.d.ts +10 -0
  22. package/types/particle/modules/MainModule.d.ts +7 -5
  23. package/types/particle/modules/ParticleGeneratorModule.d.ts +0 -1
  24. package/types/particle/modules/RotationOverLifetimeModule.d.ts +1 -1
  25. package/types/particle/modules/TextureSheetAnimationModule.d.ts +0 -4
  26. package/types/physics/Collider.d.ts +3 -1
  27. package/types/physics/PhysicsMaterial.d.ts +1 -0
  28. package/types/physics/joint/HingeJoint.d.ts +1 -1
  29. package/types/physics/joint/Joint.d.ts +4 -3
  30. package/types/physics/shape/ColliderShape.d.ts +2 -1
  31. package/types/physics/shape/SphereColliderShape.d.ts +1 -0
  32. package/types/RenderPipeline/RenderElementX.d.ts +0 -12
  33. package/types/SafeLoopArray.d.ts +0 -37
  34. package/types/Ticker.d.ts +0 -30
  35. package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +0 -1
  36. package/types/graphic/PrimitiveVertexBinding.d.ts +0 -1
  37. package/types/particle/ParticleData.d.ts +0 -1
  38. package/types/particle/ParticleMesh.d.ts +0 -289
  39. package/types/particle/ParticleShaderDeclaration.d.ts +0 -1
  40. package/types/particle/ParticleShaderMacro.d.ts +0 -1
  41. package/types/particle/ParticleShaderProperty.d.ts +0 -1
  42. package/types/particle/ParticleSystem.d.ts +0 -41
  43. package/types/particle/ParticleVertexElements.d.ts +0 -1
  44. package/types/particle/ParticleVertexUtils.d.ts +0 -1
  45. package/types/particle/enum/ParticleAnimationRowMode.d.ts +0 -9
  46. package/types/particle/enum/ParticleAnimationType.d.ts +0 -9
  47. package/types/particle/enum/ParticleCurveMode.d.ts +0 -13
  48. package/types/particle/enum/ParticleGradientMode.d.ts +0 -13
  49. package/types/particle/enum/ParticleRenderMode.d.ts +0 -17
  50. package/types/particle/enum/ParticleScaleMode.d.ts +0 -11
  51. package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +0 -9
  52. package/types/particle/enum/ParticleShapeType.d.ts +0 -15
  53. package/types/particle/enum/ParticleSimulationSpace.d.ts +0 -9
  54. package/types/particle/enum/index.d.ts +0 -9
  55. package/types/particle/module/Burst.d.ts +0 -38
  56. package/types/particle/module/ColorGradient.d.ts +0 -75
  57. package/types/particle/module/ColorOverLifetimeModule.d.ts +0 -20
  58. package/types/particle/module/EmissionModule.d.ts +0 -63
  59. package/types/particle/module/FrameOverTime.d.ts +0 -73
  60. package/types/particle/module/ParticleCurve.d.ts +0 -37
  61. package/types/particle/module/RotationOverLifetimeModule.d.ts +0 -21
  62. package/types/particle/module/RotationVelocityGradient.d.ts +0 -184
  63. package/types/particle/module/SizeGradient.d.ts +0 -151
  64. package/types/particle/module/SizeOverLifetimeModule.d.ts +0 -21
  65. package/types/particle/module/StartFrame.d.ts +0 -46
  66. package/types/particle/module/TextureSheetAnimationModule.d.ts +0 -37
  67. package/types/particle/module/VelocityGradient.d.ts +0 -110
  68. package/types/particle/module/VelocityOverLifetimeModule.d.ts +0 -22
  69. package/types/particle/module/index.d.ts +0 -15
  70. package/types/particle/module/shape/BaseShape.d.ts +0 -26
  71. package/types/particle/module/shape/BoxShape.d.ts +0 -20
  72. package/types/particle/module/shape/CircleShape.d.ts +0 -27
  73. package/types/particle/module/shape/ConeShape.d.ts +0 -35
  74. package/types/particle/module/shape/HemisphereShape.d.ts +0 -23
  75. package/types/particle/module/shape/ShapeUtils.d.ts +0 -1
  76. package/types/particle/module/shape/SphereShape.d.ts +0 -23
  77. package/types/particle/module/shape/index.d.ts +0 -5
  78. package/types/particle/modules/ShapeModule.d.ts +0 -9
  79. package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +0 -9
  80. package/types/particle/moudules/Burst.d.ts +0 -25
  81. package/types/particle/moudules/Emission.d.ts +0 -47
  82. package/types/particle/moudules/EmissionModule.d.ts +0 -49
  83. package/types/particle/moudules/MainModule.d.ts +0 -59
  84. package/types/particle/moudules/ParticleCurve.d.ts +0 -27
  85. package/types/particle/moudules/ParticleGradient.d.ts +0 -28
  86. package/types/particle/moudules/ShapeModule.d.ts +0 -7
  87. package/types/particle/moudules/shape/BaseShape.d.ts +0 -28
  88. package/types/particle/moudules/shape/BoxShape.d.ts +0 -20
  89. package/types/particle/moudules/shape/CircleShape.d.ts +0 -27
  90. package/types/particle/moudules/shape/ConeShape.d.ts +0 -35
  91. package/types/particle/moudules/shape/HemisphereShape.d.ts +0 -23
  92. package/types/particle/moudules/shape/ShapeUtils.d.ts +0 -1
  93. package/types/particle/moudules/shape/SphereShape.d.ts +0 -23
  94. package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +0 -9
  95. package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +0 -15
  96. package/types/particle/moudules/shape/index.d.ts +0 -5
  97. package/types/shadow/PipelinePass.d.ts +0 -16
  98. package/types/utils/BoolUpdateFlag.d.ts +0 -12
  99. package/types/utils/DisorderedArray.d.ts +0 -18
  100. package/types/utils/UpdateFlag.d.ts +0 -20
  101. package/types/utils/UpdateFlagManager.d.ts +0 -1
  102. package/types/utils/Utils.d.ts +0 -31
  103. package/types/xr/XRManager.d.ts +0 -31
  104. package/types/xr/component/XRPoseDriver.d.ts +0 -10
  105. package/types/xr/data/XRCamera.d.ts +0 -6
  106. package/types/xr/data/XRDevice.d.ts +0 -9
  107. package/types/xr/data/XRHandle.d.ts +0 -10
  108. package/types/xr/enum/EnumXRButton.d.ts +0 -5
  109. package/types/xr/enum/EnumXRDevicePhase.d.ts +0 -4
  110. package/types/xr/enum/EnumXRFeature.d.ts +0 -9
  111. package/types/xr/enum/EnumXRInputSource.d.ts +0 -8
  112. package/types/xr/enum/EnumXRMode.d.ts +0 -7
  113. package/types/xr/enum/EnumXRSubsystem.d.ts +0 -4
  114. package/types/xr/enum/EnumXRTrackingMode.d.ts +0 -7
  115. package/types/xr/feature/XRCameraManager.d.ts +0 -21
  116. package/types/xr/feature/XRFeature.d.ts +0 -29
  117. package/types/xr/feature/XRImageTrackManager.d.ts +0 -10
  118. package/types/xr/feature/XRInputManager.d.ts +0 -16
  119. package/types/xr/index.d.ts +0 -18
  120. package/types/xr/provider/XRProvider.d.ts +0 -19
  121. package/types/xr/subsystem/XRInputSubsystem.d.ts +0 -5
  122. package/types/xr/subsystem/XRSubsystem.d.ts +0 -30
package/dist/module.js CHANGED
@@ -549,6 +549,7 @@ function _instanceof(left, right) {
549
549
  for(var i = 0; i < length; i++){
550
550
  CloneManager.cloneProperty(sourceProperty, targetPropertyA, i, cloneMode);
551
551
  }
552
+ break;
552
553
  default:
553
554
  var _target, _k;
554
555
  var targetOProperty = (_target = target)[_k = k] || (_target[_k] = new sourceProperty.constructor());
@@ -2537,8 +2538,8 @@ var ActiveChangeFlag;
2537
2538
  var _this;
2538
2539
  _this = EngineObject1.call(this, entity.engine) || this;
2539
2540
  /** @internal */ _this._awoken = false;
2540
- _this._phasedActive = false;
2541
2541
  _this._phasedActiveInScene = false;
2542
+ _this._phasedActive = false;
2542
2543
  _this._enabled = true;
2543
2544
  _this._entity = entity;
2544
2545
  return _this;
@@ -2670,10 +2671,10 @@ __decorate([
2670
2671
  ], Component.prototype, "_awoken", void 0);
2671
2672
  __decorate([
2672
2673
  ignoreClone
2673
- ], Component.prototype, "_phasedActive", void 0);
2674
+ ], Component.prototype, "_phasedActiveInScene", void 0);
2674
2675
  __decorate([
2675
2676
  ignoreClone
2676
- ], Component.prototype, "_phasedActiveInScene", void 0);
2677
+ ], Component.prototype, "_phasedActive", void 0);
2677
2678
  __decorate([
2678
2679
  assignmentClone
2679
2680
  ], Component.prototype, "_enabled", void 0);
@@ -2830,14 +2831,14 @@ var DependentMode;
2830
2831
  }
2831
2832
  return end;
2832
2833
  };
2833
- _proto.forEach = function forEach(callbackFn) {
2834
+ _proto.forEach = function forEach(callbackFn, swapFn) {
2834
2835
  this._startLoop();
2835
2836
  var elements = this._elements;
2836
2837
  for(var i = 0; i < this.length; i++){
2837
2838
  var element = elements[i];
2838
2839
  element && callbackFn(element);
2839
2840
  }
2840
- this._endLoop();
2841
+ this._endLoop(swapFn);
2841
2842
  };
2842
2843
  _proto.forEachAndClean = function forEachAndClean(callbackFn) {
2843
2844
  this._startLoop();
@@ -2854,16 +2855,24 @@ var DependentMode;
2854
2855
  _proto._startLoop = function _startLoop() {
2855
2856
  this._isLooping = true;
2856
2857
  };
2857
- _proto._endLoop = function _endLoop() {
2858
+ _proto._endLoop = function _endLoop(swapFn) {
2858
2859
  this._isLooping = false;
2859
2860
  if (this._blankCount) {
2861
+ var from = 0;
2862
+ var to = this.length - 1;
2860
2863
  var elements = this._elements;
2861
- for(var i = 0, j = 0, n = this.length; i < n; i++){
2862
- var element = elements[i];
2863
- if (element) {
2864
- elements[j++] = element;
2865
- }
2866
- }
2864
+ partition: do {
2865
+ while(elements[from])if (++from >= to) {
2866
+ break partition;
2867
+ }
2868
+ while(!elements[to])if (from >= --to) {
2869
+ break partition;
2870
+ }
2871
+ var swapElement = elements[to];
2872
+ swapFn(swapElement, from);
2873
+ elements[from++] = swapElement;
2874
+ elements[to--] = null;
2875
+ }while (from < to);
2867
2876
  this.length -= this._blankCount;
2868
2877
  this._blankCount = 0;
2869
2878
  }
@@ -4227,12 +4236,6 @@ var ComponentCloner = /*#__PURE__*/ function() {
4227
4236
  this._hookResource._addReferCount(-1);
4228
4237
  this._hookResource = null;
4229
4238
  }
4230
- this.isActive = false;
4231
- if (this._isRoot) {
4232
- this._scene.removeRootEntity(this);
4233
- } else {
4234
- this._setParent(null);
4235
- }
4236
4239
  var components = this._components;
4237
4240
  for(var i = components.length - 1; i >= 0; i--){
4238
4241
  components[i].destroy();
@@ -4242,6 +4245,12 @@ var ComponentCloner = /*#__PURE__*/ function() {
4242
4245
  while(children.length > 0){
4243
4246
  children[0].destroy();
4244
4247
  }
4248
+ if (this._isRoot) {
4249
+ this._scene.removeRootEntity(this);
4250
+ } else {
4251
+ this._setParent(null);
4252
+ }
4253
+ this.isActive = false;
4245
4254
  };
4246
4255
  /**
4247
4256
  * @internal
@@ -6224,6 +6233,12 @@ var ShaderFactory = /*#__PURE__*/ function() {
6224
6233
  };
6225
6234
  return BlendState;
6226
6235
  }();
6236
+ __decorate([
6237
+ deepClone
6238
+ ], BlendState.prototype, "targetBlendState", void 0);
6239
+ __decorate([
6240
+ deepClone
6241
+ ], BlendState.prototype, "blendColor", void 0);
6227
6242
 
6228
6243
  /**
6229
6244
  * Depth state.
@@ -6606,6 +6621,18 @@ var ShaderFactory = /*#__PURE__*/ function() {
6606
6621
  };
6607
6622
  return RenderState;
6608
6623
  }();
6624
+ __decorate([
6625
+ deepClone
6626
+ ], RenderState.prototype, "blendState", void 0);
6627
+ __decorate([
6628
+ deepClone
6629
+ ], RenderState.prototype, "depthState", void 0);
6630
+ __decorate([
6631
+ deepClone
6632
+ ], RenderState.prototype, "stencilState", void 0);
6633
+ __decorate([
6634
+ deepClone
6635
+ ], RenderState.prototype, "rasterState", void 0);
6609
6636
 
6610
6637
  /**
6611
6638
  * Shader for rendering.
@@ -7514,7 +7541,7 @@ __decorate([
7514
7541
  ignoreClone
7515
7542
  ], Renderer.prototype, "_globalShaderMacro", void 0);
7516
7543
  __decorate([
7517
- deepClone
7544
+ ignoreClone
7518
7545
  ], Renderer.prototype, "_bounds", void 0);
7519
7546
  __decorate([
7520
7547
  ignoreClone
@@ -12291,7 +12318,7 @@ var SpriteMaskBatcher = /*#__PURE__*/ function(Basic2DBatcher1) {
12291
12318
  _proto.drawBatches = function drawBatches(camera) {
12292
12319
  var _this = this, engine = _this._engine, batchedQueue = _this._batchedQueue;
12293
12320
  var mesh = this._meshes[this._flushId];
12294
- var subMeshes = mesh.subMeshes;
12321
+ var subMeshes = mesh.subMeshes, primitive = mesh._primitive;
12295
12322
  var sceneData = camera.scene.shaderData;
12296
12323
  var cameraData = camera.shaderData;
12297
12324
  for(var i = 0, len = subMeshes.length; i < len; i++){
@@ -12323,7 +12350,7 @@ var SpriteMaskBatcher = /*#__PURE__*/ function(Basic2DBatcher1) {
12323
12350
  program.uploadAll(program.rendererUniformBlock, renderer.shaderData);
12324
12351
  program.uploadAll(program.materialUniformBlock, material.shaderData);
12325
12352
  material.renderState._apply(engine, false, pass._renderStateDataMap, material.shaderData);
12326
- engine._hardwareRenderer.drawPrimitive(mesh, subMesh, program);
12353
+ engine._hardwareRenderer.drawPrimitive(primitive, subMesh, program);
12327
12354
  }
12328
12355
  };
12329
12356
  return SpriteMaskBatcher;
@@ -12569,16 +12596,31 @@ var SafeLoopArray = /*#__PURE__*/ function() {
12569
12596
  }
12570
12597
  var _proto = SceneManager.prototype;
12571
12598
  _proto.addScene = function addScene(indexOrScene, scene) {
12599
+ var scenes = this._scenes;
12600
+ var index;
12572
12601
  if (typeof indexOrScene === "number") {
12573
- this._scenes.add(indexOrScene, scene);
12602
+ if (indexOrScene < 0 || indexOrScene > scenes.length) {
12603
+ throw "The index is out of range.";
12604
+ }
12605
+ index = indexOrScene;
12574
12606
  } else {
12607
+ index = scenes.length;
12575
12608
  scene = indexOrScene;
12576
- this._scenes.push(scene);
12577
12609
  }
12578
12610
  if (scene.engine !== this.engine) {
12579
12611
  throw "The scene is not belong to this engine.";
12580
12612
  }
12581
- scene._processActive(true);
12613
+ if (scene._sceneManager) {
12614
+ var currentIndex = scenes.indexOf(scene);
12615
+ if (currentIndex !== index) {
12616
+ scenes.removeByIndex(currentIndex);
12617
+ scenes.add(index, scene);
12618
+ }
12619
+ } else {
12620
+ scene._sceneManager = this;
12621
+ scenes.add(index, scene);
12622
+ scene.isActive && scene._processActive(true);
12623
+ }
12582
12624
  };
12583
12625
  /**
12584
12626
  * Remove scene.
@@ -12589,7 +12631,8 @@ var SafeLoopArray = /*#__PURE__*/ function() {
12589
12631
  if (index !== -1) {
12590
12632
  var removedScene = scenes.getArray()[index];
12591
12633
  scenes.removeByIndex(index);
12592
- removedScene._processActive(false);
12634
+ scene._sceneManager = null;
12635
+ removedScene.isActive && removedScene._processActive(false);
12593
12636
  }
12594
12637
  };
12595
12638
  /**
@@ -13246,11 +13289,15 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
13246
13289
  if (this._currentEnteredEntity) {
13247
13290
  this._currentEnteredEntity._scripts.forEach(function(element) {
13248
13291
  element.onPointerExit(_this);
13292
+ }, function(element, index) {
13293
+ element._entityScriptsIndex = index;
13249
13294
  });
13250
13295
  }
13251
13296
  if (rayCastEntity) {
13252
13297
  rayCastEntity._scripts.forEach(function(element) {
13253
13298
  element.onPointerEnter(_this);
13299
+ }, function(element, index) {
13300
+ element._entityScriptsIndex = index;
13254
13301
  });
13255
13302
  }
13256
13303
  this._currentEnteredEntity = rayCastEntity;
@@ -13263,6 +13310,8 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
13263
13310
  if (rayCastEntity) {
13264
13311
  rayCastEntity._scripts.forEach(function(element) {
13265
13312
  element.onPointerDown(_this);
13313
+ }, function(element, index) {
13314
+ element._entityScriptsIndex = index;
13266
13315
  });
13267
13316
  }
13268
13317
  this._currentPressedEntity = rayCastEntity;
@@ -13274,6 +13323,8 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
13274
13323
  if (this._currentPressedEntity) {
13275
13324
  this._currentPressedEntity._scripts.forEach(function(element) {
13276
13325
  element.onPointerDrag(_this);
13326
+ }, function(element, index) {
13327
+ element._entityScriptsIndex = index;
13277
13328
  });
13278
13329
  }
13279
13330
  };
@@ -13287,6 +13338,8 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
13287
13338
  pressedEntity._scripts.forEach(function(element) {
13288
13339
  sameTarget && element.onPointerClick(_this);
13289
13340
  element.onPointerUp(_this);
13341
+ }, function(element, index) {
13342
+ element._entityScriptsIndex = index;
13290
13343
  });
13291
13344
  this._currentPressedEntity = null;
13292
13345
  }
@@ -13793,9 +13846,9 @@ var Collider = /*#__PURE__*/ function(Component1) {
13793
13846
  oldCollider.removeShape(shape);
13794
13847
  }
13795
13848
  this._shapes.push(shape);
13796
- this.scene.physics._addColliderShape(shape);
13797
13849
  shape._collider = this;
13798
13850
  this._nativeCollider.addShape(shape._nativeShape);
13851
+ this._phasedActiveInScene && this.scene.physics._addColliderShape(shape);
13799
13852
  }
13800
13853
  };
13801
13854
  /**
@@ -13805,7 +13858,7 @@ var Collider = /*#__PURE__*/ function(Component1) {
13805
13858
  var index = this._shapes.indexOf(shape);
13806
13859
  if (index !== -1) {
13807
13860
  this._shapes.splice(index, 1);
13808
- this.scene.physics._removeColliderShape(shape);
13861
+ this._phasedActiveInScene && this.scene.physics._removeColliderShape(shape);
13809
13862
  shape._collider = null;
13810
13863
  this._nativeCollider.removeShape(shape._nativeShape);
13811
13864
  }
@@ -13816,7 +13869,7 @@ var Collider = /*#__PURE__*/ function(Component1) {
13816
13869
  var shapes = this._shapes;
13817
13870
  for(var i = 0, n = shapes.length; i < n; i++){
13818
13871
  var shape = shapes[i];
13819
- this.scene.physics._removeColliderShape(shape);
13872
+ this._phasedActiveInScene && this.scene.physics._removeColliderShape(shape);
13820
13873
  shape._destroy();
13821
13874
  this._nativeCollider.removeShape(shape._nativeShape);
13822
13875
  }
@@ -13841,12 +13894,30 @@ var Collider = /*#__PURE__*/ function(Component1) {
13841
13894
  /**
13842
13895
  * @internal
13843
13896
  */ _proto._onEnableInScene = function _onEnableInScene() {
13844
- this.scene.physics._addCollider(this);
13897
+ var physics = this.scene.physics;
13898
+ physics._addCollider(this);
13899
+ var shapes = this.shapes;
13900
+ for(var i = 0, n = shapes.length; i < n; i++){
13901
+ physics._addColliderShape(shapes[i]);
13902
+ }
13845
13903
  };
13846
13904
  /**
13847
13905
  * @internal
13848
13906
  */ _proto._onDisableInScene = function _onDisableInScene() {
13849
- this.scene.physics._removeCollider(this);
13907
+ var physics = this.scene.physics;
13908
+ physics._removeCollider(this);
13909
+ var shapes = this.shapes;
13910
+ for(var i = 0, n = shapes.length; i < n; i++){
13911
+ physics._removeColliderShape(shapes[i]);
13912
+ }
13913
+ };
13914
+ /**
13915
+ * @internal
13916
+ */ _proto._cloneTo = function _cloneTo(target) {
13917
+ var shapes = target._shapes;
13918
+ for(var i = 0, n = shapes.length; i < n; i++){
13919
+ target._addPhysicsShape(shapes[i]);
13920
+ }
13850
13921
  };
13851
13922
  /**
13852
13923
  * @internal
@@ -13855,6 +13926,11 @@ var Collider = /*#__PURE__*/ function(Component1) {
13855
13926
  this.clearShapes();
13856
13927
  this._nativeCollider.destroy();
13857
13928
  };
13929
+ _proto._addPhysicsShape = function _addPhysicsShape(shape) {
13930
+ shape._collider = this;
13931
+ this._nativeCollider.addShape(shape._nativeShape);
13932
+ this._phasedActiveInScene && this.scene.physics._addColliderShape(shape);
13933
+ };
13858
13934
  _create_class(Collider, [
13859
13935
  {
13860
13936
  key: "shapes",
@@ -13870,6 +13946,15 @@ var Collider = /*#__PURE__*/ function(Component1) {
13870
13946
  __decorate([
13871
13947
  ignoreClone
13872
13948
  ], Collider.prototype, "_index", void 0);
13949
+ __decorate([
13950
+ ignoreClone
13951
+ ], Collider.prototype, "_nativeCollider", void 0);
13952
+ __decorate([
13953
+ ignoreClone
13954
+ ], Collider.prototype, "_updateFlag", void 0);
13955
+ __decorate([
13956
+ deepClone
13957
+ ], Collider.prototype, "_shapes", void 0);
13873
13958
  Collider = __decorate([
13874
13959
  dependentComponents(Transform, DependentMode.CheckOnly)
13875
13960
  ], Collider);
@@ -13894,11 +13979,15 @@ var Collision = function Collision() {
13894
13979
  var collision = PhysicsScene._collision;
13895
13980
  collision.shape = shape2;
13896
13981
  element.onCollisionEnter(collision);
13982
+ }, function(element, index) {
13983
+ element._entityScriptsIndex = index;
13897
13984
  });
13898
13985
  shape2.collider.entity._scripts.forEach(function(element) {
13899
13986
  var collision = PhysicsScene._collision;
13900
13987
  collision.shape = shape1;
13901
13988
  element.onCollisionEnter(collision);
13989
+ }, function(element, index) {
13990
+ element._entityScriptsIndex = index;
13902
13991
  });
13903
13992
  };
13904
13993
  this._onContactExit = function(obj1, obj2) {
@@ -13909,11 +13998,15 @@ var Collision = function Collision() {
13909
13998
  var collision = PhysicsScene._collision;
13910
13999
  collision.shape = shape2;
13911
14000
  element.onCollisionExit(collision);
14001
+ }, function(element, index) {
14002
+ element._entityScriptsIndex = index;
13912
14003
  });
13913
14004
  shape2.collider.entity._scripts.forEach(function(element) {
13914
14005
  var collision = PhysicsScene._collision;
13915
14006
  collision.shape = shape1;
13916
14007
  element.onCollisionExit(collision);
14008
+ }, function(element, index) {
14009
+ element._entityScriptsIndex = index;
13917
14010
  });
13918
14011
  };
13919
14012
  this._onContactStay = function(obj1, obj2) {
@@ -13924,11 +14017,15 @@ var Collision = function Collision() {
13924
14017
  var collision = PhysicsScene._collision;
13925
14018
  collision.shape = shape2;
13926
14019
  element.onCollisionStay(collision);
14020
+ }, function(element, index) {
14021
+ element._entityScriptsIndex = index;
13927
14022
  });
13928
14023
  shape2.collider.entity._scripts.forEach(function(element) {
13929
14024
  var collision = PhysicsScene._collision;
13930
14025
  collision.shape = shape1;
13931
14026
  element.onCollisionStay(collision);
14027
+ }, function(element, index) {
14028
+ element._entityScriptsIndex = index;
13932
14029
  });
13933
14030
  };
13934
14031
  this._onTriggerEnter = function(obj1, obj2) {
@@ -13937,9 +14034,13 @@ var Collision = function Collision() {
13937
14034
  var shape2 = physicalObjectsMap[obj2];
13938
14035
  shape1.collider.entity._scripts.forEach(function(element) {
13939
14036
  element.onTriggerEnter(shape2);
14037
+ }, function(element, index) {
14038
+ element._entityScriptsIndex = index;
13940
14039
  });
13941
14040
  shape2.collider.entity._scripts.forEach(function(element) {
13942
14041
  element.onTriggerEnter(shape1);
14042
+ }, function(element, index) {
14043
+ element._entityScriptsIndex = index;
13943
14044
  });
13944
14045
  };
13945
14046
  this._onTriggerExit = function(obj1, obj2) {
@@ -13948,9 +14049,13 @@ var Collision = function Collision() {
13948
14049
  var shape2 = physicalObjectsMap[obj2];
13949
14050
  shape1.collider.entity._scripts.forEach(function(element) {
13950
14051
  element.onTriggerExit(shape2);
14052
+ }, function(element, index) {
14053
+ element._entityScriptsIndex = index;
13951
14054
  });
13952
14055
  shape2.collider.entity._scripts.forEach(function(element) {
13953
14056
  element.onTriggerExit(shape1);
14057
+ }, function(element, index) {
14058
+ element._entityScriptsIndex = index;
13954
14059
  });
13955
14060
  };
13956
14061
  this._onTriggerStay = function(obj1, obj2) {
@@ -13959,9 +14064,13 @@ var Collision = function Collision() {
13959
14064
  var shape2 = physicalObjectsMap[obj2];
13960
14065
  shape1.collider.entity._scripts.forEach(function(element) {
13961
14066
  element.onTriggerStay(shape2);
14067
+ }, function(element, index) {
14068
+ element._entityScriptsIndex = index;
13962
14069
  });
13963
14070
  shape2.collider.entity._scripts.forEach(function(element) {
13964
14071
  element.onTriggerStay(shape1);
14072
+ }, function(element, index) {
14073
+ element._entityScriptsIndex = index;
13965
14074
  });
13966
14075
  };
13967
14076
  this._scene = scene;
@@ -13994,6 +14103,9 @@ var Collision = function Collision() {
13994
14103
  }
13995
14104
  var onRaycast = function(obj) {
13996
14105
  var shape = _this._scene.engine._physicalObjectsMap[obj];
14106
+ if (!shape) {
14107
+ return false;
14108
+ }
13997
14109
  return shape.collider.entity.layer & layerMask && shape.isSceneQuery;
13998
14110
  };
13999
14111
  if (hitResult != undefined) {
@@ -14218,18 +14330,27 @@ var Collision = function Collision() {
14218
14330
  */ _proto._onLateUpdate = function _onLateUpdate() {
14219
14331
  var position = this.entity.transform.worldPosition;
14220
14332
  this._nativeCollider.getWorldPosition(position);
14221
- this.entity.transform.worldPosition = position;
14222
14333
  this._updateFlag.flag = false;
14223
14334
  };
14224
14335
  /**
14225
14336
  * @internal
14226
14337
  */ _proto._onEnableInScene = function _onEnableInScene() {
14227
- this.scene.physics._addCharacterController(this);
14338
+ var physics = this.scene.physics;
14339
+ physics._addCharacterController(this);
14340
+ var shapes = this.shapes;
14341
+ for(var i = 0, n = shapes.length; i < n; i++){
14342
+ physics._addColliderShape(shapes[i]);
14343
+ }
14228
14344
  };
14229
14345
  /**
14230
14346
  * @internal
14231
14347
  */ _proto._onDisableInScene = function _onDisableInScene() {
14232
- this.scene.physics._removeCharacterController(this);
14348
+ var physics = this.scene.physics;
14349
+ physics._removeCharacterController(this);
14350
+ var shapes = this.shapes;
14351
+ for(var i = 0, n = shapes.length; i < n; i++){
14352
+ physics._removeColliderShape(shapes[i]);
14353
+ }
14233
14354
  };
14234
14355
  _proto._setUpDirection = function _setUpDirection() {
14235
14356
  this._nativeCollider.setUpDirection(this._upDirection);
@@ -14365,6 +14486,25 @@ var Collision = function Collision() {
14365
14486
  this._nativeCollider.getWorldTransform(worldPosition, worldRotationQuaternion);
14366
14487
  this._updateFlag.flag = false;
14367
14488
  };
14489
+ /**
14490
+ * @internal
14491
+ */ _proto._cloneTo = function _cloneTo(target) {
14492
+ Collider1.prototype._cloneTo.call(this, target);
14493
+ target.linearDamping = this.linearDamping;
14494
+ target.angularDamping = this.angularDamping;
14495
+ target.linearVelocity = this.linearVelocity;
14496
+ target.angularVelocity = this.angularVelocity;
14497
+ target.mass = this.mass;
14498
+ target.centerOfMass = this.centerOfMass;
14499
+ target.inertiaTensor = this.inertiaTensor;
14500
+ target.maxAngularVelocity = this.maxAngularVelocity;
14501
+ target.maxDepenetrationVelocity = this.maxDepenetrationVelocity;
14502
+ target.sleepThreshold = this.sleepThreshold;
14503
+ target.solverIterations = this.solverIterations;
14504
+ target.isKinematic = this.isKinematic;
14505
+ target.constraints = this.constraints;
14506
+ target.collisionDetectionMode = this.collisionDetectionMode;
14507
+ };
14368
14508
  _proto._setLinearVelocity = function _setLinearVelocity() {
14369
14509
  this._nativeCollider.setLinearVelocity(this._linearVelocity);
14370
14510
  };
@@ -14573,6 +14713,48 @@ var Collision = function Collision() {
14573
14713
  ]);
14574
14714
  return DynamicCollider;
14575
14715
  }(Collider);
14716
+ __decorate([
14717
+ ignoreClone
14718
+ ], DynamicCollider.prototype, "_linearDamping", void 0);
14719
+ __decorate([
14720
+ ignoreClone
14721
+ ], DynamicCollider.prototype, "_angularDamping", void 0);
14722
+ __decorate([
14723
+ ignoreClone
14724
+ ], DynamicCollider.prototype, "_linearVelocity", void 0);
14725
+ __decorate([
14726
+ ignoreClone
14727
+ ], DynamicCollider.prototype, "_angularVelocity", void 0);
14728
+ __decorate([
14729
+ ignoreClone
14730
+ ], DynamicCollider.prototype, "_mass", void 0);
14731
+ __decorate([
14732
+ ignoreClone
14733
+ ], DynamicCollider.prototype, "_centerOfMass", void 0);
14734
+ __decorate([
14735
+ ignoreClone
14736
+ ], DynamicCollider.prototype, "_inertiaTensor", void 0);
14737
+ __decorate([
14738
+ ignoreClone
14739
+ ], DynamicCollider.prototype, "_maxAngularVelocity", void 0);
14740
+ __decorate([
14741
+ ignoreClone
14742
+ ], DynamicCollider.prototype, "_maxDepenetrationVelocity", void 0);
14743
+ __decorate([
14744
+ ignoreClone
14745
+ ], DynamicCollider.prototype, "_solverIterations", void 0);
14746
+ __decorate([
14747
+ ignoreClone
14748
+ ], DynamicCollider.prototype, "_isKinematic", void 0);
14749
+ __decorate([
14750
+ ignoreClone
14751
+ ], DynamicCollider.prototype, "_constraints", void 0);
14752
+ __decorate([
14753
+ ignoreClone
14754
+ ], DynamicCollider.prototype, "_collisionDetectionMode", void 0);
14755
+ __decorate([
14756
+ ignoreClone
14757
+ ], DynamicCollider.prototype, "_sleepThreshold", void 0);
14576
14758
  var CollisionDetectionMode;
14577
14759
  (function(CollisionDetectionMode) {
14578
14760
  CollisionDetectionMode[CollisionDetectionMode["Discrete"] = 0] = "Discrete";
@@ -14625,7 +14807,8 @@ var DynamicColliderConstraints;
14625
14807
  /**
14626
14808
  * @internal
14627
14809
  */ _proto._destroy = function _destroy() {
14628
- this._nativeMaterial.destroy();
14810
+ !this._destroyed && this._nativeMaterial.destroy();
14811
+ this._destroyed = true;
14629
14812
  };
14630
14813
  _create_class(PhysicsMaterial, [
14631
14814
  {
@@ -14740,24 +14923,37 @@ var Joint = /*#__PURE__*/ function(Component1) {
14740
14923
  function Joint(entity) {
14741
14924
  var _this;
14742
14925
  _this = Component1.call(this, entity) || this;
14743
- _this._connectedCollider = new JointCollider();
14744
- _this._collider = new JointCollider();
14926
+ _this._colliderInfo = new JointColliderInfo();
14927
+ _this._connectedColliderInfo = new JointColliderInfo();
14745
14928
  _this._force = 0;
14746
14929
  _this._torque = 0;
14747
- _this._connectedCollider.localPosition = new Vector3();
14930
+ _this._connectedColliderInfo.localPosition = new Vector3();
14748
14931
  return _this;
14749
14932
  }
14933
+ var _proto = Joint.prototype;
14934
+ /**
14935
+ * @internal
14936
+ */ _proto._cloneTo = function _cloneTo(target) {
14937
+ target.connectedCollider = this.connectedCollider;
14938
+ target.connectedAnchor = this.connectedAnchor;
14939
+ target.connectedMassScale = this.connectedMassScale;
14940
+ target.connectedInertiaScale = this.connectedInertiaScale;
14941
+ target.massScale = this.massScale;
14942
+ target.inertiaScale = this.inertiaScale;
14943
+ target.breakForce = this.breakForce;
14944
+ target.breakTorque = this.breakTorque;
14945
+ };
14750
14946
  _create_class(Joint, [
14751
14947
  {
14752
14948
  key: "connectedCollider",
14753
14949
  get: /**
14754
14950
  * The connected collider.
14755
14951
  */ function get() {
14756
- return this._connectedCollider.collider;
14952
+ return this._connectedColliderInfo.collider;
14757
14953
  },
14758
14954
  set: function set(value) {
14759
- if (this._connectedCollider.collider !== value) {
14760
- this._connectedCollider.collider = value;
14955
+ if (this._connectedColliderInfo.collider !== value) {
14956
+ this._connectedColliderInfo.collider = value;
14761
14957
  this._nativeJoint.setConnectedCollider(value._nativeCollider);
14762
14958
  }
14763
14959
  }
@@ -14768,10 +14964,10 @@ var Joint = /*#__PURE__*/ function(Component1) {
14768
14964
  * The connected anchor position.
14769
14965
  * @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
14770
14966
  */ function get() {
14771
- return this._connectedCollider.localPosition;
14967
+ return this._connectedColliderInfo.localPosition;
14772
14968
  },
14773
14969
  set: function set(value) {
14774
- var connectedAnchor = this._connectedCollider.localPosition;
14970
+ var connectedAnchor = this._connectedColliderInfo.localPosition;
14775
14971
  if (value !== connectedAnchor) {
14776
14972
  connectedAnchor.copyFrom(value);
14777
14973
  }
@@ -14783,11 +14979,11 @@ var Joint = /*#__PURE__*/ function(Component1) {
14783
14979
  get: /**
14784
14980
  * The scale to apply to the inverse mass of collider 0 for resolving this constraint.
14785
14981
  */ function get() {
14786
- return this._connectedCollider.massScale;
14982
+ return this._connectedColliderInfo.massScale;
14787
14983
  },
14788
14984
  set: function set(value) {
14789
- if (value !== this._connectedCollider.massScale) {
14790
- this._connectedCollider.massScale = value;
14985
+ if (value !== this._connectedColliderInfo.massScale) {
14986
+ this._connectedColliderInfo.massScale = value;
14791
14987
  this._nativeJoint.setConnectedMassScale(value);
14792
14988
  }
14793
14989
  }
@@ -14797,11 +14993,11 @@ var Joint = /*#__PURE__*/ function(Component1) {
14797
14993
  get: /**
14798
14994
  * The scale to apply to the inverse inertia of collider0 for resolving this constraint.
14799
14995
  */ function get() {
14800
- return this._connectedCollider.inertiaScale;
14996
+ return this._connectedColliderInfo.inertiaScale;
14801
14997
  },
14802
14998
  set: function set(value) {
14803
- if (value !== this._connectedCollider.inertiaScale) {
14804
- this._connectedCollider.inertiaScale = value;
14999
+ if (value !== this._connectedColliderInfo.inertiaScale) {
15000
+ this._connectedColliderInfo.inertiaScale = value;
14805
15001
  this._nativeJoint.setConnectedInertiaScale(value);
14806
15002
  }
14807
15003
  }
@@ -14811,11 +15007,11 @@ var Joint = /*#__PURE__*/ function(Component1) {
14811
15007
  get: /**
14812
15008
  * The scale to apply to the inverse mass of collider 1 for resolving this constraint.
14813
15009
  */ function get() {
14814
- return this._collider.massScale;
15010
+ return this._colliderInfo.massScale;
14815
15011
  },
14816
15012
  set: function set(value) {
14817
- if (value !== this._collider.massScale) {
14818
- this._collider.massScale = value;
15013
+ if (value !== this._colliderInfo.massScale) {
15014
+ this._colliderInfo.massScale = value;
14819
15015
  this._nativeJoint.setMassScale(value);
14820
15016
  }
14821
15017
  }
@@ -14825,11 +15021,11 @@ var Joint = /*#__PURE__*/ function(Component1) {
14825
15021
  get: /**
14826
15022
  * The scale to apply to the inverse inertia of collider1 for resolving this constraint.
14827
15023
  */ function get() {
14828
- return this._collider.inertiaScale;
15024
+ return this._colliderInfo.inertiaScale;
14829
15025
  },
14830
15026
  set: function set(value) {
14831
- if (value !== this._collider.inertiaScale) {
14832
- this._collider.inertiaScale = value;
15027
+ if (value !== this._colliderInfo.inertiaScale) {
15028
+ this._colliderInfo.inertiaScale = value;
14833
15029
  this._nativeJoint.setInertiaScale(value);
14834
15030
  }
14835
15031
  }
@@ -14865,12 +15061,27 @@ var Joint = /*#__PURE__*/ function(Component1) {
14865
15061
  ]);
14866
15062
  return Joint;
14867
15063
  }(Component);
15064
+ __decorate([
15065
+ ignoreClone
15066
+ ], Joint.prototype, "_colliderInfo", void 0);
15067
+ __decorate([
15068
+ ignoreClone
15069
+ ], Joint.prototype, "_connectedColliderInfo", void 0);
15070
+ __decorate([
15071
+ ignoreClone
15072
+ ], Joint.prototype, "_nativeJoint", void 0);
15073
+ __decorate([
15074
+ ignoreClone
15075
+ ], Joint.prototype, "_force", void 0);
15076
+ __decorate([
15077
+ ignoreClone
15078
+ ], Joint.prototype, "_torque", void 0);
14868
15079
  Joint = __decorate([
14869
15080
  dependentComponents(Collider, DependentMode.CheckOnly)
14870
15081
  ], Joint);
14871
15082
  /**
14872
15083
  * @internal
14873
- */ var JointCollider = function JointCollider() {
15084
+ */ var JointColliderInfo = function JointColliderInfo() {
14874
15085
  this.collider = null;
14875
15086
  this.massScale = 0;
14876
15087
  this.inertiaScale = 0;
@@ -14887,7 +15098,7 @@ Joint = __decorate([
14887
15098
  /**
14888
15099
  * @internal
14889
15100
  */ _proto._onAwake = function _onAwake() {
14890
- var collider = this._collider;
15101
+ var collider = this._colliderInfo;
14891
15102
  collider.collider = this.entity.getComponent(Collider);
14892
15103
  this._nativeJoint = PhysicsScene._nativePhysics.createFixedJoint(collider.collider._nativeCollider);
14893
15104
  };
@@ -14921,11 +15132,22 @@ Joint = __decorate([
14921
15132
  /**
14922
15133
  * @internal
14923
15134
  */ _proto._onAwake = function _onAwake() {
14924
- var collider = this._collider;
15135
+ var collider = this._colliderInfo;
14925
15136
  collider.localPosition = new Vector3();
14926
15137
  collider.collider = this.entity.getComponent(Collider);
14927
15138
  this._nativeJoint = PhysicsScene._nativePhysics.createHingeJoint(collider.collider._nativeCollider);
14928
15139
  };
15140
+ /**
15141
+ * @internal
15142
+ */ _proto._cloneTo = function _cloneTo(target) {
15143
+ target.axis = this.axis;
15144
+ target.swingOffset = this.swingOffset;
15145
+ target.useLimits = this.useLimits;
15146
+ target.useMotor = this.useMotor;
15147
+ target.useSpring = this.useSpring;
15148
+ target.motor = this.motor;
15149
+ target.limits = this.limits;
15150
+ };
14929
15151
  _create_class(HingeJoint, [
14930
15152
  {
14931
15153
  key: "axis",
@@ -14947,10 +15169,10 @@ Joint = __decorate([
14947
15169
  get: /**
14948
15170
  * The swing offset.
14949
15171
  */ function get() {
14950
- return this._collider.localPosition;
15172
+ return this._colliderInfo.localPosition;
14951
15173
  },
14952
15174
  set: function set(value) {
14953
- var swingOffset = this._collider.localPosition;
15175
+ var swingOffset = this._colliderInfo.localPosition;
14954
15176
  if (value !== swingOffset) {
14955
15177
  swingOffset.copyFrom(value);
14956
15178
  }
@@ -15053,6 +15275,21 @@ Joint = __decorate([
15053
15275
  ]);
15054
15276
  return HingeJoint;
15055
15277
  }(Joint);
15278
+ __decorate([
15279
+ ignoreClone
15280
+ ], HingeJoint.prototype, "_axis", void 0);
15281
+ __decorate([
15282
+ ignoreClone
15283
+ ], HingeJoint.prototype, "_hingeFlags", void 0);
15284
+ __decorate([
15285
+ ignoreClone
15286
+ ], HingeJoint.prototype, "_useSpring", void 0);
15287
+ __decorate([
15288
+ ignoreClone
15289
+ ], HingeJoint.prototype, "_jointMonitor", void 0);
15290
+ __decorate([
15291
+ ignoreClone
15292
+ ], HingeJoint.prototype, "_limits", void 0);
15056
15293
 
15057
15294
  /**
15058
15295
  * A joint that maintains an upper or lower bound (or both) on the distance between two points on different objects.
@@ -15072,21 +15309,31 @@ Joint = __decorate([
15072
15309
  /**
15073
15310
  * @internal
15074
15311
  */ _proto._onAwake = function _onAwake() {
15075
- var collider = this._collider;
15312
+ var collider = this._colliderInfo;
15076
15313
  collider.localPosition = new Vector3();
15077
15314
  collider.collider = this.entity.getComponent(Collider);
15078
15315
  this._nativeJoint = PhysicsScene._nativePhysics.createSpringJoint(collider.collider._nativeCollider);
15079
15316
  };
15317
+ /**
15318
+ * @internal
15319
+ */ _proto._cloneTo = function _cloneTo(target) {
15320
+ target.swingOffset = this.swingOffset;
15321
+ target.minDistance = this.minDistance;
15322
+ target.maxDistance = this.maxDistance;
15323
+ target.tolerance = this.tolerance;
15324
+ target.stiffness = this.stiffness;
15325
+ target.damping = this.damping;
15326
+ };
15080
15327
  _create_class(SpringJoint, [
15081
15328
  {
15082
15329
  key: "swingOffset",
15083
15330
  get: /**
15084
15331
  * The swing offset.
15085
15332
  */ function get() {
15086
- return this._collider.localPosition;
15333
+ return this._colliderInfo.localPosition;
15087
15334
  },
15088
15335
  set: function set(value) {
15089
- var swingOffset = this._collider.localPosition;
15336
+ var swingOffset = this._colliderInfo.localPosition;
15090
15337
  if (value !== swingOffset) {
15091
15338
  swingOffset.copyFrom(value);
15092
15339
  }
@@ -15211,6 +15458,15 @@ Joint = __decorate([
15211
15458
  var _proto = ColliderShape.prototype;
15212
15459
  /**
15213
15460
  * @internal
15461
+ */ _proto._cloneTo = function _cloneTo(target) {
15462
+ target.contactOffset = this.contactOffset;
15463
+ target.rotation = this.rotation;
15464
+ target.position = this.position;
15465
+ target.isTrigger = this.isTrigger;
15466
+ target.material = this.material;
15467
+ };
15468
+ /**
15469
+ * @internal
15214
15470
  */ _proto._destroy = function _destroy() {
15215
15471
  this._material._destroy();
15216
15472
  this._nativeShape.destroy();
@@ -15312,6 +15568,30 @@ Joint = __decorate([
15312
15568
  (function() {
15313
15569
  ColliderShape._idGenerator = 0;
15314
15570
  })();
15571
+ __decorate([
15572
+ ignoreClone
15573
+ ], ColliderShape.prototype, "_collider", void 0);
15574
+ __decorate([
15575
+ ignoreClone
15576
+ ], ColliderShape.prototype, "_nativeShape", void 0);
15577
+ __decorate([
15578
+ ignoreClone
15579
+ ], ColliderShape.prototype, "_id", void 0);
15580
+ __decorate([
15581
+ ignoreClone
15582
+ ], ColliderShape.prototype, "_material", void 0);
15583
+ __decorate([
15584
+ ignoreClone
15585
+ ], ColliderShape.prototype, "_isTrigger", void 0);
15586
+ __decorate([
15587
+ ignoreClone
15588
+ ], ColliderShape.prototype, "_rotation", void 0);
15589
+ __decorate([
15590
+ ignoreClone
15591
+ ], ColliderShape.prototype, "_position", void 0);
15592
+ __decorate([
15593
+ ignoreClone
15594
+ ], ColliderShape.prototype, "_contactOffset", void 0);
15315
15595
 
15316
15596
  /**
15317
15597
  * Physical collider shape for box.
@@ -15328,6 +15608,12 @@ Joint = __decorate([
15328
15608
  return _this;
15329
15609
  }
15330
15610
  var _proto = BoxColliderShape.prototype;
15611
+ /**
15612
+ * @internal
15613
+ */ _proto._cloneTo = function _cloneTo(target) {
15614
+ ColliderShape1.prototype._cloneTo.call(this, target);
15615
+ target.size = this.size;
15616
+ };
15331
15617
  _proto._setSize = function _setSize() {
15332
15618
  this._nativeShape.setSize(this._size);
15333
15619
  };
@@ -15348,6 +15634,9 @@ Joint = __decorate([
15348
15634
  ]);
15349
15635
  return BoxColliderShape;
15350
15636
  }(ColliderShape);
15637
+ __decorate([
15638
+ ignoreClone
15639
+ ], BoxColliderShape.prototype, "_size", void 0);
15351
15640
 
15352
15641
  /**
15353
15642
  * Physical collider shape for sphere.
@@ -15360,6 +15649,11 @@ Joint = __decorate([
15360
15649
  _this._nativeShape = PhysicsScene._nativePhysics.createSphereColliderShape(_this._id, _this._radius, _this._material._nativeMaterial);
15361
15650
  return _this;
15362
15651
  }
15652
+ var _proto = SphereColliderShape.prototype;
15653
+ _proto._cloneTo = function _cloneTo(target) {
15654
+ ColliderShape1.prototype._cloneTo.call(this, target);
15655
+ target.radius = this.radius;
15656
+ };
15363
15657
  _create_class(SphereColliderShape, [
15364
15658
  {
15365
15659
  key: "radius",
@@ -15378,6 +15672,9 @@ Joint = __decorate([
15378
15672
  ]);
15379
15673
  return SphereColliderShape;
15380
15674
  }(ColliderShape);
15675
+ __decorate([
15676
+ ignoreClone
15677
+ ], SphereColliderShape.prototype, "_radius", void 0);
15381
15678
 
15382
15679
  /**
15383
15680
  * Physical collider shape plane.
@@ -15405,6 +15702,15 @@ Joint = __decorate([
15405
15702
  _this._nativeShape = PhysicsScene._nativePhysics.createCapsuleColliderShape(_this._id, _this._radius, _this._height, _this._material._nativeMaterial);
15406
15703
  return _this;
15407
15704
  }
15705
+ var _proto = CapsuleColliderShape.prototype;
15706
+ /**
15707
+ * @internal
15708
+ */ _proto._cloneTo = function _cloneTo(target) {
15709
+ ColliderShape1.prototype._cloneTo.call(this, target);
15710
+ target.radius = this.radius;
15711
+ target.height = this.height;
15712
+ target.upAxis = this.upAxis;
15713
+ };
15408
15714
  _create_class(CapsuleColliderShape, [
15409
15715
  {
15410
15716
  key: "radius",
@@ -15451,6 +15757,15 @@ Joint = __decorate([
15451
15757
  ]);
15452
15758
  return CapsuleColliderShape;
15453
15759
  }(ColliderShape);
15760
+ __decorate([
15761
+ ignoreClone
15762
+ ], CapsuleColliderShape.prototype, "_radius", void 0);
15763
+ __decorate([
15764
+ ignoreClone
15765
+ ], CapsuleColliderShape.prototype, "_height", void 0);
15766
+ __decorate([
15767
+ ignoreClone
15768
+ ], CapsuleColliderShape.prototype, "_upAxis", void 0);
15454
15769
 
15455
15770
  /**
15456
15771
  * Pointer Manager.
@@ -15688,8 +16003,8 @@ Joint = __decorate([
15688
16003
  continue;
15689
16004
  }
15690
16005
  var cameras = scene._activeCameras;
15691
- for(var j = 0; j < cameras.length; j++){
15692
- var camera = cameras[i];
16006
+ for(var j = cameras.length - 1; j >= 0; j--){
16007
+ var camera = cameras[j];
15693
16008
  if (!camera.enabled || camera.renderTarget) {
15694
16009
  continue;
15695
16010
  }
@@ -16381,10 +16696,6 @@ ShaderPool.init();
16381
16696
  magentaMaterial.isGCIgnored = true;
16382
16697
  magentaMaterial.shaderData.setColor("material_BaseColor", new Color(1.0, 0.0, 1.01, 1.0));
16383
16698
  _this._magentaMaterial = magentaMaterial;
16384
- var backgroundTextureMaterial = new Material(_assert_this_initialized(_this), Shader.find("background-texture"));
16385
- backgroundTextureMaterial.isGCIgnored = true;
16386
- backgroundTextureMaterial.renderState.depthState.compareFunction = CompareFunction.LessEqual;
16387
- _this._backgroundTextureMaterial = backgroundTextureMaterial;
16388
16699
  var innerSettings = _this._settings;
16389
16700
  var colorSpace = configuration.colorSpace || ColorSpace.Linear;
16390
16701
  colorSpace === ColorSpace.Gamma && _this._macroCollection.enable(Engine._gammaMacro);
@@ -16934,7 +17245,7 @@ ShaderPool.init();
16934
17245
  program.uploadAll(program.materialUniformBlock, materialShaderData);
16935
17246
  program.uploadUnGroupTextures();
16936
17247
  renderState._apply(engine, false, pass._renderStateDataMap, materialShaderData);
16937
- rhi.drawPrimitive(mesh, mesh.subMesh, program);
17248
+ rhi.drawPrimitive(mesh._primitive, mesh.subMesh, program);
16938
17249
  cameraShaderData.setMatrix(RenderContext.vpMatrixProperty, originViewProjMatrix);
16939
17250
  };
16940
17251
  _create_class(Sky, [
@@ -17002,34 +17313,29 @@ ShaderPool.init();
17002
17313
  this./** @internal */ _textureFillMode = BackgroundTextureFillMode.AspectFitHeight;
17003
17314
  this._texture = null;
17004
17315
  this._initMesh(_engine);
17316
+ this._initMaterial(_engine);
17005
17317
  }
17006
17318
  var _proto = Background.prototype;
17007
17319
  /**
17008
17320
  * @internal
17009
17321
  */ _proto.destroy = function destroy() {
17322
+ this.texture = null;
17010
17323
  this._mesh._addReferCount(-1);
17011
17324
  this._mesh = null;
17012
- this.texture = null;
17325
+ this._material._addReferCount(-1);
17326
+ this._material = null;
17013
17327
  this.solidColor = null;
17014
17328
  this.sky.destroy();
17015
17329
  };
17016
17330
  /**
17017
17331
  * @internal
17018
- * Standalone for CanvasRenderer plugin.
17019
- */ _proto._initMesh = function _initMesh(engine) {
17020
- this._mesh = this._createPlane(engine);
17021
- this._mesh._addReferCount(1);
17022
- };
17023
- /**
17024
- * @internal
17025
17332
  */ _proto._resizeBackgroundTexture = function _resizeBackgroundTexture() {
17333
+ var _this = this, texture = _this._texture, mesh = _this._mesh;
17026
17334
  if (!this._texture) {
17027
17335
  return;
17028
17336
  }
17029
- var canvas = this._engine.canvas;
17030
- var width = canvas.width, height = canvas.height;
17031
- var _this = this, _backgroundTextureMesh = _this._mesh;
17032
- var positions = _backgroundTextureMesh.getPositions();
17337
+ var _this__engine_canvas = this._engine.canvas, width = _this__engine_canvas.width, height = _this__engine_canvas.height;
17338
+ var positions = mesh.getPositions();
17033
17339
  switch(this._textureFillMode){
17034
17340
  case BackgroundTextureFillMode.Fill:
17035
17341
  positions[0].set(-1, -1, 1);
@@ -17038,22 +17344,31 @@ ShaderPool.init();
17038
17344
  positions[3].set(1, 1, 1);
17039
17345
  break;
17040
17346
  case BackgroundTextureFillMode.AspectFitWidth:
17041
- var fitWidthScale = this._texture.height * width / this.texture.width / height;
17347
+ var fitWidthScale = texture.height * width / texture.width / height;
17042
17348
  positions[0].set(-1, -fitWidthScale, 1);
17043
17349
  positions[1].set(1, -fitWidthScale, 1);
17044
17350
  positions[2].set(-1, fitWidthScale, 1);
17045
17351
  positions[3].set(1, fitWidthScale, 1);
17046
17352
  break;
17047
17353
  case BackgroundTextureFillMode.AspectFitHeight:
17048
- var fitHeightScale = this._texture.width * height / this.texture.height / width;
17354
+ var fitHeightScale = texture.width * height / texture.height / width;
17049
17355
  positions[0].set(-fitHeightScale, -1, 1);
17050
17356
  positions[1].set(fitHeightScale, -1, 1);
17051
17357
  positions[2].set(-fitHeightScale, 1, 1);
17052
17358
  positions[3].set(fitHeightScale, 1, 1);
17053
17359
  break;
17054
17360
  }
17055
- _backgroundTextureMesh.setPositions(positions);
17056
- _backgroundTextureMesh.uploadData(false);
17361
+ mesh.setPositions(positions);
17362
+ mesh.uploadData(false);
17363
+ };
17364
+ _proto._initMesh = function _initMesh(engine) {
17365
+ this._mesh = this._createPlane(engine);
17366
+ this._mesh._addReferCount(1);
17367
+ };
17368
+ _proto._initMaterial = function _initMaterial(engine) {
17369
+ var material = this._material = new Material(engine, Shader.find("background-texture"));
17370
+ material.renderState.depthState.compareFunction = CompareFunction.LessEqual;
17371
+ material._addReferCount(1);
17057
17372
  };
17058
17373
  _proto._createPlane = function _createPlane(engine) {
17059
17374
  var mesh = new ModelMesh(engine);
@@ -17094,14 +17409,14 @@ ShaderPool.init();
17094
17409
  (_value = value) == null ? void 0 : _value._addReferCount(1);
17095
17410
  (_this__texture = this._texture) == null ? void 0 : _this__texture._addReferCount(-1);
17096
17411
  this._texture = value;
17097
- this._engine._backgroundTextureMaterial.shaderData.setTexture("material_BaseTexture", value);
17412
+ this._material.shaderData.setTexture("material_BaseTexture", value);
17413
+ this._resizeBackgroundTexture();
17098
17414
  }
17099
17415
  }
17100
17416
  },
17101
17417
  {
17102
17418
  key: "textureFillMode",
17103
17419
  get: /**
17104
- * @internal
17105
17420
  * Background texture fill mode.
17106
17421
  * @remarks When `mode` is `BackgroundMode.Texture`, the property will take effects.
17107
17422
  * @defaultValue `BackgroundTextureFillMode.FitHeight`
@@ -17219,40 +17534,44 @@ ShaderPool.init();
17219
17534
  };
17220
17535
  _proto.callScriptOnUpdate = function callScriptOnUpdate(deltaTime) {
17221
17536
  this._onUpdateScripts.forEach(function(element) {
17222
- if (element._started) {
17223
- element.onUpdate(deltaTime);
17224
- }
17537
+ element._started && element.onUpdate(deltaTime);
17538
+ }, function(element, index) {
17539
+ element._onUpdateIndex = index;
17225
17540
  });
17226
17541
  };
17227
17542
  _proto.callScriptOnLateUpdate = function callScriptOnLateUpdate(deltaTime) {
17228
17543
  this._onLateUpdateScripts.forEach(function(element) {
17229
- if (element._started) {
17230
- element.onLateUpdate(deltaTime);
17231
- }
17544
+ element._started && element.onLateUpdate(deltaTime);
17545
+ }, function(element, index) {
17546
+ element._onLateUpdateIndex = index;
17232
17547
  });
17233
17548
  };
17234
17549
  _proto.callScriptOnPhysicsUpdate = function callScriptOnPhysicsUpdate() {
17235
17550
  this._onPhysicsUpdateScripts.forEach(function(element) {
17236
- if (element._started) {
17237
- element.onPhysicsUpdate();
17238
- }
17551
+ element._started && element.onPhysicsUpdate();
17552
+ }, function(element, index) {
17553
+ element._onPhysicsUpdateIndex = index;
17239
17554
  });
17240
17555
  };
17241
17556
  _proto.callAnimationUpdate = function callAnimationUpdate(deltaTime) {
17242
17557
  this._onUpdateAnimations.forEach(function(element) {
17243
17558
  element.engine.time.frameCount > element._playFrameCount && element.update(deltaTime);
17559
+ }, function(element, index) {
17560
+ element._onUpdateIndex = index;
17244
17561
  });
17245
17562
  };
17246
17563
  _proto.callRendererOnUpdate = function callRendererOnUpdate(deltaTime) {
17247
17564
  this._onUpdateRenderers.forEach(function(element) {
17248
17565
  element.update(deltaTime);
17566
+ }, function(element, index) {
17567
+ element._onUpdateIndex = index;
17249
17568
  });
17250
17569
  };
17251
17570
  _proto.handlingInvalidScripts = function handlingInvalidScripts() {
17252
17571
  var _this = this, pendingDestroyScripts = _this._disposeDestroyScripts, disposeDestroyScripts = _this._pendingDestroyScripts;
17253
17572
  this._disposeDestroyScripts = disposeDestroyScripts;
17254
17573
  this._pendingDestroyScripts = pendingDestroyScripts;
17255
- length = disposeDestroyScripts.length;
17574
+ var length = disposeDestroyScripts.length;
17256
17575
  if (length > 0) {
17257
17576
  for(var i = length - 1; i >= 0; i--){
17258
17577
  disposeDestroyScripts[i].onDestroy();
@@ -17263,11 +17582,15 @@ ShaderPool.init();
17263
17582
  _proto.callCameraOnBeginRender = function callCameraOnBeginRender(camera) {
17264
17583
  camera.entity._scripts.forEach(function(element) {
17265
17584
  element.onBeginRender(camera);
17585
+ }, function(element, index) {
17586
+ element._entityScriptsIndex = index;
17266
17587
  });
17267
17588
  };
17268
17589
  _proto.callCameraOnEndRender = function callCameraOnEndRender(camera) {
17269
17590
  camera.entity._scripts.forEach(function(element) {
17270
17591
  element.onEndRender(camera);
17592
+ }, function(element, index) {
17593
+ element._entityScriptsIndex = index;
17271
17594
  });
17272
17595
  };
17273
17596
  _proto.getActiveChangedTempList = function getActiveChangedTempList() {
@@ -17669,11 +17992,6 @@ ShaderPool.init();
17669
17992
  ]);
17670
17993
  return Light;
17671
17994
  }(Component);
17672
- (function() {
17673
- /**
17674
- * Each type of light source is at most 10, beyond which it will not take effect.
17675
- * */ Light._maxLight = 10;
17676
- })();
17677
17995
  __decorate([
17678
17996
  ignoreClone
17679
17997
  ], Light.prototype, "_lightIndex", void 0);
@@ -17691,13 +18009,12 @@ __decorate([
17691
18009
  var _proto = DirectLight.prototype;
17692
18010
  /**
17693
18011
  * @internal
17694
- */ _proto._appendData = function _appendData(lightIndex) {
18012
+ */ _proto._appendData = function _appendData(lightIndex, data) {
17695
18013
  var cullingMaskStart = lightIndex * 2;
17696
18014
  var colorStart = lightIndex * 3;
17697
18015
  var directionStart = lightIndex * 3;
17698
18016
  var lightColor = this._getLightIntensityColor();
17699
18017
  var direction = this.direction;
17700
- var data = DirectLight._combinedData;
17701
18018
  var cullingMask = this.cullingMask;
17702
18019
  data.cullingMask[cullingMaskStart] = cullingMask & 65535;
17703
18020
  data.cullingMask[cullingMaskStart + 1] = cullingMask >>> 16 & 65535;
@@ -17726,8 +18043,7 @@ __decorate([
17726
18043
  };
17727
18044
  /**
17728
18045
  * @internal
17729
- */ DirectLight._updateShaderData = function _updateShaderData(shaderData) {
17730
- var data = DirectLight._combinedData;
18046
+ */ DirectLight._updateShaderData = function _updateShaderData(shaderData, data) {
17731
18047
  shaderData.setIntArray(DirectLight._cullingMaskProperty, data.cullingMask);
17732
18048
  shaderData.setFloatArray(DirectLight._colorProperty, data.color);
17733
18049
  shaderData.setFloatArray(DirectLight._directionProperty, data.direction);
@@ -17770,13 +18086,6 @@ __decorate([
17770
18086
  (function() {
17771
18087
  DirectLight._directionProperty = ShaderProperty.getByName("scene_DirectLightDirection");
17772
18088
  })();
17773
- (function() {
17774
- DirectLight._combinedData = {
17775
- cullingMask: new Int32Array(Light._maxLight * 2),
17776
- color: new Float32Array(Light._maxLight * 3),
17777
- direction: new Float32Array(Light._maxLight * 3)
17778
- };
17779
- })();
17780
18089
 
17781
18090
  /**
17782
18091
  * Point light.
@@ -17791,14 +18100,13 @@ __decorate([
17791
18100
  var _proto = PointLight.prototype;
17792
18101
  /**
17793
18102
  * @internal
17794
- */ _proto._appendData = function _appendData(lightIndex) {
18103
+ */ _proto._appendData = function _appendData(lightIndex, data) {
17795
18104
  var cullingMaskStart = lightIndex * 2;
17796
18105
  var colorStart = lightIndex * 3;
17797
18106
  var positionStart = lightIndex * 3;
17798
18107
  var distanceStart = lightIndex;
17799
18108
  var lightColor = this._getLightIntensityColor();
17800
18109
  var lightPosition = this.position;
17801
- var data = PointLight._combinedData;
17802
18110
  var cullingMask = this.cullingMask;
17803
18111
  data.cullingMask[cullingMaskStart] = cullingMask & 65535;
17804
18112
  data.cullingMask[cullingMaskStart + 1] = cullingMask >>> 16 & 65535;
@@ -17828,8 +18136,7 @@ __decorate([
17828
18136
  };
17829
18137
  /**
17830
18138
  * @internal
17831
- */ PointLight._updateShaderData = function _updateShaderData(shaderData) {
17832
- var data = PointLight._combinedData;
18139
+ */ PointLight._updateShaderData = function _updateShaderData(shaderData, data) {
17833
18140
  shaderData.setIntArray(PointLight._cullingMaskProperty, data.cullingMask);
17834
18141
  shaderData.setFloatArray(PointLight._colorProperty, data.color);
17835
18142
  shaderData.setFloatArray(PointLight._positionProperty, data.position);
@@ -17867,14 +18174,6 @@ __decorate([
17867
18174
  (function() {
17868
18175
  PointLight._distanceProperty = ShaderProperty.getByName("scene_PointLightDistance");
17869
18176
  })();
17870
- (function() {
17871
- PointLight._combinedData = {
17872
- cullingMask: new Int32Array(Light._maxLight * 2),
17873
- color: new Float32Array(Light._maxLight * 3),
17874
- position: new Float32Array(Light._maxLight * 3),
17875
- distance: new Float32Array(Light._maxLight)
17876
- };
17877
- })();
17878
18177
 
17879
18178
  /**
17880
18179
  * Spot light.
@@ -17893,7 +18192,7 @@ __decorate([
17893
18192
  var _proto = SpotLight.prototype;
17894
18193
  /**
17895
18194
  * @internal
17896
- */ _proto._appendData = function _appendData(lightIndex) {
18195
+ */ _proto._appendData = function _appendData(lightIndex, data) {
17897
18196
  var cullingMaskStart = lightIndex * 2;
17898
18197
  var colorStart = lightIndex * 3;
17899
18198
  var positionStart = lightIndex * 3;
@@ -17904,7 +18203,6 @@ __decorate([
17904
18203
  var lightColor = this._getLightIntensityColor();
17905
18204
  var position = this.position;
17906
18205
  var direction = this.direction;
17907
- var data = SpotLight._combinedData;
17908
18206
  var cullingMask = this.cullingMask;
17909
18207
  data.cullingMask[cullingMaskStart] = cullingMask & 65535;
17910
18208
  data.cullingMask[cullingMaskStart + 1] = cullingMask >>> 16 & 65535;
@@ -17939,8 +18237,7 @@ __decorate([
17939
18237
  };
17940
18238
  /**
17941
18239
  * @internal
17942
- */ SpotLight._updateShaderData = function _updateShaderData(shaderData) {
17943
- var data = SpotLight._combinedData;
18240
+ */ SpotLight._updateShaderData = function _updateShaderData(shaderData, data) {
17944
18241
  shaderData.setIntArray(SpotLight._cullingMaskProperty, data.cullingMask);
17945
18242
  shaderData.setFloatArray(SpotLight._colorProperty, data.color);
17946
18243
  shaderData.setFloatArray(SpotLight._positionProperty, data.position);
@@ -18010,17 +18307,6 @@ __decorate([
18010
18307
  (function() {
18011
18308
  SpotLight._penumbraCosProperty = ShaderProperty.getByName("scene_SpotLightPenumbraCos");
18012
18309
  })();
18013
- (function() {
18014
- SpotLight._combinedData = {
18015
- cullingMask: new Int32Array(Light._maxLight * 2),
18016
- color: new Float32Array(Light._maxLight * 3),
18017
- position: new Float32Array(Light._maxLight * 3),
18018
- direction: new Float32Array(Light._maxLight * 3),
18019
- distance: new Float32Array(Light._maxLight),
18020
- angleCos: new Float32Array(Light._maxLight),
18021
- penumbraCos: new Float32Array(Light._maxLight)
18022
- };
18023
- })();
18024
18310
 
18025
18311
  /**
18026
18312
  * Light manager.
@@ -18029,6 +18315,26 @@ __decorate([
18029
18315
  /** @internal */ this._spotLights = new DisorderedArray();
18030
18316
  /** @internal */ this._pointLights = new DisorderedArray();
18031
18317
  /** @internal */ this._directLights = new DisorderedArray();
18318
+ this._directData = {
18319
+ cullingMask: new Int32Array(LightManager._maxLight * 2),
18320
+ color: new Float32Array(LightManager._maxLight * 3),
18321
+ direction: new Float32Array(LightManager._maxLight * 3)
18322
+ };
18323
+ this._pointData = {
18324
+ cullingMask: new Int32Array(LightManager._maxLight * 2),
18325
+ color: new Float32Array(LightManager._maxLight * 3),
18326
+ position: new Float32Array(LightManager._maxLight * 3),
18327
+ distance: new Float32Array(LightManager._maxLight)
18328
+ };
18329
+ this._spotData = {
18330
+ cullingMask: new Int32Array(LightManager._maxLight * 2),
18331
+ color: new Float32Array(LightManager._maxLight * 3),
18332
+ position: new Float32Array(LightManager._maxLight * 3),
18333
+ direction: new Float32Array(LightManager._maxLight * 3),
18334
+ distance: new Float32Array(LightManager._maxLight),
18335
+ angleCos: new Float32Array(LightManager._maxLight),
18336
+ penumbraCos: new Float32Array(LightManager._maxLight)
18337
+ };
18032
18338
  }
18033
18339
  var _proto = LightManager.prototype;
18034
18340
  /**
@@ -18088,38 +18394,34 @@ __decorate([
18088
18394
  /**
18089
18395
  * @internal
18090
18396
  */ _proto._updateShaderData = function _updateShaderData(shaderData) {
18091
- var spotLight = this._spotLights;
18092
- var pointLight = this._pointLights;
18093
- var directLight = this._directLights;
18397
+ var _this = this, spotLight = _this._spotLights, pointLight = _this._pointLights, directLight = _this._directLights;
18398
+ var _this1 = this, spotData = _this1._spotData, pointData = _this1._pointData, directData = _this1._directData;
18094
18399
  var spotLightCount = spotLight.length;
18095
18400
  var pointLightCount = pointLight.length;
18096
18401
  var directLightCount = directLight.length;
18097
- for(var i = 0, len = spotLightCount; i < len; i++){
18098
- var light = spotLight.get(i);
18099
- light._appendData(i);
18402
+ for(var i = 0; i < spotLightCount; i++){
18403
+ spotLight.get(i)._appendData(i, spotData);
18100
18404
  }
18101
- for(var i1 = 0, len1 = pointLightCount; i1 < len1; i1++){
18102
- var light1 = pointLight.get(i1);
18103
- light1._appendData(i1);
18405
+ for(var i1 = 0; i1 < pointLightCount; i1++){
18406
+ pointLight.get(i1)._appendData(i1, pointData);
18104
18407
  }
18105
- for(var i2 = 0, len2 = directLightCount; i2 < len2; i2++){
18106
- var light2 = directLight.get(i2);
18107
- light2._appendData(i2);
18408
+ for(var i2 = 0; i2 < directLightCount; i2++){
18409
+ directLight.get(i2)._appendData(i2, directData);
18108
18410
  }
18109
18411
  if (directLightCount) {
18110
- DirectLight._updateShaderData(shaderData);
18412
+ DirectLight._updateShaderData(shaderData, directData);
18111
18413
  shaderData.enableMacro("SCENE_DIRECT_LIGHT_COUNT", directLightCount.toString());
18112
18414
  } else {
18113
18415
  shaderData.disableMacro("SCENE_DIRECT_LIGHT_COUNT");
18114
18416
  }
18115
18417
  if (pointLightCount) {
18116
- PointLight._updateShaderData(shaderData);
18418
+ PointLight._updateShaderData(shaderData, pointData);
18117
18419
  shaderData.enableMacro("SCENE_POINT_LIGHT_COUNT", pointLightCount.toString());
18118
18420
  } else {
18119
18421
  shaderData.disableMacro("SCENE_POINT_LIGHT_COUNT");
18120
18422
  }
18121
18423
  if (spotLightCount) {
18122
- SpotLight._updateShaderData(shaderData);
18424
+ SpotLight._updateShaderData(shaderData, spotData);
18123
18425
  shaderData.enableMacro("SCENE_SPOT_LIGHT_COUNT", spotLightCount.toString());
18124
18426
  } else {
18125
18427
  shaderData.disableMacro("SCENE_SPOT_LIGHT_COUNT");
@@ -18160,6 +18462,11 @@ __decorate([
18160
18462
  };
18161
18463
  return LightManager;
18162
18464
  }();
18465
+ (function() {
18466
+ /**
18467
+ * Each type of light source is at most 10, beyond which it will not take effect.
18468
+ * */ LightManager._maxLight = 10;
18469
+ })();
18163
18470
 
18164
18471
  /**
18165
18472
  * Scene.
@@ -18190,6 +18497,7 @@ __decorate([
18190
18497
  _this._fogEnd = 300;
18191
18498
  _this._fogDensity = 0.01;
18192
18499
  _this._fogParams = new Vector4();
18500
+ _this._isActive = true;
18193
18501
  _this.name = name || "";
18194
18502
  var shaderData = _this.shaderData;
18195
18503
  shaderData._addReferCount(1);
@@ -18437,6 +18745,24 @@ __decorate([
18437
18745
  this._fogParams.w = density / Math.sqrt(Math.LN2);
18438
18746
  };
18439
18747
  _create_class(Scene, [
18748
+ {
18749
+ key: "isActive",
18750
+ get: /**
18751
+ * Whether the scene is active.
18752
+ */ function get() {
18753
+ return this._isActive;
18754
+ },
18755
+ set: function set(value) {
18756
+ if (this._isActive !== value) {
18757
+ this._isActive = value;
18758
+ if (value) {
18759
+ this._sceneManager && this._processActive(true);
18760
+ } else {
18761
+ this._sceneManager && this._processActive(false);
18762
+ }
18763
+ }
18764
+ }
18765
+ },
18440
18766
  {
18441
18767
  key: "shaderData",
18442
18768
  get: /**
@@ -18755,7 +19081,11 @@ __decorate([
18755
19081
  * @internal
18756
19082
  */ _proto._onDestroy = function _onDestroy() {
18757
19083
  Component1.prototype._onDestroy.call(this);
18758
- this.scene._componentsManager.addPendingDestroyScript(this);
19084
+ if (this.scene) {
19085
+ this.scene._componentsManager.addPendingDestroyScript(this);
19086
+ } else {
19087
+ this.onDestroy();
19088
+ }
18759
19089
  };
18760
19090
  return Script;
18761
19091
  }(Component);
@@ -18898,7 +19228,7 @@ var passNum = 0;
18898
19228
  _proto.drawBatches = function drawBatches(camera) {
18899
19229
  var _this = this, engine = _this._engine, batchedQueue = _this._batchedQueue;
18900
19230
  var mesh = this._meshes[this._flushId];
18901
- var subMeshes = mesh.subMeshes;
19231
+ var subMeshes = mesh.subMeshes, primitive = mesh._primitive;
18902
19232
  var maskManager = engine._spriteMaskManager;
18903
19233
  var sceneData = camera.scene.shaderData;
18904
19234
  var cameraData = camera.shaderData;
@@ -18928,7 +19258,7 @@ var passNum = 0;
18928
19258
  program.uploadAll(program.rendererUniformBlock, renderer.shaderData);
18929
19259
  program.uploadAll(program.materialUniformBlock, material.shaderData);
18930
19260
  material.renderState._apply(engine, false, shaderPass._renderStateDataMap, material.shaderData);
18931
- engine._hardwareRenderer.drawPrimitive(mesh._primitive, subMesh, program);
19261
+ engine._hardwareRenderer.drawPrimitive(primitive, subMesh, program);
18932
19262
  maskManager.postRender(renderer);
18933
19263
  }
18934
19264
  };
@@ -20305,8 +20635,8 @@ var /**
20305
20635
  };
20306
20636
  _proto._drawBackgroundTexture = function _drawBackgroundTexture(engine, background) {
20307
20637
  var rhi = engine._hardwareRenderer;
20308
- var material = engine._backgroundTextureMaterial, canvas = engine.canvas;
20309
- var mesh = background._mesh;
20638
+ var canvas = engine.canvas;
20639
+ var material = background._material, mesh = background._mesh;
20310
20640
  if ((this._lastCanvasSize.x !== canvas.width || this._lastCanvasSize.y !== canvas.height) && background._textureFillMode !== BackgroundTextureFillMode.Fill) {
20311
20641
  this._lastCanvasSize.set(canvas.width, canvas.height);
20312
20642
  background._resizeBackgroundTexture();
@@ -20317,7 +20647,7 @@ var /**
20317
20647
  program.uploadAll(program.materialUniformBlock, material.shaderData);
20318
20648
  program.uploadUnGroupTextures();
20319
20649
  (pass._renderState || material.renderState)._apply(engine, false, pass._renderStateDataMap, material.shaderData);
20320
- rhi.drawPrimitive(mesh, mesh.subMesh, program);
20650
+ rhi.drawPrimitive(mesh._primitive, mesh.subMesh, program);
20321
20651
  };
20322
20652
  _proto._callRender = function _callRender(context) {
20323
20653
  var engine = context.camera.engine;
@@ -20481,7 +20811,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
20481
20811
  // Use the intersection of the near clipping plane as the origin point.
20482
20812
  var origin = this._innerViewportToWorldPoint(point.x, point.y, 0.0, invViewProjMat, out.origin);
20483
20813
  // Use the intersection of the far clipping plane as the origin point.
20484
- var direction = this._innerViewportToWorldPoint(point.x, point.y, 1.0, invViewProjMat, out.direction);
20814
+ var direction = this._innerViewportToWorldPoint(point.x, point.y, 1 - MathUtil$1.zeroTolerance, invViewProjMat, out.direction);
20485
20815
  Vector3.subtract(direction, origin, direction);
20486
20816
  direction.normalize();
20487
20817
  return out;
@@ -24119,6 +24449,9 @@ var DirtyFlag;
24119
24449
  this.property = property;
24120
24450
  this.component = target.getComponent(type);
24121
24451
  this.cureType = cureType;
24452
+ var isBlendShape = _instanceof(this.component, SkinnedMeshRenderer);
24453
+ // @todo: Temp solution with blendShape
24454
+ this._isCopyMode = cureType._isCopyMode && !isBlendShape;
24122
24455
  var assemblerType = AnimationCurveOwner.getAssemblerType(type, property);
24123
24456
  this._assembler = new assemblerType();
24124
24457
  this._assembler.initialize(this);
@@ -24150,7 +24483,7 @@ var DirtyFlag;
24150
24483
  this._assembler.setTargetValue(this.defaultValue);
24151
24484
  };
24152
24485
  _proto.getEvaluateValue = function getEvaluateValue(out) {
24153
- if (this.cureType._isCopyMode) {
24486
+ if (this._isCopyMode) {
24154
24487
  this.cureType._setValue(this.baseEvaluateData.value, out);
24155
24488
  return out;
24156
24489
  } else {
@@ -24158,14 +24491,14 @@ var DirtyFlag;
24158
24491
  }
24159
24492
  };
24160
24493
  _proto.saveDefaultValue = function saveDefaultValue() {
24161
- if (this.cureType._isCopyMode) {
24494
+ if (this._isCopyMode) {
24162
24495
  this.cureType._setValue(this.referenceTargetValue, this.defaultValue);
24163
24496
  } else {
24164
24497
  this.defaultValue = this._assembler.getTargetValue();
24165
24498
  }
24166
24499
  };
24167
24500
  _proto.saveFixedPoseValue = function saveFixedPoseValue() {
24168
- if (this.cureType._isCopyMode) {
24501
+ if (this._isCopyMode) {
24169
24502
  this.cureType._setValue(this.referenceTargetValue, this.fixedPoseValue);
24170
24503
  } else {
24171
24504
  this.fixedPoseValue = this._assembler.getTargetValue();
@@ -24174,7 +24507,7 @@ var DirtyFlag;
24174
24507
  _proto.applyValue = function applyValue(value, weight, additive) {
24175
24508
  var cureType = this.cureType;
24176
24509
  if (additive) {
24177
- if (cureType._isCopyMode) {
24510
+ if (this._isCopyMode) {
24178
24511
  cureType._additiveValue(value, weight, this.referenceTargetValue);
24179
24512
  } else {
24180
24513
  var assembler = this._assembler;
@@ -24184,13 +24517,13 @@ var DirtyFlag;
24184
24517
  }
24185
24518
  } else {
24186
24519
  if (weight === 1.0) {
24187
- if (cureType._isCopyMode) {
24520
+ if (this._isCopyMode) {
24188
24521
  cureType._setValue(value, this.referenceTargetValue);
24189
24522
  } else {
24190
24523
  this._assembler.setTargetValue(value);
24191
24524
  }
24192
24525
  } else {
24193
- if (cureType._isCopyMode) {
24526
+ if (this._isCopyMode) {
24194
24527
  var targetValue = this.referenceTargetValue;
24195
24528
  cureType._lerpValue(targetValue, value, weight, targetValue);
24196
24529
  } else {
@@ -24202,7 +24535,7 @@ var DirtyFlag;
24202
24535
  }
24203
24536
  };
24204
24537
  _proto._lerpValue = function _lerpValue(srcValue, destValue, crossWeight) {
24205
- if (this.cureType._isCopyMode) {
24538
+ if (this._isCopyMode) {
24206
24539
  return this.cureType._lerpValue(srcValue, destValue, crossWeight, this.baseEvaluateData.value);
24207
24540
  } else {
24208
24541
  this.baseEvaluateData.value = this.cureType._lerpValue(srcValue, destValue, crossWeight);
@@ -24285,16 +24618,22 @@ AnimationCurveOwner.registerAssembler(Transform, "scale", ScaleAnimationCurveOwn
24285
24618
  /**
24286
24619
  * @internal
24287
24620
  */ var BlendShapeWeightsAnimationCurveOwnerAssembler = /*#__PURE__*/ function() {
24288
- function BlendShapeWeightsAnimationCurveOwnerAssembler() {}
24621
+ function BlendShapeWeightsAnimationCurveOwnerAssembler() {
24622
+ this._skinnedMeshRenderer = [];
24623
+ }
24289
24624
  var _proto = BlendShapeWeightsAnimationCurveOwnerAssembler.prototype;
24290
24625
  _proto.initialize = function initialize(owner) {
24291
- this._skinnedMeshRenderer = owner.target.getComponent(SkinnedMeshRenderer);
24626
+ // @todo: Compatible with multiple SkinnedMeshRenderer in a entity, optimize later.
24627
+ owner.target.getComponents(SkinnedMeshRenderer, this._skinnedMeshRenderer);
24292
24628
  };
24293
24629
  _proto.getTargetValue = function getTargetValue() {
24294
- return this._skinnedMeshRenderer.blendShapeWeights;
24630
+ return this._skinnedMeshRenderer[0].blendShapeWeights;
24295
24631
  };
24296
24632
  _proto.setTargetValue = function setTargetValue(value) {
24297
- this._skinnedMeshRenderer.blendShapeWeights = value;
24633
+ var skinnedMeshRenderer = this._skinnedMeshRenderer;
24634
+ for(var i = 0, n = skinnedMeshRenderer.length; i < n; i++){
24635
+ skinnedMeshRenderer[i].blendShapeWeights = value;
24636
+ }
24298
24637
  };
24299
24638
  return BlendShapeWeightsAnimationCurveOwnerAssembler;
24300
24639
  }();
@@ -26171,7 +26510,6 @@ var AnimatorLayerBlendingMode;
26171
26510
  var state = playState.state;
26172
26511
  var clipDuration = state.clip.length;
26173
26512
  if (this.speed * state.speed >= 0) {
26174
- console.log(999, clipTime, lastClipTime);
26175
26513
  if (clipTime < lastClipTime) {
26176
26514
  this._checkSubTransition(playState, transitions, layerIndex, lastClipTime, state.clipEndTime * clipDuration);
26177
26515
  playState.currentTransitionIndex = 0;
@@ -26960,64 +27298,203 @@ var SunMode;
26960
27298
  SkyProceduralMaterial._sunSimpleMacro = ShaderMacro.getByName("MATERIAL_SUN_SIMPLE");
26961
27299
  })();
26962
27300
 
27301
+ var SubPrimitive = function SubPrimitive() {
27302
+ };
27303
+
26963
27304
  /**
26964
- * Particle Material.
26965
- */ var ParticleMaterial = /*#__PURE__*/ function(BaseMaterial1) {
26966
- _inherits(ParticleMaterial, BaseMaterial1);
26967
- function ParticleMaterial(engine) {
27305
+ * The rendering mode for particle renderer.
27306
+ */ var ParticleRenderMode;
27307
+ (function(ParticleRenderMode) {
27308
+ ParticleRenderMode[ParticleRenderMode[/** Render particles as billboards facing the active camera. */ "Billboard"] = 0] = "Billboard";
27309
+ ParticleRenderMode[ParticleRenderMode[/** Stretch particles in the direction of motion. */ "StretchBillboard"] = 1] = "StretchBillboard";
27310
+ ParticleRenderMode[ParticleRenderMode[/** Render particles as billboards always facing up along the y-Axis. */ "HorizontalBillboard"] = 2] = "HorizontalBillboard";
27311
+ ParticleRenderMode[ParticleRenderMode[/** Render particles as billboards always facing the player, but not pitching along the x-Axis. */ "VerticalBillboard"] = 3] = "VerticalBillboard";
27312
+ ParticleRenderMode[ParticleRenderMode[/** Render particles as meshes. */ "Mesh"] = 4] = "Mesh";
27313
+ ParticleRenderMode[ParticleRenderMode[/** Do not render particles. */ "None"] = 5] = "None";
27314
+ })(ParticleRenderMode || (ParticleRenderMode = {}));
27315
+
27316
+ var ParticleStopMode;
27317
+ (function(ParticleStopMode) {
27318
+ ParticleStopMode[ParticleStopMode[/** Stop emitting new particles and clear existing particles immediately. */ "StopEmittingAndClear"] = 0] = "StopEmittingAndClear";
27319
+ ParticleStopMode[ParticleStopMode[/** Stop emitting new particles, but keep existing particles until they expire. */ "StopEmitting"] = 1] = "StopEmitting";
27320
+ })(ParticleStopMode || (ParticleStopMode = {}));
27321
+
27322
+ /**
27323
+ * Particle Renderer Component.
27324
+ */ var ParticleRenderer = /*#__PURE__*/ function(Renderer1) {
27325
+ _inherits(ParticleRenderer, Renderer1);
27326
+ function ParticleRenderer(entity) {
26968
27327
  var _this;
26969
- _this = BaseMaterial1.call(this, engine, Shader.find("particle-shader")) || this;
26970
- var shaderData = _this.shaderData;
26971
- shaderData.enableMacro("MATERIAL_OMIT_NORMAL");
26972
- shaderData.setColor(BaseMaterial._baseColorProp, new Color$1(1, 1, 1, 1));
26973
- _this.isTransparent = true;
27328
+ _this = Renderer1.call(this, entity) || this;
27329
+ /** Particle generator. */ _this.generator = new ParticleGenerator(_assert_this_initialized(_this));
27330
+ /** Specifies how much particles stretch depending on their velocity. */ _this.velocityScale = 0;
27331
+ /** 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;
27332
+ /** The pivot of particle. */ _this.pivot = new Vector3();
27333
+ _this._currentRenderModeMacro = ParticleRenderer._billboardModeMacro;
27334
+ _this.shaderData.enableMacro(ParticleRenderer._billboardModeMacro);
27335
+ _this._supportInstancedArrays = _this.engine._hardwareRenderer.canIUse(GLCapabilityType.instancedArrays);
26974
27336
  return _this;
26975
27337
  }
26976
- var _proto = ParticleMaterial.prototype;
27338
+ var _proto = ParticleRenderer.prototype;
26977
27339
  /**
26978
- * @inheritdoc
26979
- */ _proto.clone = function clone() {
26980
- var dest = new ParticleMaterial(this._engine);
26981
- this.cloneTo(dest);
26982
- return dest;
27340
+ * @internal
27341
+ */ _proto._onEnable = function _onEnable() {
27342
+ if (this.generator.main.playOnEnabled) {
27343
+ this.generator.play(false);
27344
+ }
26983
27345
  };
26984
- _create_class(ParticleMaterial, [
27346
+ /**
27347
+ * @internal
27348
+ */ _proto._onDisable = function _onDisable() {
27349
+ this.generator.stop(false, ParticleStopMode.StopEmittingAndClear);
27350
+ };
27351
+ /**
27352
+ * @internal
27353
+ */ _proto._prepareRender = function _prepareRender(context) {
27354
+ if (!this._supportInstancedArrays) {
27355
+ return;
27356
+ }
27357
+ var generator = this.generator;
27358
+ generator._update(this.engine.time.deltaTime);
27359
+ // No particles to render
27360
+ if (generator._firstActiveElement === generator._firstFreeElement) {
27361
+ return;
27362
+ }
27363
+ Renderer1.prototype._prepareRender.call(this, context);
27364
+ };
27365
+ /**
27366
+ * @internal
27367
+ */ _proto._updateBounds = function _updateBounds(worldBounds) {
27368
+ worldBounds.min.set(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
27369
+ worldBounds.max.set(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
27370
+ };
27371
+ /**
27372
+ * @internal
27373
+ */ _proto._updateShaderData = function _updateShaderData(context) {
27374
+ var shaderData = this.shaderData;
27375
+ shaderData.setFloat(ParticleRenderer._lengthScale, this.lengthScale);
27376
+ shaderData.setFloat(ParticleRenderer._speedScale, this.velocityScale);
27377
+ shaderData.setFloat(ParticleRenderer._currentTime, this.generator._playTime);
27378
+ shaderData.setVector3(ParticleRenderer._pivotOffsetProperty, this.pivot);
27379
+ this.generator._updateShaderData(shaderData);
27380
+ };
27381
+ _proto._render = function _render(context) {
27382
+ var generator = this.generator;
27383
+ var primitive = generator._primitive;
27384
+ if (generator._firstActiveElement < generator._firstFreeElement) {
27385
+ primitive.instanceCount = generator._firstFreeElement - generator._firstActiveElement;
27386
+ } else {
27387
+ var instanceCount = generator._currentParticleCount - generator._firstActiveElement;
27388
+ if (generator._firstFreeElement > 0) {
27389
+ instanceCount += generator._firstFreeElement;
27390
+ }
27391
+ primitive.instanceCount = instanceCount;
27392
+ }
27393
+ var material = this.getMaterial();
27394
+ var renderData = this._engine._renderDataPool.getFromPool();
27395
+ renderData.setX(this, material, generator._primitive, generator._subPrimitive);
27396
+ context.camera._renderPipeline.pushRenderData(context, renderData);
27397
+ };
27398
+ _proto._onDestroy = function _onDestroy() {
27399
+ this.generator._destroy();
27400
+ };
27401
+ _create_class(ParticleRenderer, [
26985
27402
  {
26986
- key: "baseColor",
27403
+ key: "renderMode",
26987
27404
  get: /**
26988
- * Base color.
27405
+ * Specifies how particles are rendered.
26989
27406
  */ function get() {
26990
- return this.shaderData.getColor(BaseMaterial._baseColorProp);
27407
+ return this._renderMode;
26991
27408
  },
26992
27409
  set: function set(value) {
26993
- var baseColor = this.shaderData.getColor(BaseMaterial._baseColorProp);
26994
- if (value !== baseColor) {
26995
- baseColor.copyFrom(value);
27410
+ if (this._renderMode !== value) {
27411
+ var lastRenderMode = this._renderMode;
27412
+ this._renderMode = value;
27413
+ var renderModeMacro = null;
27414
+ var shaderData = this.shaderData;
27415
+ switch(value){
27416
+ case ParticleRenderMode.Billboard:
27417
+ renderModeMacro = ParticleRenderer._billboardModeMacro;
27418
+ break;
27419
+ case ParticleRenderMode.StretchBillboard:
27420
+ renderModeMacro = ParticleRenderer._stretchedBillboardModeMacro;
27421
+ break;
27422
+ case ParticleRenderMode.HorizontalBillboard:
27423
+ throw "Not implemented";
27424
+ case ParticleRenderMode.VerticalBillboard:
27425
+ throw "Not implemented";
27426
+ case ParticleRenderMode.Mesh:
27427
+ throw "Not implemented";
27428
+ }
27429
+ if (this._currentRenderModeMacro !== renderModeMacro) {
27430
+ this._currentRenderModeMacro && shaderData.disableMacro(this._currentRenderModeMacro);
27431
+ renderModeMacro && shaderData.enableMacro(renderModeMacro);
27432
+ this._currentRenderModeMacro = renderModeMacro;
27433
+ }
27434
+ // @ts-ignore
27435
+ if (lastRenderMode !== ParticleRenderMode.Mesh !== (value === ParticleRenderMode.Mesh)) {
27436
+ this.generator._reorganizeGeometryBuffers();
27437
+ }
26996
27438
  }
26997
27439
  }
26998
27440
  },
26999
27441
  {
27000
- key: "baseTexture",
27442
+ key: "mesh",
27001
27443
  get: /**
27002
- * Base texture.
27444
+ * The mesh of particle.
27445
+ * @remarks Valid when `renderMode` is `Mesh`.
27003
27446
  */ function get() {
27004
- return this.shaderData.getTexture(BaseMaterial._baseTextureProp);
27447
+ return this._mesh;
27005
27448
  },
27006
27449
  set: function set(value) {
27007
- this.shaderData.setTexture(BaseMaterial._baseTextureProp, value);
27008
- if (value) {
27009
- this.shaderData.enableMacro(BaseMaterial._baseTextureMacro);
27010
- } else {
27011
- this.shaderData.disableMacro(BaseMaterial._baseTextureMacro);
27450
+ var lastMesh = this._mesh;
27451
+ if (lastMesh !== value) {
27452
+ var _lastMesh, _value;
27453
+ this._mesh = value;
27454
+ (_lastMesh = lastMesh) == null ? void 0 : _lastMesh._addReferCount(-1);
27455
+ (_value = value) == null ? void 0 : _value._addReferCount(1);
27456
+ if (this.renderMode === ParticleRenderMode.Mesh) {
27457
+ this.generator._reorganizeGeometryBuffers();
27458
+ }
27012
27459
  }
27013
27460
  }
27014
27461
  }
27015
27462
  ]);
27016
- return ParticleMaterial;
27017
- }(BaseMaterial);
27018
-
27019
- var SubPrimitive = function SubPrimitive() {
27020
- };
27463
+ return ParticleRenderer;
27464
+ }(Renderer);
27465
+ (function() {
27466
+ ParticleRenderer._billboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_SPHERE_BILLBOARD");
27467
+ })();
27468
+ (function() {
27469
+ ParticleRenderer._stretchedBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_STRETCHED_BILLBOARD");
27470
+ })();
27471
+ (function() {
27472
+ ParticleRenderer._horizontalBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_HORIZONTAL_BILLBOARD");
27473
+ })();
27474
+ (function() {
27475
+ ParticleRenderer._verticalBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_VERTICAL_BILLBOARD");
27476
+ })();
27477
+ (function() {
27478
+ ParticleRenderer._renderModeMeshMacro = ShaderMacro.getByName("RENDERER_MODE_MESH");
27479
+ })();
27480
+ (function() {
27481
+ ParticleRenderer._pivotOffsetProperty = ShaderProperty.getByName("renderer_PivotOffset");
27482
+ })();
27483
+ (function() {
27484
+ ParticleRenderer._lengthScale = ShaderProperty.getByName("renderer_StretchedBillboardLengthScale");
27485
+ })();
27486
+ (function() {
27487
+ ParticleRenderer._speedScale = ShaderProperty.getByName("renderer_StretchedBillboardSpeedScale");
27488
+ })();
27489
+ (function() {
27490
+ ParticleRenderer._currentTime = ShaderProperty.getByName("renderer_CurrentTime");
27491
+ })();
27492
+ __decorate([
27493
+ deepClone
27494
+ ], ParticleRenderer.prototype, "generator", void 0);
27495
+ __decorate([
27496
+ shallowClone
27497
+ ], ParticleRenderer.prototype, "pivot", void 0);
27021
27498
 
27022
27499
  /**
27023
27500
  * Particle curve mode.
@@ -27039,18 +27516,6 @@ var SubPrimitive = function SubPrimitive() {
27039
27516
  ParticleGradientMode[ParticleGradientMode[/* Random value between two color gradients. */ "TwoGradients"] = 3] = "TwoGradients";
27040
27517
  })(ParticleGradientMode || (ParticleGradientMode = {}));
27041
27518
 
27042
- /**
27043
- * The rendering mode for particle renderer.
27044
- */ var ParticleRenderMode;
27045
- (function(ParticleRenderMode) {
27046
- ParticleRenderMode[ParticleRenderMode[/** Render particles as billboards facing the active camera. */ "Billboard"] = 0] = "Billboard";
27047
- ParticleRenderMode[ParticleRenderMode[/** Stretch particles in the direction of motion. */ "StretchBillboard"] = 1] = "StretchBillboard";
27048
- ParticleRenderMode[ParticleRenderMode[/** Render particles as billboards always facing up along the y-Axis. */ "HorizontalBillboard"] = 2] = "HorizontalBillboard";
27049
- ParticleRenderMode[ParticleRenderMode[/** Render particles as billboards always facing the player, but not pitching along the x-Axis. */ "VerticalBillboard"] = 3] = "VerticalBillboard";
27050
- ParticleRenderMode[ParticleRenderMode[/** Render particles as meshes. */ "Mesh"] = 4] = "Mesh";
27051
- ParticleRenderMode[ParticleRenderMode[/** Do not render particles. */ "None"] = 5] = "None";
27052
- })(ParticleRenderMode || (ParticleRenderMode = {}));
27053
-
27054
27519
  /**
27055
27520
  * The space to simulate particles in.
27056
27521
  */ var ParticleSimulationSpace;
@@ -27059,12 +27524,6 @@ var SubPrimitive = function SubPrimitive() {
27059
27524
  ParticleSimulationSpace[ParticleSimulationSpace[/** Simulate particles in world space. */ "World"] = 1] = "World";
27060
27525
  })(ParticleSimulationSpace || (ParticleSimulationSpace = {}));
27061
27526
 
27062
- var ParticleStopMode;
27063
- (function(ParticleStopMode) {
27064
- ParticleStopMode[ParticleStopMode[/** Stop emitting new particles and clear existing particles immediately. */ "StopEmittingAndClear"] = 0] = "StopEmittingAndClear";
27065
- ParticleStopMode[ParticleStopMode[/** Stop emitting new particles, but keep existing particles until they expire. */ "StopEmitting"] = 1] = "StopEmitting";
27066
- })(ParticleStopMode || (ParticleStopMode = {}));
27067
-
27068
27527
  /**
27069
27528
  * @internal
27070
27529
  */ var ParticleRandomSubSeeds;
@@ -27692,15 +28151,13 @@ var MainModule = /*#__PURE__*/ function() {
27692
28151
  /** The initial lifetime of particles when emitted. */ this.startLifetime = new ParticleCompositeCurve(5);
27693
28152
  /** The initial speed of particles when the Particle Generator first spawns them. */ this.startSpeed = new ParticleCompositeCurve(5);
27694
28153
  /** A flag to enable specifying particle size individually for each axis. */ this.startSize3D = false;
27695
- /** The initial size of particles when the Particle Generator first spawns them. */ this.startSize = new ParticleCompositeCurve(1);
27696
28154
  /** The initial size of particles along the x-axis when the Particle Generator first spawns them. */ this.startSizeX = new ParticleCompositeCurve(1);
27697
28155
  /** The initial size of particles along the y-axis when the Particle Generator first spawns them. */ this.startSizeY = new ParticleCompositeCurve(1);
27698
28156
  /** The initial size of particles along the z-axis when the Particle Generator first spawns them. */ this.startSizeZ = new ParticleCompositeCurve(1);
27699
- /** A flag to enable 3D particle rotation. */ this.startRotation3D = false;
27700
- /** The initial rotation of particles when the Particle Generator first spawns them. */ this.startRotation = new ParticleCompositeCurve(0);
28157
+ /** A flag to enable 3D particle rotation, when disabled, only `startRotationZ` is used. */ this.startRotation3D = false;
27701
28158
  /** The initial rotation of particles around the x-axis when emitted.*/ this.startRotationX = new ParticleCompositeCurve(0);
27702
28159
  /** The initial rotation of particles around the y-axis when emitted. */ this.startRotationY = new ParticleCompositeCurve(0);
27703
- this.startRotationZ = new ParticleCompositeCurve(0);
28160
+ /** The initial rotation of particles around the z-axis when emitted. */ this.startRotationZ = new ParticleCompositeCurve(0);
27704
28161
  /** Makes some particles spin in the opposite direction. */ this.flipRotation = 0;
27705
28162
  /** The mode of start color */ this.startColor = new ParticleCompositeGradient(new Color$1(1, 1, 1, 1));
27706
28163
  /** A scale that this Particle Generator applies to gravity, defined by Physics.gravity. */ this.gravityModifier = new ParticleCompositeCurve(0);
@@ -27803,6 +28260,17 @@ var MainModule = /*#__PURE__*/ function() {
27803
28260
  }
27804
28261
  }
27805
28262
  }
28263
+ },
28264
+ {
28265
+ key: "startSize",
28266
+ get: /**
28267
+ * The initial size of particles when the Particle Generator first spawns them.
28268
+ */ function get() {
28269
+ return this.startSizeX;
28270
+ },
28271
+ set: function set(value) {
28272
+ this.startSizeX = value;
28273
+ }
27806
28274
  }
27807
28275
  ]);
27808
28276
  return MainModule;
@@ -27846,9 +28314,6 @@ __decorate([
27846
28314
  __decorate([
27847
28315
  deepClone
27848
28316
  ], MainModule.prototype, "startSpeed", void 0);
27849
- __decorate([
27850
- deepClone
27851
- ], MainModule.prototype, "startSize", void 0);
27852
28317
  __decorate([
27853
28318
  deepClone
27854
28319
  ], MainModule.prototype, "startSizeX", void 0);
@@ -27858,9 +28323,6 @@ __decorate([
27858
28323
  __decorate([
27859
28324
  deepClone
27860
28325
  ], MainModule.prototype, "startSizeZ", void 0);
27861
- __decorate([
27862
- deepClone
27863
- ], MainModule.prototype, "startRotation", void 0);
27864
28326
  __decorate([
27865
28327
  deepClone
27866
28328
  ], MainModule.prototype, "startRotationX", void 0);
@@ -27868,7 +28330,6 @@ __decorate([
27868
28330
  deepClone
27869
28331
  ], MainModule.prototype, "startRotationY", void 0);
27870
28332
  __decorate([
27871
- deepClone,
27872
28333
  deepClone
27873
28334
  ], MainModule.prototype, "startRotationZ", void 0);
27874
28335
  __decorate([
@@ -27909,7 +28370,7 @@ __decorate([
27909
28370
  function RotationOverLifetimeModule() {
27910
28371
  var _this;
27911
28372
  _this = ParticleGeneratorModule1.apply(this, arguments) || this;
27912
- /** Specifies whether the rotation is separate on each axis, when disabled only z axis is used. */ _this.separateAxes = false;
28373
+ /** Specifies whether the rotation is separate on each axis, when disabled, only `rotationZ` is used. */ _this.separateAxes = false;
27913
28374
  /** Rotation over lifetime for z axis. */ _this.rotationX = new ParticleCompositeCurve(0);
27914
28375
  /** Rotation over lifetime for z axis. */ _this.rotationY = new ParticleCompositeCurve(0);
27915
28376
  /** Rotation over lifetime for z axis. */ _this.rotationZ = new ParticleCompositeCurve(45);
@@ -28263,9 +28724,6 @@ __decorate([
28263
28724
  }
28264
28725
  var _proto = TextureSheetAnimationModule.prototype;
28265
28726
  /**
28266
- * @inheritDoc
28267
- */ _proto.cloneTo = function cloneTo(dest) {};
28268
- /**
28269
28727
  * @internal
28270
28728
  */ _proto._updateShaderData = function _updateShaderData(shaderData) {
28271
28729
  var frameMacro = null;
@@ -28753,7 +29211,7 @@ __decorate([
28753
29211
  instanceVertices[offset + 16] = MathUtil$1.degreeToRadian(main.startRotationY.evaluate(undefined, startRotationRand.random()));
28754
29212
  instanceVertices[offset + 17] = MathUtil$1.degreeToRadian(main.startRotationZ.evaluate(undefined, startRotationRand.random()));
28755
29213
  } else {
28756
- instanceVertices[offset + 15] = MathUtil$1.degreeToRadian(main.startRotation.evaluate(undefined, startRotationRand.random()));
29214
+ instanceVertices[offset + 15] = MathUtil$1.degreeToRadian(main.startRotationZ.evaluate(undefined, startRotationRand.random()));
28757
29215
  }
28758
29216
  // Start speed
28759
29217
  instanceVertices[offset + 18] = startSpeed;
@@ -29016,181 +29474,60 @@ __decorate([
29016
29474
  ], ParticleGenerator.prototype, "_instanceVertices", void 0);
29017
29475
 
29018
29476
  /**
29019
- * Particle Renderer Component.
29020
- */ var ParticleRenderer = /*#__PURE__*/ function(Renderer1) {
29021
- _inherits(ParticleRenderer, Renderer1);
29022
- function ParticleRenderer(entity) {
29477
+ * Particle Material.
29478
+ */ var ParticleMaterial = /*#__PURE__*/ function(BaseMaterial1) {
29479
+ _inherits(ParticleMaterial, BaseMaterial1);
29480
+ function ParticleMaterial(engine) {
29023
29481
  var _this;
29024
- _this = Renderer1.call(this, entity) || this;
29025
- /** Particle generator. */ _this.generator = new ParticleGenerator(_assert_this_initialized(_this));
29026
- /** Specifies how much particles stretch depending on their velocity. */ _this.velocityScale = 0;
29027
- /** 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;
29028
- /** The pivot of particle. */ _this.pivot = new Vector3();
29029
- _this._currentRenderModeMacro = ParticleRenderer._billboardModeMacro;
29030
- _this.shaderData.enableMacro(ParticleRenderer._billboardModeMacro);
29031
- _this._supportInstancedArrays = _this.engine._hardwareRenderer.canIUse(GLCapabilityType.instancedArrays);
29482
+ _this = BaseMaterial1.call(this, engine, Shader.find("particle-shader")) || this;
29483
+ var shaderData = _this.shaderData;
29484
+ shaderData.enableMacro("MATERIAL_OMIT_NORMAL");
29485
+ shaderData.setColor(BaseMaterial._baseColorProp, new Color$1(1, 1, 1, 1));
29486
+ _this.isTransparent = true;
29032
29487
  return _this;
29033
29488
  }
29034
- var _proto = ParticleRenderer.prototype;
29035
- /**
29036
- * @internal
29037
- */ _proto._onEnable = function _onEnable() {
29038
- if (this.generator.main.playOnEnabled) {
29039
- this.generator.play(false);
29040
- }
29041
- };
29042
- /**
29043
- * @internal
29044
- */ _proto._onDisable = function _onDisable() {
29045
- this.generator.stop(false, ParticleStopMode.StopEmittingAndClear);
29046
- };
29047
- /**
29048
- * @internal
29049
- */ _proto._prepareRender = function _prepareRender(context) {
29050
- if (!this._supportInstancedArrays) {
29051
- return;
29052
- }
29053
- var generator = this.generator;
29054
- generator._update(this.engine.time.deltaTime);
29055
- // No particles to render
29056
- if (generator._firstActiveElement === generator._firstFreeElement) {
29057
- return;
29058
- }
29059
- Renderer1.prototype._prepareRender.call(this, context);
29060
- };
29061
- /**
29062
- * @internal
29063
- */ _proto._updateBounds = function _updateBounds(worldBounds) {
29064
- worldBounds.min.set(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
29065
- worldBounds.max.set(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
29066
- };
29489
+ var _proto = ParticleMaterial.prototype;
29067
29490
  /**
29068
- * @internal
29069
- */ _proto._updateShaderData = function _updateShaderData(context) {
29070
- var shaderData = this.shaderData;
29071
- shaderData.setFloat(ParticleRenderer._lengthScale, this.lengthScale);
29072
- shaderData.setFloat(ParticleRenderer._speedScale, this.velocityScale);
29073
- shaderData.setFloat(ParticleRenderer._currentTime, this.generator._playTime);
29074
- shaderData.setVector3(ParticleRenderer._pivotOffsetProperty, this.pivot);
29075
- this.generator._updateShaderData(shaderData);
29076
- };
29077
- _proto._render = function _render(context) {
29078
- var generator = this.generator;
29079
- var primitive = generator._primitive;
29080
- if (generator._firstActiveElement < generator._firstFreeElement) {
29081
- primitive.instanceCount = generator._firstFreeElement - generator._firstActiveElement;
29082
- } else {
29083
- var instanceCount = generator._currentParticleCount - generator._firstActiveElement;
29084
- if (generator._firstFreeElement > 0) {
29085
- instanceCount += generator._firstFreeElement;
29086
- }
29087
- primitive.instanceCount = instanceCount;
29088
- }
29089
- var material = this.getMaterial();
29090
- var renderData = this._engine._renderDataPool.getFromPool();
29091
- renderData.setX(this, material, generator._primitive, generator._subPrimitive);
29092
- context.camera._renderPipeline.pushRenderData(context, renderData);
29093
- };
29094
- _proto._onDestroy = function _onDestroy() {
29095
- this.generator._destroy();
29491
+ * @inheritdoc
29492
+ */ _proto.clone = function clone() {
29493
+ var dest = new ParticleMaterial(this._engine);
29494
+ this.cloneTo(dest);
29495
+ return dest;
29096
29496
  };
29097
- _create_class(ParticleRenderer, [
29497
+ _create_class(ParticleMaterial, [
29098
29498
  {
29099
- key: "renderMode",
29499
+ key: "baseColor",
29100
29500
  get: /**
29101
- * Specifies how particles are rendered.
29501
+ * Base color.
29102
29502
  */ function get() {
29103
- return this._renderMode;
29503
+ return this.shaderData.getColor(BaseMaterial._baseColorProp);
29104
29504
  },
29105
29505
  set: function set(value) {
29106
- if (this._renderMode !== value) {
29107
- var lastRenderMode = this._renderMode;
29108
- this._renderMode = value;
29109
- var renderModeMacro = null;
29110
- var shaderData = this.shaderData;
29111
- switch(value){
29112
- case ParticleRenderMode.Billboard:
29113
- renderModeMacro = ParticleRenderer._billboardModeMacro;
29114
- break;
29115
- case ParticleRenderMode.StretchBillboard:
29116
- renderModeMacro = ParticleRenderer._stretchedBillboardModeMacro;
29117
- break;
29118
- case ParticleRenderMode.HorizontalBillboard:
29119
- throw "Not implemented";
29120
- case ParticleRenderMode.VerticalBillboard:
29121
- throw "Not implemented";
29122
- case ParticleRenderMode.Mesh:
29123
- throw "Not implemented";
29124
- }
29125
- if (this._currentRenderModeMacro !== renderModeMacro) {
29126
- this._currentRenderModeMacro && shaderData.disableMacro(this._currentRenderModeMacro);
29127
- renderModeMacro && shaderData.enableMacro(renderModeMacro);
29128
- this._currentRenderModeMacro = renderModeMacro;
29129
- }
29130
- // @ts-ignore
29131
- if (lastRenderMode !== ParticleRenderMode.Mesh !== (value === ParticleRenderMode.Mesh)) {
29132
- this.generator._reorganizeGeometryBuffers();
29133
- }
29506
+ var baseColor = this.shaderData.getColor(BaseMaterial._baseColorProp);
29507
+ if (value !== baseColor) {
29508
+ baseColor.copyFrom(value);
29134
29509
  }
29135
29510
  }
29136
29511
  },
29137
29512
  {
29138
- key: "mesh",
29513
+ key: "baseTexture",
29139
29514
  get: /**
29140
- * The mesh of particle.
29141
- * @remarks Valid when `renderMode` is `Mesh`.
29515
+ * Base texture.
29142
29516
  */ function get() {
29143
- return this._mesh;
29517
+ return this.shaderData.getTexture(BaseMaterial._baseTextureProp);
29144
29518
  },
29145
29519
  set: function set(value) {
29146
- var lastMesh = this._mesh;
29147
- if (lastMesh !== value) {
29148
- var _lastMesh, _value;
29149
- this._mesh = value;
29150
- (_lastMesh = lastMesh) == null ? void 0 : _lastMesh._addReferCount(-1);
29151
- (_value = value) == null ? void 0 : _value._addReferCount(1);
29152
- if (this.renderMode === ParticleRenderMode.Mesh) {
29153
- this.generator._reorganizeGeometryBuffers();
29154
- }
29520
+ this.shaderData.setTexture(BaseMaterial._baseTextureProp, value);
29521
+ if (value) {
29522
+ this.shaderData.enableMacro(BaseMaterial._baseTextureMacro);
29523
+ } else {
29524
+ this.shaderData.disableMacro(BaseMaterial._baseTextureMacro);
29155
29525
  }
29156
29526
  }
29157
29527
  }
29158
29528
  ]);
29159
- return ParticleRenderer;
29160
- }(Renderer);
29161
- (function() {
29162
- ParticleRenderer._billboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_SPHERE_BILLBOARD");
29163
- })();
29164
- (function() {
29165
- ParticleRenderer._stretchedBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_STRETCHED_BILLBOARD");
29166
- })();
29167
- (function() {
29168
- ParticleRenderer._horizontalBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_HORIZONTAL_BILLBOARD");
29169
- })();
29170
- (function() {
29171
- ParticleRenderer._verticalBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_VERTICAL_BILLBOARD");
29172
- })();
29173
- (function() {
29174
- ParticleRenderer._renderModeMeshMacro = ShaderMacro.getByName("RENDERER_MODE_MESH");
29175
- })();
29176
- (function() {
29177
- ParticleRenderer._pivotOffsetProperty = ShaderProperty.getByName("renderer_PivotOffset");
29178
- })();
29179
- (function() {
29180
- ParticleRenderer._lengthScale = ShaderProperty.getByName("renderer_StretchedBillboardLengthScale");
29181
- })();
29182
- (function() {
29183
- ParticleRenderer._speedScale = ShaderProperty.getByName("renderer_StretchedBillboardSpeedScale");
29184
- })();
29185
- (function() {
29186
- ParticleRenderer._currentTime = ShaderProperty.getByName("renderer_CurrentTime");
29187
- })();
29188
- __decorate([
29189
- deepClone
29190
- ], ParticleRenderer.prototype, "generator", void 0);
29191
- __decorate([
29192
- shallowClone
29193
- ], ParticleRenderer.prototype, "pivot", void 0);
29529
+ return ParticleMaterial;
29530
+ }(BaseMaterial);
29194
29531
 
29195
29532
  /**
29196
29533
  * A burst is a particle emission event, where a number of particles are all emitted at the same time
@@ -29830,5 +30167,5 @@ var cacheDir = new Vector3();
29830
30167
  return CubeProbe;
29831
30168
  }(Probe);
29832
30169
 
29833
- export { AmbientLight, AnimationArrayCurve, AnimationBoolCurve, AnimationClip, AnimationClipCurveBinding, AnimationColorCurve, AnimationCurve, AnimationEvent, AnimationFloatArrayCurve, AnimationFloatCurve, AnimationQuaternionCurve, AnimationRectCurve, AnimationRefCurve, AnimationVector2Curve, AnimationVector3Curve, AnimationVector4Curve, Animator, AnimatorConditionMode, AnimatorController, AnimatorControllerLayer, AnimatorCullingMode, AnimatorLayerBlendingMode, AnimatorState, AnimatorStateMachine, AnimatorStateTransition, AssetPromise, AssetType, Background, BackgroundMode, BackgroundTextureFillMode, BaseMaterial, Basic2DBatcher, BasicRenderPipeline, BlendFactor, BlendMode, BlendOperation, BlendShape, BlendShapeFrame, BlendState, BlinnPhongMaterial, BoolUpdateFlag, BoxColliderShape, BoxShape, Buffer, BufferBindFlag, BufferMesh, BufferUsage, BufferUtil, Burst, Camera, CameraClearFlags, CapsuleColliderShape, CharacterController, CircleShape, CloneManager, Collider, ColliderShape, ColliderShapeUpAxis, CollisionDetectionMode, ColorSpace, ColorWriteMask, CompareFunction, Component, ConeEmitType, ConeShape, ContentRestorer, ControllerCollisionFlag, ControllerNonWalkableMode, CubeProbe, CullMode, CurveKey, DataType, DependentMode, DepthState, DepthTextureMode, DiffuseMode, DirectLight, DynamicCollider, DynamicColliderConstraints, Engine, EngineObject, Entity, EventDispatcher, FixedJoint, FogMode, Font, FontStyle, GLCapabilityType, HemisphereShape, HingeJoint, HitResult, IndexBufferBinding, IndexFormat, InputManager, InterpolationType, Joint, JointLimits, JointMotor, Keyframe, Keys, Layer, Light, Loader, Logger, Material, Mesh, MeshRenderer, MeshTopology, ModelMesh, OverflowMode, PBRBaseMaterial, PBRMaterial, PBRSpecularMaterial, ParticleCompositeCurve, ParticleCurve, ParticleCurveMode, ParticleGradientMode, ParticleMaterial, ParticleRenderMode, ParticleRenderer, ParticleScaleMode, ParticleShapeArcMode, ParticleSimulationSpace, ParticleStopMode, PhysicsMaterial, PhysicsMaterialCombineMode, PhysicsScene, PipelineStage, PlaneColliderShape, Platform, PointLight, Pointer, PointerButton, PointerPhase, Primitive, PrimitiveMesh, Probe, RasterState, ReferResource, RenderBufferDepthFormat, RenderFace, RenderPass, RenderQueue, RenderQueueType, RenderState, RenderStateElementKey as RenderStateDataKey, RenderTarget, RenderTargetBlendState, Renderer, ResourceManager, Scene, SceneManager, Script, SetDataOptions, Shader, ShaderData, ShaderFactory, ShaderMacro, ShaderMacroCollection, ShaderPass, ShaderProperty, ShaderPropertyType, ShaderTagKey, ShadowCascadesMode, ShadowResolution, ShadowType, Skin, SkinnedMeshRenderer, Sky, SkyBoxMaterial, SkyProceduralMaterial, SphereColliderShape, SphereShape, SpotLight, SpringJoint, Sprite, SpriteAtlas, SpriteDrawMode, SpriteMask, SpriteMaskInteraction, SpriteMaskLayer, SpriteRenderer, SpriteTileMode, StateMachineScript, StaticCollider, StencilOperation, StencilState, SubMesh, SubShader, SunMode, SystemInfo, TextHorizontalAlignment, TextRenderer, TextUtils, TextVerticalAlignment, Texture, Texture2D, Texture2DArray, TextureCoordinate, TextureCube, TextureCubeFace, TextureDepthCompareFunction, TextureFilterMode, TextureFormat, TextureUsage, TextureWrapMode, Time, TrailMaterial, TrailRenderer, Transform, UnlitMaterial, Utils, VertexAttribute, VertexBufferBinding, VertexElement, VertexElementFormat, WrapMode, assignmentClone, deepClone, dependentComponents, ignoreClone, request, resourceLoader, shallowClone };
30170
+ export { AmbientLight, AnimationArrayCurve, AnimationBoolCurve, AnimationClip, AnimationClipCurveBinding, AnimationColorCurve, AnimationCurve, AnimationEvent, AnimationFloatArrayCurve, AnimationFloatCurve, AnimationQuaternionCurve, AnimationRectCurve, AnimationRefCurve, AnimationVector2Curve, AnimationVector3Curve, AnimationVector4Curve, Animator, AnimatorConditionMode, AnimatorController, AnimatorControllerLayer, AnimatorCullingMode, AnimatorLayerBlendingMode, AnimatorState, AnimatorStateMachine, AnimatorStateTransition, AssetPromise, AssetType, Background, BackgroundMode, BackgroundTextureFillMode, BaseMaterial, Basic2DBatcher, BasicRenderPipeline, BlendFactor, BlendMode, BlendOperation, BlendShape, BlendShapeFrame, BlendState, BlinnPhongMaterial, BoolUpdateFlag, BoxColliderShape, BoxShape, Buffer, BufferBindFlag, BufferMesh, BufferUsage, BufferUtil, Burst, Camera, CameraClearFlags, CapsuleColliderShape, CharacterController, CircleShape, CloneManager, Collider, ColliderShape, ColliderShapeUpAxis, CollisionDetectionMode, ColorOverLifetimeModule, ColorSpace, ColorWriteMask, CompareFunction, Component, ConeEmitType, ConeShape, ContentRestorer, ControllerCollisionFlag, ControllerNonWalkableMode, CubeProbe, CullMode, CurveKey, DataType, DependentMode, DepthState, DepthTextureMode, DiffuseMode, DirectLight, DynamicCollider, DynamicColliderConstraints, EmissionModule, Engine, EngineObject, Entity, EventDispatcher, FixedJoint, FogMode, Font, FontStyle, GLCapabilityType, GradientAlphaKey, GradientColorKey, HemisphereShape, HingeJoint, HitResult, IndexBufferBinding, IndexFormat, InputManager, InterpolationType, Joint, JointLimits, JointMotor, Keyframe, Keys, Layer, Light, Loader, Logger, MainModule, Material, Mesh, MeshRenderer, MeshTopology, ModelMesh, OverflowMode, PBRBaseMaterial, PBRMaterial, PBRSpecularMaterial, ParticleCompositeCurve, ParticleCompositeGradient, ParticleCurve, ParticleCurveMode, ParticleGenerator, ParticleGradient, ParticleGradientMode, ParticleMaterial, ParticleRenderMode, ParticleRenderer, ParticleScaleMode, ParticleShapeArcMode, ParticleSimulationSpace, ParticleStopMode, PhysicsMaterial, PhysicsMaterialCombineMode, PhysicsScene, PipelineStage, PlaneColliderShape, Platform, PointLight, Pointer, PointerButton, PointerPhase, Primitive, PrimitiveMesh, Probe, RasterState, ReferResource, RenderBufferDepthFormat, RenderFace, RenderPass, RenderQueue, RenderQueueType, RenderState, RenderStateElementKey as RenderStateDataKey, RenderTarget, RenderTargetBlendState, Renderer, ResourceManager, RotationOverLifetimeModule, Scene, SceneManager, Script, SetDataOptions, Shader, ShaderData, ShaderFactory, ShaderMacro, ShaderMacroCollection, ShaderPass, ShaderProperty, ShaderPropertyType, ShaderTagKey, ShadowCascadesMode, ShadowResolution, ShadowType, SizeOverLifetimeModule, Skin, SkinnedMeshRenderer, Sky, SkyBoxMaterial, SkyProceduralMaterial, SphereColliderShape, SphereShape, SpotLight, SpringJoint, Sprite, SpriteAtlas, SpriteDrawMode, SpriteMask, SpriteMaskInteraction, SpriteMaskLayer, SpriteRenderer, SpriteTileMode, StateMachineScript, StaticCollider, StencilOperation, StencilState, SubMesh, SubShader, SunMode, SystemInfo, TextHorizontalAlignment, TextRenderer, TextUtils, TextVerticalAlignment, Texture, Texture2D, Texture2DArray, TextureCoordinate, TextureCube, TextureCubeFace, TextureDepthCompareFunction, TextureFilterMode, TextureFormat, TextureSheetAnimationModule, TextureUsage, TextureWrapMode, Time, TrailMaterial, TrailRenderer, Transform, UnlitMaterial, Utils, VelocityOverLifetimeModule, VertexAttribute, VertexBufferBinding, VertexElement, VertexElementFormat, WrapMode, assignmentClone, deepClone, dependentComponents, ignoreClone, request, resourceLoader, shallowClone };
29834
30171
  //# sourceMappingURL=module.js.map