@galacean/effects 1.2.2 → 1.2.3

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/weapp.js CHANGED
@@ -23464,6 +23464,26 @@ var AssetManager = /** @class */ (function () {
23464
23464
  var _a = options.timeout, timeout = _a === void 0 ? 10 : _a;
23465
23465
  this.timeout = timeout;
23466
23466
  };
23467
+ /**
23468
+ * 根据用户传入的参数修改场景数据
23469
+ */
23470
+ AssetManager.prototype.updateSceneData = function (compositions) {
23471
+ var variables = this.options.variables;
23472
+ if (!variables || Object.keys(variables).length <= 0) {
23473
+ return compositions;
23474
+ }
23475
+ compositions.forEach(function (composition) {
23476
+ composition.items.forEach(function (item) {
23477
+ if (item.type === ItemType$1.text) {
23478
+ var textVariable = variables[item.name];
23479
+ if (textVariable) {
23480
+ item.content.options.text = textVariable;
23481
+ }
23482
+ }
23483
+ });
23484
+ });
23485
+ return compositions;
23486
+ };
23467
23487
  /**
23468
23488
  * 场景创建,通过 json 创建出场景对象,并进行提前编译等工作
23469
23489
  * @param url - json 的 URL 链接或者 json 对象
@@ -23555,6 +23575,7 @@ var AssetManager = /** @class */ (function () {
23555
23575
  for (i = 0; i < scene.images.length; i++) {
23556
23576
  scene.textureOptions[i].image = scene.images[i];
23557
23577
  }
23578
+ scene.jsonScene.compositions = this.updateSceneData(scene.jsonScene.compositions);
23558
23579
  _e.label = 5;
23559
23580
  case 5: return [3 /*break*/, 12];
23560
23581
  case 6: return [4 /*yield*/, hookTimeInfo('processJSON', function () { return _this.processJSON(rawJSON); })];
@@ -23574,6 +23595,7 @@ var AssetManager = /** @class */ (function () {
23574
23595
  return [4 /*yield*/, hookTimeInfo('processTextures', function () { return _this.processTextures(loadedImages_1, loadedBins_1, jsonScene_1); })];
23575
23596
  case 10:
23576
23597
  loadedTextures = _e.sent();
23598
+ jsonScene_1.compositions = this.updateSceneData(jsonScene_1.compositions);
23577
23599
  scene = {
23578
23600
  url: url,
23579
23601
  renderLevel: this.options.renderLevel,
@@ -30418,7 +30440,7 @@ Renderer.create = function (canvas, framework, renderOptions) {
30418
30440
  Engine.create = function (gl) {
30419
30441
  return new GLEngine(gl);
30420
30442
  };
30421
- var version = "1.2.2";
30443
+ var version = "1.2.3";
30422
30444
  logger.info('player version: ' + version);
30423
30445
 
30424
30446
  exports.AbstractPlugin = AbstractPlugin;