@galacean/engine-loader 1.0.0-beta.19 → 1.0.0-beta.21

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
@@ -40,61 +40,56 @@ function _inherits(subClass, superClass) {
40
40
  if (superClass) _set_prototype_of(subClass, superClass);
41
41
  }
42
42
 
43
- /******************************************************************************
44
- Copyright (c) Microsoft Corporation.
45
-
46
- Permission to use, copy, modify, and/or distribute this software for any
47
- purpose with or without fee is hereby granted.
48
-
49
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
50
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
51
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
52
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
53
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
54
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
55
- PERFORMANCE OF THIS SOFTWARE.
56
- ***************************************************************************** */
57
-
58
- function __decorate(decorators, target, key, desc) {
59
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
60
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
61
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
62
- return c > 3 && r && Object.defineProperty(target, key, r), r;
43
+ /******************************************************************************
44
+ Copyright (c) Microsoft Corporation.
45
+
46
+ Permission to use, copy, modify, and/or distribute this software for any
47
+ purpose with or without fee is hereby granted.
48
+
49
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
50
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
51
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
52
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
53
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
54
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
55
+ PERFORMANCE OF THIS SOFTWARE.
56
+ ***************************************************************************** */
57
+
58
+ function __decorate(decorators, target, key, desc) {
59
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
60
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
61
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
62
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
63
+ }
64
+
65
+ function __generator(thisArg, body) {
66
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
67
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
68
+ function verb(n) { return function (v) { return step([n, v]); }; }
69
+ function step(op) {
70
+ if (f) throw new TypeError("Generator is already executing.");
71
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
72
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
73
+ if (y = 0, t) op = [op[0] & 2, t.value];
74
+ switch (op[0]) {
75
+ case 0: case 1: t = op; break;
76
+ case 4: _.label++; return { value: op[1], done: false };
77
+ case 5: _.label++; y = op[1]; op = [0]; continue;
78
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
79
+ default:
80
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
81
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
82
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
83
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
84
+ if (t[2]) _.ops.pop();
85
+ _.trys.pop(); continue;
86
+ }
87
+ op = body.call(thisArg, _);
88
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
89
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
90
+ }
63
91
  }
64
92
 
65
- function __generator(thisArg, body) {
66
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
67
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
68
- function verb(n) { return function (v) { return step([n, v]); }; }
69
- function step(op) {
70
- if (f) throw new TypeError("Generator is already executing.");
71
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
72
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
73
- if (y = 0, t) op = [op[0] & 2, t.value];
74
- switch (op[0]) {
75
- case 0: case 1: t = op; break;
76
- case 4: _.label++; return { value: op[1], done: false };
77
- case 5: _.label++; y = op[1]; op = [0]; continue;
78
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
79
- default:
80
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
81
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
82
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
83
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
84
- if (t[2]) _.ops.pop();
85
- _.trys.pop(); continue;
86
- }
87
- op = body.call(thisArg, _);
88
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
89
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
90
- }
91
- }
92
-
93
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
94
- var e = new Error(message);
95
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
96
- };
97
-
98
93
  var AnimatorControllerLoader = /*#__PURE__*/ function(Loader1) {
99
94
  _inherits(AnimatorControllerLoader, Loader1);
100
95
  function AnimatorControllerLoader() {
@@ -1673,13 +1668,13 @@ var GLTFEntityParser = /*#__PURE__*/ function(GLTFParser) {
1673
1668
  }
1674
1669
  sceneRoots[i] = rootEntity;
1675
1670
  }
1671
+ // @ts-ignore
1672
+ sceneRoots[i]._hookResource = glTFResource;
1673
+ // @ts-ignore
1674
+ glTFResource._addReferCount(1);
1676
1675
  }
1677
1676
  glTFResource.sceneRoots = sceneRoots;
1678
1677
  glTFResource.defaultSceneRoot = sceneRoots[sceneID];
1679
- // @ts-ignore
1680
- glTFResource.defaultSceneRoot._hookResource = glTFResource;
1681
- // @ts-ignore
1682
- glTFResource._addReferCount(1);
1683
1678
  };
1684
1679
  return GLTFEntityParser;
1685
1680
  }(GLTFParser);
@@ -4547,6 +4542,10 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
4547
4542
  scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
4548
4543
  });
4549
4544
  promises.push(ambientLightPromise);
4545
+ } else {
4546
+ scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
4547
+ scene.ambientLight.specularIntensity = ambient.specularIntensity;
4548
+ scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
4550
4549
  }
4551
4550
  var background = data.scene.background;
4552
4551
  scene.background.mode = background.mode;