@galacean/engine-loader 1.1.0-beta.15 → 1.1.0-beta.16

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.
@@ -5545,29 +5545,34 @@ var SceneLoader = /*#__PURE__*/ function(Loader1) {
5545
5545
  var promises = [];
5546
5546
  // parse ambient light
5547
5547
  var ambient = data.scene.ambient;
5548
- var useCustomAmbient = ambient.specularMode === "Custom";
5549
- var useSH = ambient.diffuseMode === miniprogram.DiffuseMode.SphericalHarmonics;
5550
- scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
5551
- scene.ambientLight.specularIntensity = ambient.specularIntensity;
5552
- scene.ambientLight.diffuseMode = ambient.diffuseMode;
5553
- scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
5554
- scene.ambientLight.specularTextureDecodeRGBM = true;
5555
- if (useCustomAmbient && ambient.customAmbientLight) {
5556
- promises.push(// @ts-ignore
5557
- resourceManager.getResourceByRef(ambient.customAmbientLight).then(function(ambientLight) {
5558
- scene.ambientLight.specularTexture = ambientLight.specularTexture;
5559
- }));
5560
- }
5561
- if (ambient.ambientLight && (!useCustomAmbient || useSH)) {
5562
- promises.push(// @ts-ignore
5563
- resourceManager.getResourceByRef(ambient.ambientLight).then(function(ambientLight) {
5564
- if (!useCustomAmbient) {
5565
- scene.ambientLight.specularTexture = ambientLight.specularTexture;
5566
- }
5567
- if (useSH) {
5568
- scene.ambientLight.diffuseSphericalHarmonics = ambientLight.diffuseSphericalHarmonics;
5569
- }
5570
- }));
5548
+ if (ambient) {
5549
+ var useCustomAmbient = ambient.specularMode === "Custom";
5550
+ var useSH = ambient.diffuseMode === miniprogram.DiffuseMode.SphericalHarmonics;
5551
+ scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
5552
+ scene.ambientLight.specularIntensity = ambient.specularIntensity;
5553
+ scene.ambientLight.diffuseMode = ambient.diffuseMode;
5554
+ scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
5555
+ scene.ambientLight.specularTextureDecodeRGBM = true;
5556
+ if (useCustomAmbient && ambient.customAmbientLight) {
5557
+ promises.push(// @ts-ignore
5558
+ resourceManager.getResourceByRef(ambient.customAmbientLight).then(function(ambientLight) {
5559
+ var _ambientLight;
5560
+ scene.ambientLight.specularTexture = (_ambientLight = ambientLight) == null ? void 0 : _ambientLight.specularTexture;
5561
+ }));
5562
+ }
5563
+ if (ambient.ambientLight && (!useCustomAmbient || useSH)) {
5564
+ promises.push(// @ts-ignore
5565
+ resourceManager.getResourceByRef(ambient.ambientLight).then(function(ambientLight) {
5566
+ if (!useCustomAmbient) {
5567
+ var _ambientLight;
5568
+ scene.ambientLight.specularTexture = (_ambientLight = ambientLight) == null ? void 0 : _ambientLight.specularTexture;
5569
+ }
5570
+ if (useSH) {
5571
+ var _ambientLight1;
5572
+ scene.ambientLight.diffuseSphericalHarmonics = (_ambientLight1 = ambientLight) == null ? void 0 : _ambientLight1.diffuseSphericalHarmonics;
5573
+ }
5574
+ }));
5575
+ }
5571
5576
  }
5572
5577
  var background = data.scene.background;
5573
5578
  scene.background.mode = background.mode;
package/dist/module.js CHANGED
@@ -5540,29 +5540,34 @@ var SceneLoader = /*#__PURE__*/ function(Loader1) {
5540
5540
  var promises = [];
5541
5541
  // parse ambient light
5542
5542
  var ambient = data.scene.ambient;
5543
- var useCustomAmbient = ambient.specularMode === "Custom";
5544
- var useSH = ambient.diffuseMode === DiffuseMode.SphericalHarmonics;
5545
- scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
5546
- scene.ambientLight.specularIntensity = ambient.specularIntensity;
5547
- scene.ambientLight.diffuseMode = ambient.diffuseMode;
5548
- scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
5549
- scene.ambientLight.specularTextureDecodeRGBM = true;
5550
- if (useCustomAmbient && ambient.customAmbientLight) {
5551
- promises.push(// @ts-ignore
5552
- resourceManager.getResourceByRef(ambient.customAmbientLight).then(function(ambientLight) {
5553
- scene.ambientLight.specularTexture = ambientLight.specularTexture;
5554
- }));
5555
- }
5556
- if (ambient.ambientLight && (!useCustomAmbient || useSH)) {
5557
- promises.push(// @ts-ignore
5558
- resourceManager.getResourceByRef(ambient.ambientLight).then(function(ambientLight) {
5559
- if (!useCustomAmbient) {
5560
- scene.ambientLight.specularTexture = ambientLight.specularTexture;
5561
- }
5562
- if (useSH) {
5563
- scene.ambientLight.diffuseSphericalHarmonics = ambientLight.diffuseSphericalHarmonics;
5564
- }
5565
- }));
5543
+ if (ambient) {
5544
+ var useCustomAmbient = ambient.specularMode === "Custom";
5545
+ var useSH = ambient.diffuseMode === DiffuseMode.SphericalHarmonics;
5546
+ scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
5547
+ scene.ambientLight.specularIntensity = ambient.specularIntensity;
5548
+ scene.ambientLight.diffuseMode = ambient.diffuseMode;
5549
+ scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
5550
+ scene.ambientLight.specularTextureDecodeRGBM = true;
5551
+ if (useCustomAmbient && ambient.customAmbientLight) {
5552
+ promises.push(// @ts-ignore
5553
+ resourceManager.getResourceByRef(ambient.customAmbientLight).then(function(ambientLight) {
5554
+ var _ambientLight;
5555
+ scene.ambientLight.specularTexture = (_ambientLight = ambientLight) == null ? void 0 : _ambientLight.specularTexture;
5556
+ }));
5557
+ }
5558
+ if (ambient.ambientLight && (!useCustomAmbient || useSH)) {
5559
+ promises.push(// @ts-ignore
5560
+ resourceManager.getResourceByRef(ambient.ambientLight).then(function(ambientLight) {
5561
+ if (!useCustomAmbient) {
5562
+ var _ambientLight;
5563
+ scene.ambientLight.specularTexture = (_ambientLight = ambientLight) == null ? void 0 : _ambientLight.specularTexture;
5564
+ }
5565
+ if (useSH) {
5566
+ var _ambientLight1;
5567
+ scene.ambientLight.diffuseSphericalHarmonics = (_ambientLight1 = ambientLight) == null ? void 0 : _ambientLight1.diffuseSphericalHarmonics;
5568
+ }
5569
+ }));
5570
+ }
5566
5571
  }
5567
5572
  var background = data.scene.background;
5568
5573
  scene.background.mode = background.mode;