@galacean/effects-core 2.0.0-alpha.1 → 2.0.0-alpha.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/asset-loader.d.ts +18 -18
- package/dist/decorators.d.ts +1 -1
- package/dist/index.js +461 -358
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +459 -357
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/cal/calculate-vfx-item.d.ts +8 -3
- package/dist/plugins/cal/playable-graph.d.ts +4 -0
- package/dist/plugins/cal/track.d.ts +3 -4
- package/dist/vfx-item.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime core for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.0.0-alpha.
|
|
6
|
+
* Version: v2.0.0-alpha.3
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/******************************************************************************
|
|
@@ -7338,275 +7338,6 @@ function generateSerializableMember(type, sourceName) {
|
|
|
7338
7338
|
};
|
|
7339
7339
|
}
|
|
7340
7340
|
|
|
7341
|
-
/**
|
|
7342
|
-
* @since 2.0.0
|
|
7343
|
-
* @internal
|
|
7344
|
-
*/
|
|
7345
|
-
var EffectsObject = /** @class */ (function () {
|
|
7346
|
-
function EffectsObject(engine) {
|
|
7347
|
-
this.engine = engine;
|
|
7348
|
-
this.guid = generateGUID();
|
|
7349
|
-
this.taggedProperties = {};
|
|
7350
|
-
this.engine.addInstance(this);
|
|
7351
|
-
}
|
|
7352
|
-
EffectsObject.prototype.getInstanceId = function () {
|
|
7353
|
-
return this.guid;
|
|
7354
|
-
};
|
|
7355
|
-
EffectsObject.prototype.setInstanceId = function (guid) {
|
|
7356
|
-
this.engine.removeInstance(this.guid);
|
|
7357
|
-
this.guid = guid;
|
|
7358
|
-
this.engine.addInstance(this);
|
|
7359
|
-
};
|
|
7360
|
-
EffectsObject.prototype.toData = function () { };
|
|
7361
|
-
/**
|
|
7362
|
-
* 反序列化函数
|
|
7363
|
-
*
|
|
7364
|
-
* @param data - 对象的序列化的数据
|
|
7365
|
-
*/
|
|
7366
|
-
EffectsObject.prototype.fromData = function (data) {
|
|
7367
|
-
if (data.id) {
|
|
7368
|
-
this.setInstanceId(data.id);
|
|
7369
|
-
}
|
|
7370
|
-
};
|
|
7371
|
-
EffectsObject.prototype.dispose = function () { };
|
|
7372
|
-
__decorate([
|
|
7373
|
-
serialize()
|
|
7374
|
-
], EffectsObject.prototype, "guid", void 0);
|
|
7375
|
-
return EffectsObject;
|
|
7376
|
-
}());
|
|
7377
|
-
|
|
7378
|
-
/**
|
|
7379
|
-
* @since 2.0.0
|
|
7380
|
-
* @internal
|
|
7381
|
-
*/
|
|
7382
|
-
var Component = /** @class */ (function (_super) {
|
|
7383
|
-
__extends(Component, _super);
|
|
7384
|
-
function Component() {
|
|
7385
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
7386
|
-
}
|
|
7387
|
-
Object.defineProperty(Component.prototype, "transform", {
|
|
7388
|
-
/**
|
|
7389
|
-
* 附加到的 VFXItem 对象 Transform 组件
|
|
7390
|
-
*/
|
|
7391
|
-
get: function () {
|
|
7392
|
-
return this.item.transform;
|
|
7393
|
-
},
|
|
7394
|
-
enumerable: false,
|
|
7395
|
-
configurable: true
|
|
7396
|
-
});
|
|
7397
|
-
Component.prototype.onAttached = function () { };
|
|
7398
|
-
Component.prototype.onDestroy = function () { };
|
|
7399
|
-
Component.prototype.fromData = function (data) {
|
|
7400
|
-
_super.prototype.fromData.call(this, data);
|
|
7401
|
-
if (data.item) {
|
|
7402
|
-
this.item = data.item;
|
|
7403
|
-
}
|
|
7404
|
-
};
|
|
7405
|
-
Component.prototype.dispose = function () {
|
|
7406
|
-
this.onDestroy();
|
|
7407
|
-
if (this.item) {
|
|
7408
|
-
removeItem(this.item.components, this);
|
|
7409
|
-
}
|
|
7410
|
-
};
|
|
7411
|
-
return Component;
|
|
7412
|
-
}(EffectsObject));
|
|
7413
|
-
/**
|
|
7414
|
-
* @since 2.0.0
|
|
7415
|
-
* @internal
|
|
7416
|
-
*/
|
|
7417
|
-
var Behaviour = /** @class */ (function (_super) {
|
|
7418
|
-
__extends(Behaviour, _super);
|
|
7419
|
-
function Behaviour() {
|
|
7420
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
7421
|
-
_this._enabled = true;
|
|
7422
|
-
return _this;
|
|
7423
|
-
}
|
|
7424
|
-
Object.defineProperty(Behaviour.prototype, "isActiveAndEnabled", {
|
|
7425
|
-
/**
|
|
7426
|
-
* 组件是否可以更新,true 更新,false 不更新
|
|
7427
|
-
*/
|
|
7428
|
-
get: function () {
|
|
7429
|
-
return this.item.getVisible() && this.enabled;
|
|
7430
|
-
},
|
|
7431
|
-
enumerable: false,
|
|
7432
|
-
configurable: true
|
|
7433
|
-
});
|
|
7434
|
-
Object.defineProperty(Behaviour.prototype, "enabled", {
|
|
7435
|
-
get: function () {
|
|
7436
|
-
return this._enabled;
|
|
7437
|
-
},
|
|
7438
|
-
set: function (value) {
|
|
7439
|
-
this._enabled = value;
|
|
7440
|
-
if (value) {
|
|
7441
|
-
this.onBehaviourEnable();
|
|
7442
|
-
}
|
|
7443
|
-
},
|
|
7444
|
-
enumerable: false,
|
|
7445
|
-
configurable: true
|
|
7446
|
-
});
|
|
7447
|
-
Behaviour.prototype.onBehaviourEnable = function () { };
|
|
7448
|
-
Behaviour.prototype.fromData = function (data) {
|
|
7449
|
-
_super.prototype.fromData.call(this, data);
|
|
7450
|
-
};
|
|
7451
|
-
Behaviour.prototype.toData = function () {
|
|
7452
|
-
_super.prototype.toData.call(this);
|
|
7453
|
-
};
|
|
7454
|
-
__decorate([
|
|
7455
|
-
serialize()
|
|
7456
|
-
], Behaviour.prototype, "_enabled", void 0);
|
|
7457
|
-
return Behaviour;
|
|
7458
|
-
}(Component));
|
|
7459
|
-
/**
|
|
7460
|
-
* @since 2.0.0
|
|
7461
|
-
* @internal
|
|
7462
|
-
*/
|
|
7463
|
-
var ItemBehaviour = /** @class */ (function (_super) {
|
|
7464
|
-
__extends(ItemBehaviour, _super);
|
|
7465
|
-
function ItemBehaviour() {
|
|
7466
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
7467
|
-
_this.started = false;
|
|
7468
|
-
return _this;
|
|
7469
|
-
}
|
|
7470
|
-
// /**
|
|
7471
|
-
// * 生命周期函数,初始化后调用,生命周期内只调用一次
|
|
7472
|
-
// */
|
|
7473
|
-
// awake () {
|
|
7474
|
-
// // OVERRIDE
|
|
7475
|
-
// }
|
|
7476
|
-
/**
|
|
7477
|
-
* 在每次设置 enabled 为 true 时触发
|
|
7478
|
-
*/
|
|
7479
|
-
ItemBehaviour.prototype.onEnable = function () { };
|
|
7480
|
-
/**
|
|
7481
|
-
* 生命周期函数,在第一次 update 前调用,生命周期内只调用一次
|
|
7482
|
-
*/
|
|
7483
|
-
ItemBehaviour.prototype.start = function () {
|
|
7484
|
-
// OVERRIDE
|
|
7485
|
-
};
|
|
7486
|
-
/**
|
|
7487
|
-
* 生命周期函数,每帧调用一次
|
|
7488
|
-
*/
|
|
7489
|
-
ItemBehaviour.prototype.update = function (dt) {
|
|
7490
|
-
// OVERRIDE
|
|
7491
|
-
};
|
|
7492
|
-
/**
|
|
7493
|
-
* 生命周期函数,每帧调用一次,在 update 之后调用
|
|
7494
|
-
*/
|
|
7495
|
-
ItemBehaviour.prototype.lateUpdate = function (dt) {
|
|
7496
|
-
// OVERRIDE
|
|
7497
|
-
};
|
|
7498
|
-
ItemBehaviour.prototype.onAttached = function () {
|
|
7499
|
-
this.item.itemBehaviours.push(this);
|
|
7500
|
-
};
|
|
7501
|
-
ItemBehaviour.prototype.dispose = function () {
|
|
7502
|
-
if (this.item) {
|
|
7503
|
-
removeItem(this.item.itemBehaviours, this);
|
|
7504
|
-
}
|
|
7505
|
-
_super.prototype.dispose.call(this);
|
|
7506
|
-
};
|
|
7507
|
-
ItemBehaviour.prototype.onBehaviourEnable = function () {
|
|
7508
|
-
this.onEnable();
|
|
7509
|
-
if (!this.started) {
|
|
7510
|
-
this.start();
|
|
7511
|
-
this.started = true;
|
|
7512
|
-
}
|
|
7513
|
-
};
|
|
7514
|
-
return ItemBehaviour;
|
|
7515
|
-
}(Behaviour));
|
|
7516
|
-
|
|
7517
|
-
/**
|
|
7518
|
-
* 所有渲染组件的基类
|
|
7519
|
-
* @since 2.0.0
|
|
7520
|
-
*/
|
|
7521
|
-
var RendererComponent = /** @class */ (function (_super) {
|
|
7522
|
-
__extends(RendererComponent, _super);
|
|
7523
|
-
function RendererComponent() {
|
|
7524
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
7525
|
-
_this.started = false;
|
|
7526
|
-
_this.materials = [];
|
|
7527
|
-
_this._enabled = true;
|
|
7528
|
-
return _this;
|
|
7529
|
-
}
|
|
7530
|
-
Object.defineProperty(RendererComponent.prototype, "priority", {
|
|
7531
|
-
get: function () {
|
|
7532
|
-
return this._priority;
|
|
7533
|
-
},
|
|
7534
|
-
set: function (value) {
|
|
7535
|
-
this._priority = value;
|
|
7536
|
-
},
|
|
7537
|
-
enumerable: false,
|
|
7538
|
-
configurable: true
|
|
7539
|
-
});
|
|
7540
|
-
Object.defineProperty(RendererComponent.prototype, "enabled", {
|
|
7541
|
-
get: function () {
|
|
7542
|
-
return this._enabled;
|
|
7543
|
-
},
|
|
7544
|
-
set: function (value) {
|
|
7545
|
-
this._enabled = value;
|
|
7546
|
-
if (value) {
|
|
7547
|
-
this.onEnable();
|
|
7548
|
-
}
|
|
7549
|
-
},
|
|
7550
|
-
enumerable: false,
|
|
7551
|
-
configurable: true
|
|
7552
|
-
});
|
|
7553
|
-
Object.defineProperty(RendererComponent.prototype, "isActiveAndEnabled", {
|
|
7554
|
-
/**
|
|
7555
|
-
* 组件是否可以更新,true 更新,false 不更新
|
|
7556
|
-
*/
|
|
7557
|
-
get: function () {
|
|
7558
|
-
return this.item.getVisible() && this.enabled;
|
|
7559
|
-
},
|
|
7560
|
-
enumerable: false,
|
|
7561
|
-
configurable: true
|
|
7562
|
-
});
|
|
7563
|
-
Object.defineProperty(RendererComponent.prototype, "material", {
|
|
7564
|
-
get: function () {
|
|
7565
|
-
return this.materials[0];
|
|
7566
|
-
},
|
|
7567
|
-
set: function (material) {
|
|
7568
|
-
if (this.materials.length === 0) {
|
|
7569
|
-
this.materials.push(material);
|
|
7570
|
-
}
|
|
7571
|
-
else {
|
|
7572
|
-
this.materials[0] = material;
|
|
7573
|
-
}
|
|
7574
|
-
},
|
|
7575
|
-
enumerable: false,
|
|
7576
|
-
configurable: true
|
|
7577
|
-
});
|
|
7578
|
-
RendererComponent.prototype.onEnable = function () { };
|
|
7579
|
-
RendererComponent.prototype.start = function () { };
|
|
7580
|
-
RendererComponent.prototype.update = function (dt) { };
|
|
7581
|
-
RendererComponent.prototype.lateUpdate = function (dt) { };
|
|
7582
|
-
RendererComponent.prototype.render = function (renderer) { };
|
|
7583
|
-
RendererComponent.prototype.onAttached = function () {
|
|
7584
|
-
this.item.rendererComponents.push(this);
|
|
7585
|
-
};
|
|
7586
|
-
RendererComponent.prototype.fromData = function (data) {
|
|
7587
|
-
_super.prototype.fromData.call(this, data);
|
|
7588
|
-
};
|
|
7589
|
-
RendererComponent.prototype.toData = function () {
|
|
7590
|
-
_super.prototype.toData.call(this);
|
|
7591
|
-
};
|
|
7592
|
-
RendererComponent.prototype.dispose = function () {
|
|
7593
|
-
if (this.item) {
|
|
7594
|
-
removeItem(this.item.rendererComponents, this);
|
|
7595
|
-
}
|
|
7596
|
-
_super.prototype.dispose.call(this);
|
|
7597
|
-
};
|
|
7598
|
-
__decorate([
|
|
7599
|
-
serialize()
|
|
7600
|
-
], RendererComponent.prototype, "materials", void 0);
|
|
7601
|
-
__decorate([
|
|
7602
|
-
serialize()
|
|
7603
|
-
], RendererComponent.prototype, "_priority", void 0);
|
|
7604
|
-
__decorate([
|
|
7605
|
-
serialize()
|
|
7606
|
-
], RendererComponent.prototype, "_enabled", void 0);
|
|
7607
|
-
return RendererComponent;
|
|
7608
|
-
}(Component));
|
|
7609
|
-
|
|
7610
7341
|
var ShaderType;
|
|
7611
7342
|
(function (ShaderType) {
|
|
7612
7343
|
ShaderType[ShaderType["vertex"] = 0] = "vertex";
|
|
@@ -8193,6 +7924,43 @@ function loadMipmapImage(pointer, bins) {
|
|
|
8193
7924
|
});
|
|
8194
7925
|
}
|
|
8195
7926
|
|
|
7927
|
+
/**
|
|
7928
|
+
* @since 2.0.0
|
|
7929
|
+
* @internal
|
|
7930
|
+
*/
|
|
7931
|
+
var EffectsObject = /** @class */ (function () {
|
|
7932
|
+
function EffectsObject(engine) {
|
|
7933
|
+
this.engine = engine;
|
|
7934
|
+
this.guid = generateGUID();
|
|
7935
|
+
this.taggedProperties = {};
|
|
7936
|
+
this.engine.addInstance(this);
|
|
7937
|
+
}
|
|
7938
|
+
EffectsObject.prototype.getInstanceId = function () {
|
|
7939
|
+
return this.guid;
|
|
7940
|
+
};
|
|
7941
|
+
EffectsObject.prototype.setInstanceId = function (guid) {
|
|
7942
|
+
this.engine.removeInstance(this.guid);
|
|
7943
|
+
this.guid = guid;
|
|
7944
|
+
this.engine.addInstance(this);
|
|
7945
|
+
};
|
|
7946
|
+
EffectsObject.prototype.toData = function () { };
|
|
7947
|
+
/**
|
|
7948
|
+
* 反序列化函数
|
|
7949
|
+
*
|
|
7950
|
+
* @param data - 对象的序列化的数据
|
|
7951
|
+
*/
|
|
7952
|
+
EffectsObject.prototype.fromData = function (data) {
|
|
7953
|
+
if (data.id) {
|
|
7954
|
+
this.setInstanceId(data.id);
|
|
7955
|
+
}
|
|
7956
|
+
};
|
|
7957
|
+
EffectsObject.prototype.dispose = function () { };
|
|
7958
|
+
__decorate([
|
|
7959
|
+
serialize()
|
|
7960
|
+
], EffectsObject.prototype, "guid", void 0);
|
|
7961
|
+
return EffectsObject;
|
|
7962
|
+
}());
|
|
7963
|
+
|
|
8196
7964
|
var seed$9 = 1;
|
|
8197
7965
|
/**
|
|
8198
7966
|
* Texture 抽象类
|
|
@@ -9003,54 +8771,286 @@ var SemanticMap = /** @class */ (function () {
|
|
|
9003
8771
|
SemanticMap.prototype.hasSemanticValue = function (name) {
|
|
9004
8772
|
return name in this.semantics;
|
|
9005
8773
|
};
|
|
9006
|
-
SemanticMap.prototype.dispose = function () {
|
|
9007
|
-
var _this = this;
|
|
9008
|
-
Object.keys(this.semantics).forEach(function (name) {
|
|
9009
|
-
delete _this.semantics[name];
|
|
9010
|
-
});
|
|
8774
|
+
SemanticMap.prototype.dispose = function () {
|
|
8775
|
+
var _this = this;
|
|
8776
|
+
Object.keys(this.semantics).forEach(function (name) {
|
|
8777
|
+
delete _this.semantics[name];
|
|
8778
|
+
});
|
|
8779
|
+
};
|
|
8780
|
+
return SemanticMap;
|
|
8781
|
+
}());
|
|
8782
|
+
|
|
8783
|
+
var _a$4;
|
|
8784
|
+
var BYTES_TYPE_MAP = (_a$4 = {},
|
|
8785
|
+
_a$4[glContext.FLOAT] = Float32Array.BYTES_PER_ELEMENT,
|
|
8786
|
+
_a$4[glContext.INT] = Int32Array.BYTES_PER_ELEMENT,
|
|
8787
|
+
_a$4[glContext.SHORT] = Int16Array.BYTES_PER_ELEMENT,
|
|
8788
|
+
_a$4[glContext.BYTE] = Int8Array.BYTES_PER_ELEMENT,
|
|
8789
|
+
_a$4);
|
|
8790
|
+
/**
|
|
8791
|
+
* Geometry 抽象类
|
|
8792
|
+
*/
|
|
8793
|
+
var Geometry = /** @class */ (function (_super) {
|
|
8794
|
+
__extends(Geometry, _super);
|
|
8795
|
+
function Geometry() {
|
|
8796
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
8797
|
+
}
|
|
8798
|
+
/**
|
|
8799
|
+
* 初始化 GPU 资源
|
|
8800
|
+
* @override
|
|
8801
|
+
*/
|
|
8802
|
+
Geometry.prototype.initialize = function () {
|
|
8803
|
+
// OVERRIDE
|
|
8804
|
+
};
|
|
8805
|
+
/**
|
|
8806
|
+
* 几何数据刷新
|
|
8807
|
+
*/
|
|
8808
|
+
Geometry.prototype.flush = function () {
|
|
8809
|
+
// OVERRIDE
|
|
8810
|
+
};
|
|
8811
|
+
return Geometry;
|
|
8812
|
+
}(EffectsObject));
|
|
8813
|
+
function generateEmptyTypedArray(type) {
|
|
8814
|
+
if (type === glContext.INT) {
|
|
8815
|
+
return new Int32Array(0);
|
|
8816
|
+
}
|
|
8817
|
+
if (type === glContext.SHORT) {
|
|
8818
|
+
return new Int16Array(0);
|
|
8819
|
+
}
|
|
8820
|
+
return new Float32Array(0);
|
|
8821
|
+
}
|
|
8822
|
+
|
|
8823
|
+
/**
|
|
8824
|
+
* @since 2.0.0
|
|
8825
|
+
* @internal
|
|
8826
|
+
*/
|
|
8827
|
+
var Component = /** @class */ (function (_super) {
|
|
8828
|
+
__extends(Component, _super);
|
|
8829
|
+
function Component() {
|
|
8830
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
8831
|
+
}
|
|
8832
|
+
Object.defineProperty(Component.prototype, "transform", {
|
|
8833
|
+
/**
|
|
8834
|
+
* 附加到的 VFXItem 对象 Transform 组件
|
|
8835
|
+
*/
|
|
8836
|
+
get: function () {
|
|
8837
|
+
return this.item.transform;
|
|
8838
|
+
},
|
|
8839
|
+
enumerable: false,
|
|
8840
|
+
configurable: true
|
|
8841
|
+
});
|
|
8842
|
+
Component.prototype.onAttached = function () { };
|
|
8843
|
+
Component.prototype.onDestroy = function () { };
|
|
8844
|
+
Component.prototype.fromData = function (data) {
|
|
8845
|
+
_super.prototype.fromData.call(this, data);
|
|
8846
|
+
if (data.item) {
|
|
8847
|
+
this.item = data.item;
|
|
8848
|
+
}
|
|
8849
|
+
};
|
|
8850
|
+
Component.prototype.dispose = function () {
|
|
8851
|
+
this.onDestroy();
|
|
8852
|
+
if (this.item) {
|
|
8853
|
+
removeItem(this.item.components, this);
|
|
8854
|
+
}
|
|
8855
|
+
};
|
|
8856
|
+
return Component;
|
|
8857
|
+
}(EffectsObject));
|
|
8858
|
+
/**
|
|
8859
|
+
* @since 2.0.0
|
|
8860
|
+
* @internal
|
|
8861
|
+
*/
|
|
8862
|
+
var Behaviour = /** @class */ (function (_super) {
|
|
8863
|
+
__extends(Behaviour, _super);
|
|
8864
|
+
function Behaviour() {
|
|
8865
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
8866
|
+
_this._enabled = true;
|
|
8867
|
+
return _this;
|
|
8868
|
+
}
|
|
8869
|
+
Object.defineProperty(Behaviour.prototype, "isActiveAndEnabled", {
|
|
8870
|
+
/**
|
|
8871
|
+
* 组件是否可以更新,true 更新,false 不更新
|
|
8872
|
+
*/
|
|
8873
|
+
get: function () {
|
|
8874
|
+
return this.item.getVisible() && this.enabled;
|
|
8875
|
+
},
|
|
8876
|
+
enumerable: false,
|
|
8877
|
+
configurable: true
|
|
8878
|
+
});
|
|
8879
|
+
Object.defineProperty(Behaviour.prototype, "enabled", {
|
|
8880
|
+
get: function () {
|
|
8881
|
+
return this._enabled;
|
|
8882
|
+
},
|
|
8883
|
+
set: function (value) {
|
|
8884
|
+
this._enabled = value;
|
|
8885
|
+
if (value) {
|
|
8886
|
+
this.onBehaviourEnable();
|
|
8887
|
+
}
|
|
8888
|
+
},
|
|
8889
|
+
enumerable: false,
|
|
8890
|
+
configurable: true
|
|
8891
|
+
});
|
|
8892
|
+
Behaviour.prototype.onBehaviourEnable = function () { };
|
|
8893
|
+
Behaviour.prototype.fromData = function (data) {
|
|
8894
|
+
_super.prototype.fromData.call(this, data);
|
|
8895
|
+
};
|
|
8896
|
+
Behaviour.prototype.toData = function () {
|
|
8897
|
+
_super.prototype.toData.call(this);
|
|
9011
8898
|
};
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
_a$4[glContext.FLOAT] = Float32Array.BYTES_PER_ELEMENT,
|
|
9018
|
-
_a$4[glContext.INT] = Int32Array.BYTES_PER_ELEMENT,
|
|
9019
|
-
_a$4[glContext.SHORT] = Int16Array.BYTES_PER_ELEMENT,
|
|
9020
|
-
_a$4[glContext.BYTE] = Int8Array.BYTES_PER_ELEMENT,
|
|
9021
|
-
_a$4);
|
|
8899
|
+
__decorate([
|
|
8900
|
+
serialize()
|
|
8901
|
+
], Behaviour.prototype, "_enabled", void 0);
|
|
8902
|
+
return Behaviour;
|
|
8903
|
+
}(Component));
|
|
9022
8904
|
/**
|
|
9023
|
-
*
|
|
8905
|
+
* @since 2.0.0
|
|
8906
|
+
* @internal
|
|
9024
8907
|
*/
|
|
9025
|
-
var
|
|
9026
|
-
__extends(
|
|
9027
|
-
function
|
|
9028
|
-
|
|
8908
|
+
var ItemBehaviour = /** @class */ (function (_super) {
|
|
8909
|
+
__extends(ItemBehaviour, _super);
|
|
8910
|
+
function ItemBehaviour() {
|
|
8911
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
8912
|
+
_this.started = false;
|
|
8913
|
+
return _this;
|
|
9029
8914
|
}
|
|
8915
|
+
// /**
|
|
8916
|
+
// * 生命周期函数,初始化后调用,生命周期内只调用一次
|
|
8917
|
+
// */
|
|
8918
|
+
// awake () {
|
|
8919
|
+
// // OVERRIDE
|
|
8920
|
+
// }
|
|
9030
8921
|
/**
|
|
9031
|
-
*
|
|
9032
|
-
* @override
|
|
8922
|
+
* 在每次设置 enabled 为 true 时触发
|
|
9033
8923
|
*/
|
|
9034
|
-
|
|
8924
|
+
ItemBehaviour.prototype.onEnable = function () { };
|
|
8925
|
+
/**
|
|
8926
|
+
* 生命周期函数,在第一次 update 前调用,生命周期内只调用一次
|
|
8927
|
+
*/
|
|
8928
|
+
ItemBehaviour.prototype.start = function () {
|
|
9035
8929
|
// OVERRIDE
|
|
9036
8930
|
};
|
|
9037
8931
|
/**
|
|
9038
|
-
*
|
|
8932
|
+
* 生命周期函数,每帧调用一次
|
|
9039
8933
|
*/
|
|
9040
|
-
|
|
8934
|
+
ItemBehaviour.prototype.update = function (dt) {
|
|
9041
8935
|
// OVERRIDE
|
|
9042
8936
|
};
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
}
|
|
9049
|
-
|
|
9050
|
-
|
|
8937
|
+
/**
|
|
8938
|
+
* 生命周期函数,每帧调用一次,在 update 之后调用
|
|
8939
|
+
*/
|
|
8940
|
+
ItemBehaviour.prototype.lateUpdate = function (dt) {
|
|
8941
|
+
// OVERRIDE
|
|
8942
|
+
};
|
|
8943
|
+
ItemBehaviour.prototype.onAttached = function () {
|
|
8944
|
+
this.item.itemBehaviours.push(this);
|
|
8945
|
+
};
|
|
8946
|
+
ItemBehaviour.prototype.dispose = function () {
|
|
8947
|
+
if (this.item) {
|
|
8948
|
+
removeItem(this.item.itemBehaviours, this);
|
|
8949
|
+
}
|
|
8950
|
+
_super.prototype.dispose.call(this);
|
|
8951
|
+
};
|
|
8952
|
+
ItemBehaviour.prototype.onBehaviourEnable = function () {
|
|
8953
|
+
this.onEnable();
|
|
8954
|
+
if (!this.started) {
|
|
8955
|
+
this.start();
|
|
8956
|
+
this.started = true;
|
|
8957
|
+
}
|
|
8958
|
+
};
|
|
8959
|
+
return ItemBehaviour;
|
|
8960
|
+
}(Behaviour));
|
|
8961
|
+
|
|
8962
|
+
/**
|
|
8963
|
+
* 所有渲染组件的基类
|
|
8964
|
+
* @since 2.0.0
|
|
8965
|
+
*/
|
|
8966
|
+
var RendererComponent = /** @class */ (function (_super) {
|
|
8967
|
+
__extends(RendererComponent, _super);
|
|
8968
|
+
function RendererComponent() {
|
|
8969
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
8970
|
+
_this.started = false;
|
|
8971
|
+
_this.materials = [];
|
|
8972
|
+
_this._enabled = true;
|
|
8973
|
+
return _this;
|
|
9051
8974
|
}
|
|
9052
|
-
|
|
9053
|
-
|
|
8975
|
+
Object.defineProperty(RendererComponent.prototype, "priority", {
|
|
8976
|
+
get: function () {
|
|
8977
|
+
return this._priority;
|
|
8978
|
+
},
|
|
8979
|
+
set: function (value) {
|
|
8980
|
+
this._priority = value;
|
|
8981
|
+
},
|
|
8982
|
+
enumerable: false,
|
|
8983
|
+
configurable: true
|
|
8984
|
+
});
|
|
8985
|
+
Object.defineProperty(RendererComponent.prototype, "enabled", {
|
|
8986
|
+
get: function () {
|
|
8987
|
+
return this._enabled;
|
|
8988
|
+
},
|
|
8989
|
+
set: function (value) {
|
|
8990
|
+
this._enabled = value;
|
|
8991
|
+
if (value) {
|
|
8992
|
+
this.onEnable();
|
|
8993
|
+
}
|
|
8994
|
+
},
|
|
8995
|
+
enumerable: false,
|
|
8996
|
+
configurable: true
|
|
8997
|
+
});
|
|
8998
|
+
Object.defineProperty(RendererComponent.prototype, "isActiveAndEnabled", {
|
|
8999
|
+
/**
|
|
9000
|
+
* 组件是否可以更新,true 更新,false 不更新
|
|
9001
|
+
*/
|
|
9002
|
+
get: function () {
|
|
9003
|
+
return this.item.getVisible() && this.enabled;
|
|
9004
|
+
},
|
|
9005
|
+
enumerable: false,
|
|
9006
|
+
configurable: true
|
|
9007
|
+
});
|
|
9008
|
+
Object.defineProperty(RendererComponent.prototype, "material", {
|
|
9009
|
+
get: function () {
|
|
9010
|
+
return this.materials[0];
|
|
9011
|
+
},
|
|
9012
|
+
set: function (material) {
|
|
9013
|
+
if (this.materials.length === 0) {
|
|
9014
|
+
this.materials.push(material);
|
|
9015
|
+
}
|
|
9016
|
+
else {
|
|
9017
|
+
this.materials[0] = material;
|
|
9018
|
+
}
|
|
9019
|
+
},
|
|
9020
|
+
enumerable: false,
|
|
9021
|
+
configurable: true
|
|
9022
|
+
});
|
|
9023
|
+
RendererComponent.prototype.onEnable = function () { };
|
|
9024
|
+
RendererComponent.prototype.start = function () { };
|
|
9025
|
+
RendererComponent.prototype.update = function (dt) { };
|
|
9026
|
+
RendererComponent.prototype.lateUpdate = function (dt) { };
|
|
9027
|
+
RendererComponent.prototype.render = function (renderer) { };
|
|
9028
|
+
RendererComponent.prototype.onAttached = function () {
|
|
9029
|
+
this.item.rendererComponents.push(this);
|
|
9030
|
+
};
|
|
9031
|
+
RendererComponent.prototype.fromData = function (data) {
|
|
9032
|
+
_super.prototype.fromData.call(this, data);
|
|
9033
|
+
};
|
|
9034
|
+
RendererComponent.prototype.toData = function () {
|
|
9035
|
+
_super.prototype.toData.call(this);
|
|
9036
|
+
};
|
|
9037
|
+
RendererComponent.prototype.dispose = function () {
|
|
9038
|
+
if (this.item) {
|
|
9039
|
+
removeItem(this.item.rendererComponents, this);
|
|
9040
|
+
}
|
|
9041
|
+
_super.prototype.dispose.call(this);
|
|
9042
|
+
};
|
|
9043
|
+
__decorate([
|
|
9044
|
+
serialize()
|
|
9045
|
+
], RendererComponent.prototype, "materials", void 0);
|
|
9046
|
+
__decorate([
|
|
9047
|
+
serialize()
|
|
9048
|
+
], RendererComponent.prototype, "_priority", void 0);
|
|
9049
|
+
__decorate([
|
|
9050
|
+
serialize()
|
|
9051
|
+
], RendererComponent.prototype, "_enabled", void 0);
|
|
9052
|
+
return RendererComponent;
|
|
9053
|
+
}(Component));
|
|
9054
9054
|
|
|
9055
9055
|
var seed$7 = 1;
|
|
9056
9056
|
/**
|
|
@@ -11287,7 +11287,7 @@ var SerializationHelper = /** @class */ (function () {
|
|
|
11287
11287
|
};
|
|
11288
11288
|
SerializationHelper.deserializeProperty = function (property, engine, level) {
|
|
11289
11289
|
var e_11, _a, e_12, _b;
|
|
11290
|
-
if (level >
|
|
11290
|
+
if (level > 14) {
|
|
11291
11291
|
console.error('序列化数据的内嵌对象层数大于上限');
|
|
11292
11292
|
return;
|
|
11293
11293
|
}
|
|
@@ -11348,7 +11348,7 @@ var SerializationHelper = /** @class */ (function () {
|
|
|
11348
11348
|
return __generator(this, function (_j) {
|
|
11349
11349
|
switch (_j.label) {
|
|
11350
11350
|
case 0:
|
|
11351
|
-
if (level >
|
|
11351
|
+
if (level > 14) {
|
|
11352
11352
|
console.error('序列化数据的内嵌对象层数大于上限');
|
|
11353
11353
|
return [2 /*return*/];
|
|
11354
11354
|
}
|
|
@@ -11439,7 +11439,7 @@ var SerializationHelper = /** @class */ (function () {
|
|
|
11439
11439
|
};
|
|
11440
11440
|
SerializationHelper.serializeObjectProperty = function (objectProperty, serializedData, level) {
|
|
11441
11441
|
var e_15, _a;
|
|
11442
|
-
if (level >
|
|
11442
|
+
if (level > 14) {
|
|
11443
11443
|
console.error('序列化数据的内嵌对象层数大于上限');
|
|
11444
11444
|
return;
|
|
11445
11445
|
}
|
|
@@ -11484,7 +11484,7 @@ var SerializationHelper = /** @class */ (function () {
|
|
|
11484
11484
|
}
|
|
11485
11485
|
};
|
|
11486
11486
|
SerializationHelper.serializeArrayProperty = function (arrayProperty, serializedData, level) {
|
|
11487
|
-
if (level >
|
|
11487
|
+
if (level > 14) {
|
|
11488
11488
|
console.error('序列化数据的内嵌对象层数大于上限');
|
|
11489
11489
|
return;
|
|
11490
11490
|
}
|
|
@@ -11650,24 +11650,24 @@ var Database = /** @class */ (function () {
|
|
|
11650
11650
|
}());
|
|
11651
11651
|
var DataType;
|
|
11652
11652
|
(function (DataType) {
|
|
11653
|
-
DataType[
|
|
11654
|
-
DataType[
|
|
11655
|
-
DataType[
|
|
11656
|
-
DataType[
|
|
11657
|
-
DataType[
|
|
11658
|
-
DataType[
|
|
11659
|
-
DataType[
|
|
11660
|
-
DataType[
|
|
11661
|
-
DataType[
|
|
11662
|
-
DataType[
|
|
11663
|
-
DataType[
|
|
11653
|
+
DataType["VFXItemData"] = "VFXItemData";
|
|
11654
|
+
DataType["EffectComponent"] = "EffectComponent";
|
|
11655
|
+
DataType["Material"] = "Material";
|
|
11656
|
+
DataType["Shader"] = "Shader";
|
|
11657
|
+
DataType["SpriteComponent"] = "SpriteComponent";
|
|
11658
|
+
DataType["ParticleSystem"] = "ParticleSystem";
|
|
11659
|
+
DataType["InteractComponent"] = "InteractComponent";
|
|
11660
|
+
DataType["CameraController"] = "CameraController";
|
|
11661
|
+
DataType["Geometry"] = "Geometry";
|
|
11662
|
+
DataType["Texture"] = "Texture";
|
|
11663
|
+
DataType["TextComponent"] = "TextComponent";
|
|
11664
11664
|
// FIXME: 先完成ECS的场景转换,后面移到spec中
|
|
11665
|
-
DataType[
|
|
11666
|
-
DataType[
|
|
11667
|
-
DataType[
|
|
11668
|
-
DataType[
|
|
11669
|
-
DataType[
|
|
11670
|
-
DataType[
|
|
11665
|
+
DataType["MeshComponent"] = "MeshComponent";
|
|
11666
|
+
DataType["SkyboxComponent"] = "SkyboxComponent";
|
|
11667
|
+
DataType["LightComponent"] = "LightComponent";
|
|
11668
|
+
DataType["CameraComponent"] = "CameraComponent";
|
|
11669
|
+
DataType["ModelPluginComponent"] = "ModelPluginComponent";
|
|
11670
|
+
DataType["TreeComponent"] = "TreeComponent";
|
|
11671
11671
|
})(DataType || (DataType = {}));
|
|
11672
11672
|
|
|
11673
11673
|
/**
|
|
@@ -13934,15 +13934,25 @@ var PlayableOutput = /** @class */ (function () {
|
|
|
13934
13934
|
};
|
|
13935
13935
|
return PlayableOutput;
|
|
13936
13936
|
}());
|
|
13937
|
+
var PlayableAsset = /** @class */ (function () {
|
|
13938
|
+
function PlayableAsset() {
|
|
13939
|
+
}
|
|
13940
|
+
PlayableAsset.prototype.fromData = function (data) {
|
|
13941
|
+
};
|
|
13942
|
+
return PlayableAsset;
|
|
13943
|
+
}());
|
|
13937
13944
|
|
|
13938
13945
|
/**
|
|
13939
13946
|
* @since 2.0.0
|
|
13940
13947
|
* @internal
|
|
13941
13948
|
*/
|
|
13942
|
-
var Track = /** @class */ (function () {
|
|
13949
|
+
var Track = /** @class */ (function (_super) {
|
|
13950
|
+
__extends(Track, _super);
|
|
13943
13951
|
function Track() {
|
|
13944
|
-
|
|
13945
|
-
|
|
13952
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
13953
|
+
_this.clips = [];
|
|
13954
|
+
_this.clipSeed = 0;
|
|
13955
|
+
return _this;
|
|
13946
13956
|
}
|
|
13947
13957
|
Track.prototype.createOutput = function () {
|
|
13948
13958
|
var output = new PlayableOutput();
|
|
@@ -13954,7 +13964,7 @@ var Track = /** @class */ (function () {
|
|
|
13954
13964
|
Track.prototype.createMixerPlayable = function () {
|
|
13955
13965
|
return new Playable();
|
|
13956
13966
|
};
|
|
13957
|
-
Track.prototype.
|
|
13967
|
+
Track.prototype.createPlayable = function () {
|
|
13958
13968
|
var e_1, _a;
|
|
13959
13969
|
var defaultMixPlayable = this.createMixerPlayable();
|
|
13960
13970
|
try {
|
|
@@ -14006,7 +14016,7 @@ var Track = /** @class */ (function () {
|
|
|
14006
14016
|
this.clips.push(clip);
|
|
14007
14017
|
};
|
|
14008
14018
|
return Track;
|
|
14009
|
-
}());
|
|
14019
|
+
}(PlayableAsset));
|
|
14010
14020
|
/**
|
|
14011
14021
|
* @since 2.0.0
|
|
14012
14022
|
* @internal
|
|
@@ -14062,12 +14072,12 @@ var tempPos = new Vector3();
|
|
|
14062
14072
|
* @since 2.0.0
|
|
14063
14073
|
* @internal
|
|
14064
14074
|
*/
|
|
14065
|
-
var
|
|
14066
|
-
__extends(
|
|
14067
|
-
function
|
|
14075
|
+
var TransformAnimationPlayable = /** @class */ (function (_super) {
|
|
14076
|
+
__extends(TransformAnimationPlayable, _super);
|
|
14077
|
+
function TransformAnimationPlayable() {
|
|
14068
14078
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
14069
14079
|
}
|
|
14070
|
-
|
|
14080
|
+
TransformAnimationPlayable.prototype.processFrame = function (dt) {
|
|
14071
14081
|
if (this.bindingItem.composition) {
|
|
14072
14082
|
this.sampleAnimation();
|
|
14073
14083
|
}
|
|
@@ -14075,7 +14085,7 @@ var AnimationClipPlayable = /** @class */ (function (_super) {
|
|
|
14075
14085
|
/**
|
|
14076
14086
|
* 应用时间轴K帧数据到对象
|
|
14077
14087
|
*/
|
|
14078
|
-
|
|
14088
|
+
TransformAnimationPlayable.prototype.sampleAnimation = function () {
|
|
14079
14089
|
var _this = this;
|
|
14080
14090
|
var duration = this.bindingItem.duration;
|
|
14081
14091
|
var life = this.time / duration;
|
|
@@ -14120,7 +14130,7 @@ var AnimationClipPlayable = /** @class */ (function (_super) {
|
|
|
14120
14130
|
// this.animationStream.setCurveValue('transform', 'position.z', pos.z);
|
|
14121
14131
|
}
|
|
14122
14132
|
};
|
|
14123
|
-
|
|
14133
|
+
TransformAnimationPlayable.prototype.fromData = function (data) {
|
|
14124
14134
|
var _a;
|
|
14125
14135
|
var scale = this.bindingItem.transform.scale;
|
|
14126
14136
|
this.originalTransform = {
|
|
@@ -14191,30 +14201,45 @@ var AnimationClipPlayable = /** @class */ (function (_super) {
|
|
|
14191
14201
|
this.velocity = this.direction.clone();
|
|
14192
14202
|
this.velocity.multiply(this.startSpeed);
|
|
14193
14203
|
};
|
|
14194
|
-
return
|
|
14204
|
+
return TransformAnimationPlayable;
|
|
14195
14205
|
}(AnimationPlayable));
|
|
14206
|
+
var TransformAnimationPlayableAsset = /** @class */ (function (_super) {
|
|
14207
|
+
__extends(TransformAnimationPlayableAsset, _super);
|
|
14208
|
+
function TransformAnimationPlayableAsset() {
|
|
14209
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
14210
|
+
}
|
|
14211
|
+
TransformAnimationPlayableAsset.prototype.createPlayable = function () {
|
|
14212
|
+
var transformAnimationPlayable = new TransformAnimationPlayable();
|
|
14213
|
+
transformAnimationPlayable.fromData(this.transformAnimationData);
|
|
14214
|
+
return transformAnimationPlayable;
|
|
14215
|
+
};
|
|
14216
|
+
TransformAnimationPlayableAsset.prototype.fromData = function (data) {
|
|
14217
|
+
this.transformAnimationData = data;
|
|
14218
|
+
};
|
|
14219
|
+
return TransformAnimationPlayableAsset;
|
|
14220
|
+
}(PlayableAsset));
|
|
14196
14221
|
/**
|
|
14197
14222
|
* @since 2.0.0
|
|
14198
14223
|
* @internal
|
|
14199
14224
|
*/
|
|
14200
|
-
var
|
|
14201
|
-
__extends(
|
|
14202
|
-
function
|
|
14225
|
+
var ActivationPlayable = /** @class */ (function (_super) {
|
|
14226
|
+
__extends(ActivationPlayable, _super);
|
|
14227
|
+
function ActivationPlayable() {
|
|
14203
14228
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
14204
14229
|
}
|
|
14205
|
-
|
|
14230
|
+
ActivationPlayable.prototype.onGraphStart = function () {
|
|
14206
14231
|
this.bindingItem.transform.setValid(false);
|
|
14207
14232
|
this.hideRendererComponents();
|
|
14208
14233
|
};
|
|
14209
|
-
|
|
14234
|
+
ActivationPlayable.prototype.onPlayablePlay = function () {
|
|
14210
14235
|
this.bindingItem.transform.setValid(true);
|
|
14211
14236
|
this.showRendererComponents();
|
|
14212
14237
|
};
|
|
14213
|
-
|
|
14238
|
+
ActivationPlayable.prototype.onPlayableDestroy = function () {
|
|
14214
14239
|
this.bindingItem.transform.setValid(false);
|
|
14215
14240
|
this.hideRendererComponents();
|
|
14216
14241
|
};
|
|
14217
|
-
|
|
14242
|
+
ActivationPlayable.prototype.hideRendererComponents = function () {
|
|
14218
14243
|
var e_1, _a;
|
|
14219
14244
|
try {
|
|
14220
14245
|
for (var _b = __values$1(this.bindingItem.rendererComponents), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -14232,7 +14257,7 @@ var ActivationClipPlayable = /** @class */ (function (_super) {
|
|
|
14232
14257
|
finally { if (e_1) throw e_1.error; }
|
|
14233
14258
|
}
|
|
14234
14259
|
};
|
|
14235
|
-
|
|
14260
|
+
ActivationPlayable.prototype.showRendererComponents = function () {
|
|
14236
14261
|
var e_2, _a;
|
|
14237
14262
|
try {
|
|
14238
14263
|
for (var _b = __values$1(this.bindingItem.rendererComponents), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -14250,7 +14275,7 @@ var ActivationClipPlayable = /** @class */ (function (_super) {
|
|
|
14250
14275
|
finally { if (e_2) throw e_2.error; }
|
|
14251
14276
|
}
|
|
14252
14277
|
};
|
|
14253
|
-
return
|
|
14278
|
+
return ActivationPlayable;
|
|
14254
14279
|
}(Playable));
|
|
14255
14280
|
|
|
14256
14281
|
/**
|
|
@@ -14505,7 +14530,7 @@ var TimelineComponent = /** @class */ (function (_super) {
|
|
|
14505
14530
|
try {
|
|
14506
14531
|
for (var _b = __values$1(this.tracks), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
14507
14532
|
var track = _c.value;
|
|
14508
|
-
var trackMixPlayable = track.
|
|
14533
|
+
var trackMixPlayable = track.createPlayable();
|
|
14509
14534
|
var trackOutput = track.createOutput();
|
|
14510
14535
|
graph.addOutput(trackOutput);
|
|
14511
14536
|
trackOutput.setSourcePlayeble(trackMixPlayable);
|
|
@@ -14520,6 +14545,7 @@ var TimelineComponent = /** @class */ (function (_super) {
|
|
|
14520
14545
|
}
|
|
14521
14546
|
};
|
|
14522
14547
|
TimelineComponent.prototype.fromData = function (data) {
|
|
14548
|
+
var e_13, _a, e_14, _b;
|
|
14523
14549
|
_super.prototype.fromData.call(this, data);
|
|
14524
14550
|
this.options = {
|
|
14525
14551
|
start: this.item.start,
|
|
@@ -14530,7 +14556,47 @@ var TimelineComponent = /** @class */ (function (_super) {
|
|
|
14530
14556
|
this.id = this.item.id;
|
|
14531
14557
|
this.name = this.item.name;
|
|
14532
14558
|
var activationTrack = this.createTrack(Track, 'ActivationTrack');
|
|
14533
|
-
activationTrack.createClip(
|
|
14559
|
+
activationTrack.createClip(ActivationPlayable, 'ActivationTimelineClip');
|
|
14560
|
+
//@ts-expect-error
|
|
14561
|
+
if (data.tracks) {
|
|
14562
|
+
//@ts-expect-error
|
|
14563
|
+
var tracks = data.tracks;
|
|
14564
|
+
try {
|
|
14565
|
+
for (var tracks_1 = __values$1(tracks), tracks_1_1 = tracks_1.next(); !tracks_1_1.done; tracks_1_1 = tracks_1.next()) {
|
|
14566
|
+
var track = tracks_1_1.value;
|
|
14567
|
+
var newTrack = this.createTrack(Track);
|
|
14568
|
+
try {
|
|
14569
|
+
for (var _c = (e_14 = void 0, __values$1(track.clips)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
14570
|
+
var clipAsset = _d.value;
|
|
14571
|
+
switch (clipAsset.dataType) {
|
|
14572
|
+
case 'TransformAnimationPlayableAsset':
|
|
14573
|
+
newTrack.name = 'AnimationTrack';
|
|
14574
|
+
newTrack.createClip(TransformAnimationPlayable, 'AnimationTimelineClip').playable.fromData(clipAsset.animationClip);
|
|
14575
|
+
break;
|
|
14576
|
+
case 'SpriteColorAnimationPlayableAsset':
|
|
14577
|
+
newTrack.name = 'SpriteColorTrack';
|
|
14578
|
+
newTrack.createClip(SpriteColorPlayable, 'SpriteColorClip').playable.fromData(clipAsset.animationClip);
|
|
14579
|
+
break;
|
|
14580
|
+
}
|
|
14581
|
+
}
|
|
14582
|
+
}
|
|
14583
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
14584
|
+
finally {
|
|
14585
|
+
try {
|
|
14586
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
14587
|
+
}
|
|
14588
|
+
finally { if (e_14) throw e_14.error; }
|
|
14589
|
+
}
|
|
14590
|
+
}
|
|
14591
|
+
}
|
|
14592
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
14593
|
+
finally {
|
|
14594
|
+
try {
|
|
14595
|
+
if (tracks_1_1 && !tracks_1_1.done && (_a = tracks_1.return)) _a.call(tracks_1);
|
|
14596
|
+
}
|
|
14597
|
+
finally { if (e_13) throw e_13.error; }
|
|
14598
|
+
}
|
|
14599
|
+
}
|
|
14534
14600
|
};
|
|
14535
14601
|
TimelineComponent.prototype.toData = function () {
|
|
14536
14602
|
_super.prototype.toData.call(this);
|
|
@@ -14944,9 +15010,6 @@ var SpriteComponent = /** @class */ (function (_super) {
|
|
|
14944
15010
|
this.material.setVector4('_Color', new Vector4().setFromArray(startColor));
|
|
14945
15011
|
this.material.setVector4('_TexOffset', new Vector4().setFromArray([0, 0, 1, 1]));
|
|
14946
15012
|
this.setItem();
|
|
14947
|
-
// 添加K帧动画
|
|
14948
|
-
var colorTrack = this.item.getComponent(TimelineComponent).createTrack(Track, 'SpriteColorTrack');
|
|
14949
|
-
colorTrack.createClip(SpriteColorPlayable, 'SpriteColorClip').playable.fromData({ colorOverLifetime: data.colorOverLifetime, startColor: data.options.startColor });
|
|
14950
15013
|
};
|
|
14951
15014
|
SpriteComponent.prototype.toData = function () {
|
|
14952
15015
|
_super.prototype.toData.call(this);
|
|
@@ -20603,10 +20666,6 @@ var VFXItem = /** @class */ (function (_super) {
|
|
|
20603
20666
|
}
|
|
20604
20667
|
var timelineComponent = this.getComponent(TimelineComponent);
|
|
20605
20668
|
timelineComponent.fromData(data.content);
|
|
20606
|
-
if (this.type !== ItemType$1.particle) {
|
|
20607
|
-
var track = timelineComponent.createTrack(Track, 'AnimationTrack');
|
|
20608
|
-
track.createClip(AnimationClipPlayable, 'AnimationTimelineClip').playable.fromData(data.content);
|
|
20609
|
-
}
|
|
20610
20669
|
if (duration <= 0) {
|
|
20611
20670
|
throw Error("Item duration can't be less than 0, see ".concat(HELP_LINK['Item duration can\'t be less than 0']));
|
|
20612
20671
|
}
|
|
@@ -22818,6 +22877,49 @@ function version3Migration(scene) {
|
|
|
22818
22877
|
if (item.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY$1 || item.endBehavior === END_BEHAVIOR_PAUSE$1) {
|
|
22819
22878
|
item.endBehavior = END_BEHAVIOR_FREEZE$1;
|
|
22820
22879
|
}
|
|
22880
|
+
// 动画数据转化 TODO: 动画数据移到 TimelineComponentData
|
|
22881
|
+
//@ts-expect-error
|
|
22882
|
+
item.content.tracks = [];
|
|
22883
|
+
//@ts-expect-error
|
|
22884
|
+
var tracks = item.content.tracks;
|
|
22885
|
+
if (item.type !== ItemType$1.particle) {
|
|
22886
|
+
tracks.push({
|
|
22887
|
+
clips: [
|
|
22888
|
+
{
|
|
22889
|
+
dataType: 'TransformAnimationPlayableAsset',
|
|
22890
|
+
animationClip: {
|
|
22891
|
+
//@ts-expect-error
|
|
22892
|
+
sizeOverLifetime: item.content.sizeOverLifetime,
|
|
22893
|
+
//@ts-expect-error
|
|
22894
|
+
rotationOverLifetime: item.content.rotationOverLifetime,
|
|
22895
|
+
//@ts-expect-error
|
|
22896
|
+
positionOverLifetime: item.content.positionOverLifetime,
|
|
22897
|
+
},
|
|
22898
|
+
},
|
|
22899
|
+
],
|
|
22900
|
+
});
|
|
22901
|
+
}
|
|
22902
|
+
if (item.type === ItemType$1.sprite) {
|
|
22903
|
+
tracks.push({
|
|
22904
|
+
clips: [
|
|
22905
|
+
{
|
|
22906
|
+
dataType: 'SpriteColorAnimationPlayableAsset',
|
|
22907
|
+
animationClip: {
|
|
22908
|
+
//@ts-expect-error
|
|
22909
|
+
colorOverLifetime: item.content.colorOverLifetime,
|
|
22910
|
+
//@ts-expect-error
|
|
22911
|
+
startColor: item.content.options.startColor,
|
|
22912
|
+
},
|
|
22913
|
+
},
|
|
22914
|
+
],
|
|
22915
|
+
});
|
|
22916
|
+
}
|
|
22917
|
+
// gizmo 的 target id 转换为新的 item guid
|
|
22918
|
+
//@ts-expect-error
|
|
22919
|
+
if (item.content.options.target) {
|
|
22920
|
+
//@ts-expect-error
|
|
22921
|
+
item.content.options.target = itemGuidMap[item.content.options.target];
|
|
22922
|
+
}
|
|
22821
22923
|
// item 的 content 转为 component data 加入 JSONScene.components
|
|
22822
22924
|
var uuid = v4().replace(/-/g, '');
|
|
22823
22925
|
if (item.type === ItemType$1.sprite) {
|
|
@@ -25881,5 +25983,5 @@ registerPlugin('cal', CalculateLoader, VFXItem, true);
|
|
|
25881
25983
|
registerPlugin('interact', InteractLoader, VFXItem, true);
|
|
25882
25984
|
// registerFilters(filters);
|
|
25883
25985
|
|
|
25884
|
-
export { AbstractPlugin,
|
|
25986
|
+
export { AbstractPlugin, ActivationPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierSegments, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, Composition, CompositionComponent, CompositionSourceManager, CurveValue, DEFAULT_FONTS, DataType, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, Engine, EventSystem, FILTER_NAME_NONE, FilterMode, Float16ArrayWrapper, FrameBuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractBehavior$1 as InteractBehavior, InteractComponent, InteractLoader, InteractMesh, Item, ItemBehaviour, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, QCanvasViewer, QText, QTextWrapMode, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderBuffer, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderer, RendererComponent, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderType, SpriteColorPlayable, SpriteComponent, SpriteLoader, StaticValue, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextLoader, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineClip, TimelineComponent, Track, Transform, TransformAnimationPlayable, TransformAnimationPlayableAsset, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, alphaFrame_frag as alphaFrameFrag, alphaMask_frag as alphaMaskFrag, assertExist, asserts, blend, bloomMix_frag as bloomMixVert, bloomThreshold_frag as bloomThresholdVert, calculateTranslation, cameraMove_frag as cameraMoveFrag, cameraMove_vert as cameraMoveVert, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, combineImageTemplate1, combineImageTemplate1Async, combineImageTemplate2, combineImageTemplate2Async, combineImageTemplateAsync, compatible_frag as compatibleFrag, compatible_vert as compatibleVert, copy as copyFrag, createCopyShader, createGLContext, createKeyFrameMeta, createShaderWithMarcos, createShape, createVFXItem, createValueGetter, deepClone, defaultGlobalVolume, defaultPlugins, delay_frag as delayFrag, deserializeMipmapTexture, distortion_frag as distortionFrag, distortion_vert as distortionVert, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTemplateCanvasPool, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAndroid, isArray, isFunction, isIOS, isObject, isScene, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isWebGL2, item_define as itemDefine, itemFrag, itemFrameFrag, itemVert, loadBinary, loadBlob, loadImage, loadVideo, loadWebPOptional, logger, index$1 as math, maxSpriteMeshItemCount, maxSpriteTextureCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap, particleVert, pluginLoaderMap, random, registerPlugin, removeItem, requestAsync, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxFragmentTextures, setSpriteMeshMaxItemCountByGPU, sortByOrder, index as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecAssign, vecFill, vecMulCombine, vecNormalize };
|
|
25885
25987
|
//# sourceMappingURL=index.mjs.map
|