@galacean/effects-core 2.2.0-alpha.0 → 2.2.0
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-manager.d.ts +0 -5
- package/dist/config.d.ts +0 -1
- package/dist/downloader.d.ts +4 -16
- package/dist/index.js +49 -139
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -137
- package/dist/index.mjs.map +1 -1
- package/dist/scene.d.ts +1 -1
- package/dist/vfx-item.d.ts +1 -2
- package/package.json +1 -1
package/dist/asset-manager.d.ts
CHANGED
|
@@ -22,10 +22,6 @@ export declare class AssetManager implements Disposable {
|
|
|
22
22
|
* TextureSource 来源
|
|
23
23
|
*/
|
|
24
24
|
private sourceFrom;
|
|
25
|
-
/**
|
|
26
|
-
* Texture 选项,用于创建 ImageBitmap
|
|
27
|
-
*/
|
|
28
|
-
private imageBitmapOptions;
|
|
29
25
|
/**
|
|
30
26
|
* 自定义文本缓存,随页面销毁而销毁
|
|
31
27
|
*/
|
|
@@ -68,7 +64,6 @@ export declare class AssetManager implements Disposable {
|
|
|
68
64
|
private loadJSON;
|
|
69
65
|
private loadBins;
|
|
70
66
|
private assignImagesToAssets;
|
|
71
|
-
private assignImageBitmapOptions;
|
|
72
67
|
private removeTimer;
|
|
73
68
|
/**
|
|
74
69
|
* 销毁方法
|
package/dist/config.d.ts
CHANGED
|
@@ -2,6 +2,5 @@ export declare const RUNTIME_ENV = "runtime_env";
|
|
|
2
2
|
export declare const RENDER_PREFER_LOOKUP_TEXTURE = "lookup_texture";
|
|
3
3
|
export declare const TEMPLATE_USE_OFFSCREEN_CANVAS = "offscreen_canvas";
|
|
4
4
|
export declare const POST_PROCESS_SETTINGS = "post_process_settings";
|
|
5
|
-
export declare const LOAD_PREFER_IMAGE_BITMAP = "load_image_bitmap";
|
|
6
5
|
export declare function getConfig<T extends number | boolean | string | Record<string, any>>(name: string): T;
|
|
7
6
|
export declare function setConfig<T extends number | boolean | string | Record<string, any>>(name: string, value: T): string | number | boolean | Record<string, any>;
|
package/dist/downloader.d.ts
CHANGED
|
@@ -46,8 +46,8 @@ export declare class Downloader {
|
|
|
46
46
|
* @param png - PNG 图片文件的 URL
|
|
47
47
|
* @param webp - WebP 图片文件的 URL
|
|
48
48
|
*/
|
|
49
|
-
export declare function loadWebPOptional(png: string, webp?: string
|
|
50
|
-
image: HTMLImageElement
|
|
49
|
+
export declare function loadWebPOptional(png: string, webp?: string): Promise<{
|
|
50
|
+
image: HTMLImageElement;
|
|
51
51
|
url: string;
|
|
52
52
|
}>;
|
|
53
53
|
/**
|
|
@@ -55,8 +55,8 @@ export declare function loadWebPOptional(png: string, webp?: string, options?: I
|
|
|
55
55
|
* @param png - PNG 图片文件的 URL
|
|
56
56
|
* @param avif - AVIF 图片文件的 URL
|
|
57
57
|
*/
|
|
58
|
-
export declare function loadAVIFOptional(png: string, avif?: string
|
|
59
|
-
image: HTMLImageElement
|
|
58
|
+
export declare function loadAVIFOptional(png: string, avif?: string): Promise<{
|
|
59
|
+
image: HTMLImageElement;
|
|
60
60
|
url: string;
|
|
61
61
|
}>;
|
|
62
62
|
/**
|
|
@@ -80,16 +80,4 @@ export declare function loadBlob(url: string): Promise<Blob>;
|
|
|
80
80
|
*/
|
|
81
81
|
export declare function loadVideo(url: string | MediaProvider): Promise<HTMLVideoElement>;
|
|
82
82
|
export declare function loadMedia(url: string | string[], loadFn: (url: string) => Promise<HTMLImageElement | HTMLVideoElement>): Promise<HTMLImageElement | HTMLVideoElement>;
|
|
83
|
-
/**
|
|
84
|
-
* 异步加载一个图片文件,如果支持 ImageBitmap 则返回 ImageBitmap 对象
|
|
85
|
-
* @param source
|
|
86
|
-
* @param options
|
|
87
|
-
* @returns
|
|
88
|
-
*/
|
|
89
|
-
export declare function loadImageBitmap(source: string | Blob | HTMLImageElement, options?: ImageBitmapOptions): Promise<ImageBitmap | HTMLImageElement>;
|
|
90
|
-
/**
|
|
91
|
-
* 关闭 ImageBitMap,释放内存
|
|
92
|
-
* @param imgs
|
|
93
|
-
*/
|
|
94
|
-
export declare function closeImageBitMap(imgs: any): void;
|
|
95
83
|
export {};
|
package/dist/index.js
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.2.0
|
|
6
|
+
* Version: v2.2.0
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -5721,22 +5721,6 @@ exports.TextureSourceType = void 0;
|
|
|
5721
5721
|
TextureSourceType[TextureSourceType["mipmaps"] = 7] = "mipmaps";
|
|
5722
5722
|
})(exports.TextureSourceType || (exports.TextureSourceType = {}));
|
|
5723
5723
|
|
|
5724
|
-
var RUNTIME_ENV = "runtime_env";
|
|
5725
|
-
var RENDER_PREFER_LOOKUP_TEXTURE = "lookup_texture";
|
|
5726
|
-
// 文本元素使用 offscreen canvas 绘制
|
|
5727
|
-
var TEMPLATE_USE_OFFSCREEN_CANVAS = "offscreen_canvas";
|
|
5728
|
-
// 后处理配置相关
|
|
5729
|
-
var POST_PROCESS_SETTINGS = "post_process_settings";
|
|
5730
|
-
// 加载图片时是否使用 ImageBitmap
|
|
5731
|
-
var LOAD_PREFER_IMAGE_BITMAP = "load_image_bitmap";
|
|
5732
|
-
var config = {};
|
|
5733
|
-
function getConfig(name) {
|
|
5734
|
-
return config[name];
|
|
5735
|
-
}
|
|
5736
|
-
function setConfig(name, value) {
|
|
5737
|
-
return config[name] = value;
|
|
5738
|
-
}
|
|
5739
|
-
|
|
5740
5724
|
/**
|
|
5741
5725
|
* 负责下载各种资源,并提供了一些异步加载和缓存管理的功能
|
|
5742
5726
|
*/ var Downloader = /*#__PURE__*/ function() {
|
|
@@ -5825,11 +5809,11 @@ var avifFailed = false;
|
|
|
5825
5809
|
* 异步加载一个 WebP 图片文件,如果不支持 WebP,则加载 PNG 图片文件
|
|
5826
5810
|
* @param png - PNG 图片文件的 URL
|
|
5827
5811
|
* @param webp - WebP 图片文件的 URL
|
|
5828
|
-
*/ function loadWebPOptional(png, webp
|
|
5812
|
+
*/ function loadWebPOptional(png, webp) {
|
|
5829
5813
|
return _loadWebPOptional.apply(this, arguments);
|
|
5830
5814
|
}
|
|
5831
5815
|
function _loadWebPOptional() {
|
|
5832
|
-
_loadWebPOptional = _async_to_generator(function(png, webp
|
|
5816
|
+
_loadWebPOptional = _async_to_generator(function(png, webp) {
|
|
5833
5817
|
var image, image1, image2;
|
|
5834
5818
|
return __generator(this, function(_state) {
|
|
5835
5819
|
switch(_state.label){
|
|
@@ -5840,7 +5824,7 @@ function _loadWebPOptional() {
|
|
|
5840
5824
|
];
|
|
5841
5825
|
return [
|
|
5842
5826
|
4,
|
|
5843
|
-
|
|
5827
|
+
loadImage(png)
|
|
5844
5828
|
];
|
|
5845
5829
|
case 1:
|
|
5846
5830
|
image = _state.sent();
|
|
@@ -5860,7 +5844,7 @@ function _loadWebPOptional() {
|
|
|
5860
5844
|
]);
|
|
5861
5845
|
return [
|
|
5862
5846
|
4,
|
|
5863
|
-
|
|
5847
|
+
loadImage(webp)
|
|
5864
5848
|
];
|
|
5865
5849
|
case 3:
|
|
5866
5850
|
image1 = _state.sent();
|
|
@@ -5876,7 +5860,7 @@ function _loadWebPOptional() {
|
|
|
5876
5860
|
webPFailed = true;
|
|
5877
5861
|
return [
|
|
5878
5862
|
4,
|
|
5879
|
-
|
|
5863
|
+
loadImage(png)
|
|
5880
5864
|
];
|
|
5881
5865
|
case 5:
|
|
5882
5866
|
image2 = _state.sent();
|
|
@@ -5900,11 +5884,11 @@ function _loadWebPOptional() {
|
|
|
5900
5884
|
* 异步加载一个 AVIF 图片文件,如果不支持 AVIF,则加载 PNG 图片文件
|
|
5901
5885
|
* @param png - PNG 图片文件的 URL
|
|
5902
5886
|
* @param avif - AVIF 图片文件的 URL
|
|
5903
|
-
*/ function loadAVIFOptional(png, avif
|
|
5887
|
+
*/ function loadAVIFOptional(png, avif) {
|
|
5904
5888
|
return _loadAVIFOptional.apply(this, arguments);
|
|
5905
5889
|
}
|
|
5906
5890
|
function _loadAVIFOptional() {
|
|
5907
|
-
_loadAVIFOptional = _async_to_generator(function(png, avif
|
|
5891
|
+
_loadAVIFOptional = _async_to_generator(function(png, avif) {
|
|
5908
5892
|
var image, image1, image2;
|
|
5909
5893
|
return __generator(this, function(_state) {
|
|
5910
5894
|
switch(_state.label){
|
|
@@ -5915,7 +5899,7 @@ function _loadAVIFOptional() {
|
|
|
5915
5899
|
];
|
|
5916
5900
|
return [
|
|
5917
5901
|
4,
|
|
5918
|
-
|
|
5902
|
+
loadImage(png)
|
|
5919
5903
|
];
|
|
5920
5904
|
case 1:
|
|
5921
5905
|
image = _state.sent();
|
|
@@ -5935,7 +5919,7 @@ function _loadAVIFOptional() {
|
|
|
5935
5919
|
]);
|
|
5936
5920
|
return [
|
|
5937
5921
|
4,
|
|
5938
|
-
|
|
5922
|
+
loadImage(avif)
|
|
5939
5923
|
];
|
|
5940
5924
|
case 3:
|
|
5941
5925
|
image1 = _state.sent();
|
|
@@ -5951,7 +5935,7 @@ function _loadAVIFOptional() {
|
|
|
5951
5935
|
avifFailed = true;
|
|
5952
5936
|
return [
|
|
5953
5937
|
4,
|
|
5954
|
-
|
|
5938
|
+
loadImage(png)
|
|
5955
5939
|
];
|
|
5956
5940
|
case 5:
|
|
5957
5941
|
image2 = _state.sent();
|
|
@@ -6166,80 +6150,6 @@ function _loadMedia() {
|
|
|
6166
6150
|
});
|
|
6167
6151
|
return _loadMedia.apply(this, arguments);
|
|
6168
6152
|
}
|
|
6169
|
-
var imageBitMapAvailable = typeof createImageBitmap === "function";
|
|
6170
|
-
/**
|
|
6171
|
-
* 异步加载一个图片文件,如果支持 ImageBitmap 则返回 ImageBitmap 对象
|
|
6172
|
-
* @param source
|
|
6173
|
-
* @param options
|
|
6174
|
-
* @returns
|
|
6175
|
-
*/ function loadImageBitmap(source, options) {
|
|
6176
|
-
return _loadImageBitmap.apply(this, arguments);
|
|
6177
|
-
}
|
|
6178
|
-
function _loadImageBitmap() {
|
|
6179
|
-
_loadImageBitmap = _async_to_generator(function(source, options) {
|
|
6180
|
-
var blob;
|
|
6181
|
-
return __generator(this, function(_state) {
|
|
6182
|
-
switch(_state.label){
|
|
6183
|
-
case 0:
|
|
6184
|
-
if (!(imageBitMapAvailable && getConfig(LOAD_PREFER_IMAGE_BITMAP))) return [
|
|
6185
|
-
3,
|
|
6186
|
-
4
|
|
6187
|
-
];
|
|
6188
|
-
if (!(typeof source === "string")) return [
|
|
6189
|
-
3,
|
|
6190
|
-
2
|
|
6191
|
-
];
|
|
6192
|
-
return [
|
|
6193
|
-
4,
|
|
6194
|
-
loadBlob(source)
|
|
6195
|
-
];
|
|
6196
|
-
case 1:
|
|
6197
|
-
blob = _state.sent();
|
|
6198
|
-
return [
|
|
6199
|
-
3,
|
|
6200
|
-
3
|
|
6201
|
-
];
|
|
6202
|
-
case 2:
|
|
6203
|
-
if (_instanceof1(source, Blob)) {
|
|
6204
|
-
blob = source;
|
|
6205
|
-
} else {
|
|
6206
|
-
return [
|
|
6207
|
-
2,
|
|
6208
|
-
loadImage(source)
|
|
6209
|
-
];
|
|
6210
|
-
}
|
|
6211
|
-
_state.label = 3;
|
|
6212
|
-
case 3:
|
|
6213
|
-
return [
|
|
6214
|
-
2,
|
|
6215
|
-
createImageBitmap(blob, options)
|
|
6216
|
-
];
|
|
6217
|
-
case 4:
|
|
6218
|
-
return [
|
|
6219
|
-
2,
|
|
6220
|
-
loadImage(source)
|
|
6221
|
-
];
|
|
6222
|
-
case 5:
|
|
6223
|
-
return [
|
|
6224
|
-
2
|
|
6225
|
-
];
|
|
6226
|
-
}
|
|
6227
|
-
});
|
|
6228
|
-
});
|
|
6229
|
-
return _loadImageBitmap.apply(this, arguments);
|
|
6230
|
-
}
|
|
6231
|
-
/**
|
|
6232
|
-
* 关闭 ImageBitMap,释放内存
|
|
6233
|
-
* @param imgs
|
|
6234
|
-
*/ function closeImageBitMap(imgs) {
|
|
6235
|
-
if (imageBitMapAvailable) {
|
|
6236
|
-
if (_instanceof1(imgs, ImageBitmap)) {
|
|
6237
|
-
imgs.close();
|
|
6238
|
-
} else if (_instanceof1(imgs, Array)) {
|
|
6239
|
-
imgs.forEach(closeImageBitMap);
|
|
6240
|
-
}
|
|
6241
|
-
}
|
|
6242
|
-
}
|
|
6243
6153
|
|
|
6244
6154
|
function deserializeMipmapTexture(textureOptions, bins, assets) {
|
|
6245
6155
|
return _deserializeMipmapTexture.apply(this, arguments);
|
|
@@ -17894,7 +17804,7 @@ exports.VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17894
17804
|
};
|
|
17895
17805
|
/**
|
|
17896
17806
|
* 添加组件
|
|
17897
|
-
* @param classConstructor -
|
|
17807
|
+
* @param classConstructor - 要添加的组件
|
|
17898
17808
|
*/ _proto.addComponent = function addComponent(classConstructor) {
|
|
17899
17809
|
var newComponent = new classConstructor(this.engine);
|
|
17900
17810
|
this.components.push(newComponent);
|
|
@@ -18137,7 +18047,7 @@ exports.VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
18137
18047
|
};
|
|
18138
18048
|
_proto.fromData = function fromData(data) {
|
|
18139
18049
|
EffectsObject.prototype.fromData.call(this, data);
|
|
18140
|
-
var id = data.id, name = data.name, delay = data.delay, parentId = data.parentId, endBehavior = data.endBehavior, transform = data.transform,
|
|
18050
|
+
var id = data.id, name = data.name, delay = data.delay, parentId = data.parentId, endBehavior = data.endBehavior, transform = data.transform, _data_duration = data.duration, duration = _data_duration === void 0 ? 0 : _data_duration;
|
|
18141
18051
|
this.props = data;
|
|
18142
18052
|
//@ts-expect-error
|
|
18143
18053
|
this.type = data.type;
|
|
@@ -18199,8 +18109,6 @@ exports.VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
18199
18109
|
this.rendererComponents.push(component.renderer);
|
|
18200
18110
|
}
|
|
18201
18111
|
}
|
|
18202
|
-
// renderOrder 在 component 初始化后设置。确保能拿到 rendererComponent。
|
|
18203
|
-
this.renderOrder = listIndex;
|
|
18204
18112
|
};
|
|
18205
18113
|
_proto.toData = function toData() {
|
|
18206
18114
|
var _this_parent;
|
|
@@ -18808,6 +18716,20 @@ exports.SpriteComponent = __decorate([
|
|
|
18808
18716
|
effectsClass(DataType.SpriteComponent)
|
|
18809
18717
|
], exports.SpriteComponent);
|
|
18810
18718
|
|
|
18719
|
+
var RUNTIME_ENV = "runtime_env";
|
|
18720
|
+
var RENDER_PREFER_LOOKUP_TEXTURE = "lookup_texture";
|
|
18721
|
+
// 文本元素使用 offscreen canvas 绘制
|
|
18722
|
+
var TEMPLATE_USE_OFFSCREEN_CANVAS = "offscreen_canvas";
|
|
18723
|
+
// 后处理配置相关
|
|
18724
|
+
var POST_PROCESS_SETTINGS = "post_process_settings";
|
|
18725
|
+
var config = {};
|
|
18726
|
+
function getConfig(name) {
|
|
18727
|
+
return config[name];
|
|
18728
|
+
}
|
|
18729
|
+
function setConfig(name, value) {
|
|
18730
|
+
return config[name] = value;
|
|
18731
|
+
}
|
|
18732
|
+
|
|
18811
18733
|
var Cone = /*#__PURE__*/ function() {
|
|
18812
18734
|
function Cone(props) {
|
|
18813
18735
|
var _this = this;
|
|
@@ -23879,6 +23801,20 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23879
23801
|
}
|
|
23880
23802
|
return regions;
|
|
23881
23803
|
};
|
|
23804
|
+
/**
|
|
23805
|
+
* 设置当前合成子元素的渲染顺序
|
|
23806
|
+
* @internal
|
|
23807
|
+
*/ _proto.setChildrenRenderOrder = function setChildrenRenderOrder(startOrder) {
|
|
23808
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
|
|
23809
|
+
var item = _step.value;
|
|
23810
|
+
item.renderOrder = startOrder++;
|
|
23811
|
+
var subCompositionComponent = item.getComponent(CompositionComponent);
|
|
23812
|
+
if (subCompositionComponent) {
|
|
23813
|
+
startOrder = subCompositionComponent.setChildrenRenderOrder(startOrder);
|
|
23814
|
+
}
|
|
23815
|
+
}
|
|
23816
|
+
return startOrder;
|
|
23817
|
+
};
|
|
23882
23818
|
_proto.fromData = function fromData(data) {
|
|
23883
23819
|
Behaviour.prototype.fromData.call(this, data);
|
|
23884
23820
|
this.items = data.items;
|
|
@@ -24693,7 +24629,7 @@ var TextLayout = /*#__PURE__*/ function() {
|
|
|
24693
24629
|
function TextLayout(options) {
|
|
24694
24630
|
this.width = 0;
|
|
24695
24631
|
this.height = 0;
|
|
24696
|
-
var _options_textHeight = options.textHeight, textHeight = _options_textHeight === void 0 ? 100 : _options_textHeight, _options_textWidth = options.textWidth, textWidth = _options_textWidth === void 0 ? 100 : _options_textWidth, _options_textOverflow = options.textOverflow, textOverflow = _options_textOverflow === void 0 ? TextOverflow.
|
|
24632
|
+
var _options_textHeight = options.textHeight, textHeight = _options_textHeight === void 0 ? 100 : _options_textHeight, _options_textWidth = options.textWidth, textWidth = _options_textWidth === void 0 ? 100 : _options_textWidth, _options_textOverflow = options.textOverflow, textOverflow = _options_textOverflow === void 0 ? TextOverflow.clip : _options_textOverflow, _options_textBaseline = options.textBaseline, textBaseline = _options_textBaseline === void 0 ? TextBaseline.top : _options_textBaseline, _options_textAlign = options.textAlign, textAlign = _options_textAlign === void 0 ? TextAlignment.left : _options_textAlign, _options_text = options.text, text = _options_text === void 0 ? " " : _options_text, _options_letterSpace = options.letterSpace, letterSpace = _options_letterSpace === void 0 ? 0 : _options_letterSpace, _options_autoWidth = options.autoWidth, autoWidth = _options_autoWidth === void 0 ? false : _options_autoWidth, fontSize = options.fontSize, _options_lineHeight = options.lineHeight, lineHeight = _options_lineHeight === void 0 ? fontSize : _options_lineHeight;
|
|
24697
24633
|
var tempWidth = fontSize + letterSpace;
|
|
24698
24634
|
this.autoWidth = autoWidth;
|
|
24699
24635
|
this.maxTextWidth = text.length * tempWidth;
|
|
@@ -27315,7 +27251,6 @@ var seed = 1;
|
|
|
27315
27251
|
this.downloader = downloader;
|
|
27316
27252
|
this.assets = {};
|
|
27317
27253
|
this.sourceFrom = {};
|
|
27318
|
-
this.imageBitmapOptions = {};
|
|
27319
27254
|
this.id = seed++;
|
|
27320
27255
|
this.timers = [];
|
|
27321
27256
|
this.updateOptions(options);
|
|
@@ -27573,12 +27508,12 @@ var seed = 1;
|
|
|
27573
27508
|
_proto.processJSON = function processJSON(json) {
|
|
27574
27509
|
var _this = this;
|
|
27575
27510
|
return _async_to_generator(function() {
|
|
27576
|
-
var jsonScene, _jsonScene_plugins, plugins,
|
|
27511
|
+
var jsonScene, _jsonScene_plugins, plugins, pluginSystem;
|
|
27577
27512
|
return __generator(this, function(_state) {
|
|
27578
27513
|
switch(_state.label){
|
|
27579
27514
|
case 0:
|
|
27580
27515
|
jsonScene = getStandardJSON(json);
|
|
27581
|
-
_jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins
|
|
27516
|
+
_jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins;
|
|
27582
27517
|
pluginSystem = new PluginSystem(plugins);
|
|
27583
27518
|
return [
|
|
27584
27519
|
4,
|
|
@@ -27586,7 +27521,6 @@ var seed = 1;
|
|
|
27586
27521
|
];
|
|
27587
27522
|
case 1:
|
|
27588
27523
|
_state.sent();
|
|
27589
|
-
_this.assignImageBitmapOptions(textures);
|
|
27590
27524
|
return [
|
|
27591
27525
|
2,
|
|
27592
27526
|
{
|
|
@@ -27818,7 +27752,7 @@ var seed = 1;
|
|
|
27818
27752
|
];
|
|
27819
27753
|
return [
|
|
27820
27754
|
4,
|
|
27821
|
-
loadAVIFOptional(imageURL, avifURL
|
|
27755
|
+
loadAVIFOptional(imageURL, avifURL)
|
|
27822
27756
|
];
|
|
27823
27757
|
case 10:
|
|
27824
27758
|
_tmp = _state.sent();
|
|
@@ -27829,7 +27763,7 @@ var seed = 1;
|
|
|
27829
27763
|
case 11:
|
|
27830
27764
|
return [
|
|
27831
27765
|
4,
|
|
27832
|
-
loadWebPOptional(imageURL, webpURL
|
|
27766
|
+
loadWebPOptional(imageURL, webpURL)
|
|
27833
27767
|
];
|
|
27834
27768
|
case 12:
|
|
27835
27769
|
_tmp = _state.sent();
|
|
@@ -28041,21 +27975,6 @@ var seed = 1;
|
|
|
28041
27975
|
this.assets[images[i].id] = loadedImages[i];
|
|
28042
27976
|
}
|
|
28043
27977
|
};
|
|
28044
|
-
_proto.assignImageBitmapOptions = function assignImageBitmapOptions(textures) {
|
|
28045
|
-
var _this = this;
|
|
28046
|
-
if (textures === void 0) textures = [];
|
|
28047
|
-
textures.forEach(function(texture) {
|
|
28048
|
-
if (!(_instanceof1(texture, Texture) || "mipmaps" in texture)) {
|
|
28049
|
-
var source = texture.source;
|
|
28050
|
-
if (isObject(source)) {
|
|
28051
|
-
_this.imageBitmapOptions[source.id] = {
|
|
28052
|
-
imageOrientation: texture.flipY ? "flipY" : "none",
|
|
28053
|
-
premultiplyAlpha: texture.premultiplyAlpha ? "premultiply" : "none"
|
|
28054
|
-
};
|
|
28055
|
-
}
|
|
28056
|
-
}
|
|
28057
|
-
});
|
|
28058
|
-
};
|
|
28059
27978
|
_proto.removeTimer = function removeTimer(id) {
|
|
28060
27979
|
var index = this.timers.indexOf(id);
|
|
28061
27980
|
if (index !== -1) {
|
|
@@ -28065,15 +27984,11 @@ var seed = 1;
|
|
|
28065
27984
|
/**
|
|
28066
27985
|
* 销毁方法
|
|
28067
27986
|
*/ _proto.dispose = function dispose() {
|
|
28068
|
-
var _this = this;
|
|
28069
27987
|
if (this.timers.length) {
|
|
28070
27988
|
this.timers.map(function(id) {
|
|
28071
27989
|
return window.clearTimeout(id);
|
|
28072
27990
|
});
|
|
28073
27991
|
}
|
|
28074
|
-
closeImageBitMap(Object.keys(this.assets).map(function(key) {
|
|
28075
|
-
return _this.assets[key];
|
|
28076
|
-
}));
|
|
28077
27992
|
this.assets = {};
|
|
28078
27993
|
this.sourceFrom = {};
|
|
28079
27994
|
this.timers = [];
|
|
@@ -28090,7 +28005,7 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
|
|
|
28090
28005
|
};
|
|
28091
28006
|
if (_instanceof1(image, Texture)) {
|
|
28092
28007
|
return _extends({}, image.source, options);
|
|
28093
|
-
} else if (_instanceof1(image, HTMLImageElement) ||
|
|
28008
|
+
} else if (_instanceof1(image, HTMLImageElement) || isCanvas(image)) {
|
|
28094
28009
|
return _extends({
|
|
28095
28010
|
image: image,
|
|
28096
28011
|
sourceType: exports.TextureSourceType.image,
|
|
@@ -28417,7 +28332,6 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
28417
28332
|
return Camera;
|
|
28418
28333
|
}();
|
|
28419
28334
|
|
|
28420
|
-
var listOrder = 0;
|
|
28421
28335
|
/**
|
|
28422
28336
|
* 合成资源管理
|
|
28423
28337
|
*/ var CompositionSourceManager = /*#__PURE__*/ function() {
|
|
@@ -28450,7 +28364,6 @@ var listOrder = 0;
|
|
|
28450
28364
|
this.pluginSystem = pluginSystem;
|
|
28451
28365
|
this.totalTime = totalTime != null ? totalTime : 0;
|
|
28452
28366
|
this.textures = cachedTextures;
|
|
28453
|
-
listOrder = 0;
|
|
28454
28367
|
this.sourceContent = this.getContent(this.composition);
|
|
28455
28368
|
}
|
|
28456
28369
|
var _proto = CompositionSourceManager.prototype;
|
|
@@ -28481,7 +28394,6 @@ var listOrder = 0;
|
|
|
28481
28394
|
var sourceItemData = this.engine.jsonSceneData[itemDataPath.id];
|
|
28482
28395
|
var itemProps = sourceItemData;
|
|
28483
28396
|
if (passRenderLevel(sourceItemData.renderLevel, this.renderLevel)) {
|
|
28484
|
-
itemProps.listIndex = listOrder++;
|
|
28485
28397
|
if (itemProps.type === ItemType.sprite || itemProps.type === ItemType.particle || itemProps.type === ItemType.spine || //@ts-expect-error
|
|
28486
28398
|
itemProps.type === ItemType.shape) {
|
|
28487
28399
|
for(var _iterator2 = _create_for_of_iterator_helper_loose(itemProps.components), _step2; !(_step2 = _iterator2()).done;){
|
|
@@ -28784,6 +28696,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28784
28696
|
SerializationHelper.deserialize(sourceContent, _this.rootComposition);
|
|
28785
28697
|
_this.rootComposition.createContent();
|
|
28786
28698
|
_this.buildItemTree(_this.rootItem);
|
|
28699
|
+
_this.rootComposition.setChildrenRenderOrder(0);
|
|
28787
28700
|
_this.pluginSystem.resetComposition(_assert_this_initialized(_this), _this.renderFrame);
|
|
28788
28701
|
return _this;
|
|
28789
28702
|
}
|
|
@@ -31423,7 +31336,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
|
|
|
31423
31336
|
registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
|
|
31424
31337
|
registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
|
|
31425
31338
|
registerPlugin("interact", InteractLoader, exports.VFXItem, true);
|
|
31426
|
-
var version = "2.2.0
|
|
31339
|
+
var version = "2.2.0";
|
|
31427
31340
|
logger.info("Core version: " + version + ".");
|
|
31428
31341
|
|
|
31429
31342
|
exports.AbstractPlugin = AbstractPlugin;
|
|
@@ -31473,7 +31386,6 @@ exports.HELP_LINK = HELP_LINK;
|
|
|
31473
31386
|
exports.InteractLoader = InteractLoader;
|
|
31474
31387
|
exports.InteractMesh = InteractMesh;
|
|
31475
31388
|
exports.KTXTexture = KTXTexture;
|
|
31476
|
-
exports.LOAD_PREFER_IMAGE_BITMAP = LOAD_PREFER_IMAGE_BITMAP;
|
|
31477
31389
|
exports.LineSegments = LineSegments;
|
|
31478
31390
|
exports.LinearValue = LinearValue;
|
|
31479
31391
|
exports.Material = Material;
|
|
@@ -31544,7 +31456,6 @@ exports.base64ToFile = base64ToFile;
|
|
|
31544
31456
|
exports.blend = blend;
|
|
31545
31457
|
exports.calculateTranslation = calculateTranslation;
|
|
31546
31458
|
exports.canvasPool = canvasPool;
|
|
31547
|
-
exports.closeImageBitMap = closeImageBitMap;
|
|
31548
31459
|
exports.colorGradingFrag = colorGradingFrag;
|
|
31549
31460
|
exports.colorStopsFromGradient = colorStopsFromGradient;
|
|
31550
31461
|
exports.colorToArr = colorToArr$1;
|
|
@@ -31623,7 +31534,6 @@ exports.loadAVIFOptional = loadAVIFOptional;
|
|
|
31623
31534
|
exports.loadBinary = loadBinary;
|
|
31624
31535
|
exports.loadBlob = loadBlob;
|
|
31625
31536
|
exports.loadImage = loadImage;
|
|
31626
|
-
exports.loadImageBitmap = loadImageBitmap;
|
|
31627
31537
|
exports.loadMedia = loadMedia;
|
|
31628
31538
|
exports.loadVideo = loadVideo;
|
|
31629
31539
|
exports.loadWebPOptional = loadWebPOptional;
|