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