@galacean/engine-core 1.2.0-beta.2 → 1.2.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright © 2020-2023 Galacean authors
3
+ Copyright (c) 2020 - present Ant Group
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
21
+ THE SOFTWARE.
package/dist/main.js CHANGED
@@ -4940,7 +4940,8 @@ __decorate([
4940
4940
  }
4941
4941
  var shaderInfo = Shader._shaderLab.parseShader(nameOrShaderSource);
4942
4942
  if (shaderMap[shaderInfo.name]) {
4943
- throw 'Shader named "' + shaderInfo.name + '" already exists.';
4943
+ console.error('Shader named "' + shaderInfo.name + '" already exists.');
4944
+ return;
4944
4945
  }
4945
4946
  var subShaderList = shaderInfo.subShaders.map(function(subShaderInfo) {
4946
4947
  var passList = subShaderInfo.passes.map(function(passInfo) {
@@ -4979,7 +4980,8 @@ __decorate([
4979
4980
  return shader;
4980
4981
  } else {
4981
4982
  if (shaderMap[nameOrShaderSource]) {
4982
- throw 'Shader named "' + nameOrShaderSource + '" already exists.';
4983
+ console.error('Shader named "' + nameOrShaderSource + '" already exists.');
4984
+ return;
4983
4985
  }
4984
4986
  if (typeof vertexSourceOrShaderPassesOrSubShaders === "string") {
4985
4987
  var shaderPass = new ShaderPass(vertexSourceOrShaderPassesOrSubShaders, fragmentSource);
@@ -19465,7 +19467,8 @@ __decorate([
19465
19467
  /** @internal */ this._upList = new DisorderedArray();
19466
19468
  /** @internal */ this._downList = new DisorderedArray();
19467
19469
  this._nativeEvents = [];
19468
- if (_instanceof(target, Window)) {
19470
+ // Temporary solution for mini program, window does not exist
19471
+ if (typeof Window !== "undefined" && _instanceof(target, Window)) {
19469
19472
  throw "Do not set window as target because window cannot listen to pointer leave event.";
19470
19473
  }
19471
19474
  this._engine = engine;
@@ -22125,9 +22128,10 @@ __decorate([
22125
22128
  */ _proto._updateShaderData = function _updateShaderData(shaderData) {
22126
22129
  var _this = this, spotLight = _this._spotLights, pointLight = _this._pointLights, directLight = _this._directLights;
22127
22130
  var _this1 = this, spotData = _this1._spotData, pointData = _this1._pointData, directData = _this1._directData;
22128
- var spotLightCount = spotLight.length;
22129
- var pointLightCount = pointLight.length;
22130
- var directLightCount = directLight.length;
22131
+ var maxLight = LightManager._maxLight;
22132
+ var spotLightCount = Math.min(spotLight.length, maxLight);
22133
+ var pointLightCount = Math.min(pointLight.length, maxLight);
22134
+ var directLightCount = Math.min(directLight.length, maxLight);
22131
22135
  for(var i = 0; i < spotLightCount; i++){
22132
22136
  spotLight.get(i)._appendData(i, spotData);
22133
22137
  }
@@ -27233,20 +27237,19 @@ exports.AnimatorLayerBlendingMode = void 0;
27233
27237
  var relativePath = curve.relativePath;
27234
27238
  var targetEntity = curve.relativePath === "" ? entity : entity.findByPath(curve.relativePath);
27235
27239
  if (targetEntity) {
27236
- var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _propertyPath;
27237
- var propertyPath = "" + curve.typeIndex + "." + curve.property;
27240
+ var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _property1;
27238
27241
  var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, AnimationCurveOwner._components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
27239
27242
  if (!component) {
27240
27243
  continue;
27241
27244
  }
27242
27245
  var property = curve.property;
27243
- var instanceId = targetEntity.instanceId;
27246
+ var instanceId = component.instanceId;
27244
27247
  // Get owner
27245
27248
  var propertyOwners = (_curveOwnerPool = curveOwnerPool)[_instanceId = instanceId] || (_curveOwnerPool[_instanceId] = Object.create(null));
27246
27249
  var owner = (_propertyOwners = propertyOwners)[_property = property] || (_propertyOwners[_property] = curve._createCurveOwner(targetEntity, component));
27247
27250
  // Get layer owner
27248
27251
  var layerPropertyOwners = (_layerCurveOwnerPool = layerCurveOwnerPool)[_instanceId1 = instanceId] || (_layerCurveOwnerPool[_instanceId1] = Object.create(null));
27249
- var layerOwner = (_layerPropertyOwners = layerPropertyOwners)[_propertyPath = propertyPath] || (_layerPropertyOwners[_propertyPath] = curve._createCurveLayerOwner(owner));
27252
+ var layerOwner = (_layerPropertyOwners = layerPropertyOwners)[_property1 = property] || (_layerPropertyOwners[_property1] = curve._createCurveLayerOwner(owner));
27250
27253
  if (mask && mask.pathMasks.length) {
27251
27254
  var _mask_getPathMask;
27252
27255
  var _mask_getPathMask_active;