@galacean/engine-core 1.3.18 → 1.3.20
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 +211 -154
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +211 -154
- package/dist/module.js +211 -154
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/asset/Loader.d.ts +0 -2
- package/types/particle/ParticleGenerator.d.ts +1 -0
package/dist/module.js
CHANGED
|
@@ -18668,8 +18668,20 @@ __decorate([
|
|
|
18668
18668
|
mesh.setVertexElements([
|
|
18669
18669
|
new VertexElement("POSITION_UV", 0, VertexElementFormat.Vector4, 0)
|
|
18670
18670
|
]);
|
|
18671
|
-
|
|
18671
|
+
var buffer = new Buffer(engine, BufferBindFlag.VertexBuffer, vertices, BufferUsage.Static, true);
|
|
18672
|
+
mesh.setVertexBufferBinding(buffer, 16);
|
|
18672
18673
|
mesh.addSubMesh(0, 3, MeshTopology.Triangles);
|
|
18674
|
+
engine.resourceManager.addContentRestorer(new /*#__PURE__*/ (function(ContentRestorer) {
|
|
18675
|
+
_inherits(_class, ContentRestorer);
|
|
18676
|
+
function _class() {
|
|
18677
|
+
return ContentRestorer.call(this, mesh);
|
|
18678
|
+
}
|
|
18679
|
+
var _proto = _class.prototype;
|
|
18680
|
+
_proto.restoreContent = function restoreContent() {
|
|
18681
|
+
buffer.setData(buffer.data);
|
|
18682
|
+
};
|
|
18683
|
+
return _class;
|
|
18684
|
+
}(ContentRestorer))());
|
|
18673
18685
|
return mesh;
|
|
18674
18686
|
};
|
|
18675
18687
|
_proto._create1x1Texture = function _create1x1Texture(engine, type, format, pixel) {
|
|
@@ -19460,6 +19472,151 @@ var /** @internal */ PromiseState;
|
|
|
19460
19472
|
PromiseState["Canceled"] = "canceled";
|
|
19461
19473
|
})(PromiseState || (PromiseState = {}));
|
|
19462
19474
|
|
|
19475
|
+
var mimeType = {
|
|
19476
|
+
json: "json",
|
|
19477
|
+
gltf: "json",
|
|
19478
|
+
mtl: "json",
|
|
19479
|
+
prefab: "json",
|
|
19480
|
+
txt: "text",
|
|
19481
|
+
bin: "arraybuffer",
|
|
19482
|
+
png: "image",
|
|
19483
|
+
webp: "image",
|
|
19484
|
+
jpg: "image"
|
|
19485
|
+
};
|
|
19486
|
+
var defaultRetryCount = 1;
|
|
19487
|
+
var defaultTimeout = Infinity;
|
|
19488
|
+
var defaultInterval = 500;
|
|
19489
|
+
/**
|
|
19490
|
+
* Web request.
|
|
19491
|
+
* @param url - The link
|
|
19492
|
+
* @param config - Load configuration
|
|
19493
|
+
*/ function request(url, config) {
|
|
19494
|
+
if (config === void 0) config = {};
|
|
19495
|
+
return new AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
|
|
19496
|
+
var _config_retryCount;
|
|
19497
|
+
var retryCount = (_config_retryCount = config.retryCount) != null ? _config_retryCount : defaultRetryCount;
|
|
19498
|
+
var _config_retryInterval;
|
|
19499
|
+
var retryInterval = (_config_retryInterval = config.retryInterval) != null ? _config_retryInterval : defaultInterval;
|
|
19500
|
+
var _config_timeout;
|
|
19501
|
+
config.timeout = (_config_timeout = config.timeout) != null ? _config_timeout : defaultTimeout;
|
|
19502
|
+
var _config_type;
|
|
19503
|
+
config.type = (_config_type = config.type) != null ? _config_type : getMimeTypeFromUrl(url);
|
|
19504
|
+
var executor = new MultiExecutor(function() {
|
|
19505
|
+
return requestRes(url, config).onProgress(setTaskCompleteProgress, setTaskDetailProgress);
|
|
19506
|
+
}, retryCount, retryInterval);
|
|
19507
|
+
executor.start().onError(reject).onComplete(resolve);
|
|
19508
|
+
});
|
|
19509
|
+
}
|
|
19510
|
+
function requestRes(url, config) {
|
|
19511
|
+
return new AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
|
|
19512
|
+
var xhr = new XMLHttpRequest();
|
|
19513
|
+
var isImg = config.type === "image";
|
|
19514
|
+
xhr.timeout = config.timeout;
|
|
19515
|
+
var _config_method;
|
|
19516
|
+
config.method = (_config_method = config.method) != null ? _config_method : "get";
|
|
19517
|
+
xhr.onload = function() {
|
|
19518
|
+
if (xhr.status < 200 || xhr.status >= 300) {
|
|
19519
|
+
reject(new Error("request failed from: " + url));
|
|
19520
|
+
return;
|
|
19521
|
+
}
|
|
19522
|
+
var _xhr_response;
|
|
19523
|
+
var result = (_xhr_response = xhr.response) != null ? _xhr_response : xhr.responseText;
|
|
19524
|
+
if (isImg) {
|
|
19525
|
+
var img = new Image();
|
|
19526
|
+
img.onload = function() {
|
|
19527
|
+
// Call requestAnimationFrame to avoid iOS's bug.
|
|
19528
|
+
requestAnimationFrame(function() {
|
|
19529
|
+
setTaskCompleteProgress(1, 1);
|
|
19530
|
+
//@ts-ignore
|
|
19531
|
+
resolve(img);
|
|
19532
|
+
img.onload = null;
|
|
19533
|
+
img.onerror = null;
|
|
19534
|
+
img.onabort = null;
|
|
19535
|
+
URL.revokeObjectURL(img.src);
|
|
19536
|
+
});
|
|
19537
|
+
};
|
|
19538
|
+
img.onerror = img.onabort = function() {
|
|
19539
|
+
reject(new Error("request " + img.src + " fail"));
|
|
19540
|
+
URL.revokeObjectURL(img.src);
|
|
19541
|
+
};
|
|
19542
|
+
img.crossOrigin = "anonymous";
|
|
19543
|
+
img.src = URL.createObjectURL(result);
|
|
19544
|
+
} else {
|
|
19545
|
+
setTaskCompleteProgress(1, 1);
|
|
19546
|
+
resolve(result);
|
|
19547
|
+
}
|
|
19548
|
+
};
|
|
19549
|
+
xhr.onerror = function() {
|
|
19550
|
+
reject(new Error("request failed from: " + url));
|
|
19551
|
+
};
|
|
19552
|
+
xhr.ontimeout = function() {
|
|
19553
|
+
reject(new Error("request timeout from: " + url));
|
|
19554
|
+
};
|
|
19555
|
+
xhr.onprogress = function(e) {
|
|
19556
|
+
if (e.lengthComputable) {
|
|
19557
|
+
setTaskDetailProgress(url, e.loaded, e.total);
|
|
19558
|
+
}
|
|
19559
|
+
};
|
|
19560
|
+
xhr.open(config.method, url, true);
|
|
19561
|
+
xhr.withCredentials = config.credentials === "include";
|
|
19562
|
+
// @ts-ignore
|
|
19563
|
+
xhr.responseType = isImg ? "blob" : config.type;
|
|
19564
|
+
var headers = config.headers;
|
|
19565
|
+
if (headers) {
|
|
19566
|
+
Object.keys(headers).forEach(function(name) {
|
|
19567
|
+
xhr.setRequestHeader(name, headers[name]);
|
|
19568
|
+
});
|
|
19569
|
+
}
|
|
19570
|
+
// @ts-ignore
|
|
19571
|
+
xhr.send(config.body);
|
|
19572
|
+
});
|
|
19573
|
+
}
|
|
19574
|
+
function getMimeTypeFromUrl(url) {
|
|
19575
|
+
var extname = url.substring(url.lastIndexOf(".") + 1);
|
|
19576
|
+
return mimeType[extname];
|
|
19577
|
+
}
|
|
19578
|
+
var MultiExecutor = /*#__PURE__*/ function() {
|
|
19579
|
+
function MultiExecutor(execFunc, totalCount, interval) {
|
|
19580
|
+
this.execFunc = execFunc;
|
|
19581
|
+
this.totalCount = totalCount;
|
|
19582
|
+
this.interval = interval;
|
|
19583
|
+
this._timeoutId = -100;
|
|
19584
|
+
this._currentCount = 0;
|
|
19585
|
+
this.exec = this.exec.bind(this);
|
|
19586
|
+
}
|
|
19587
|
+
var _proto = MultiExecutor.prototype;
|
|
19588
|
+
_proto.start = function start() {
|
|
19589
|
+
this.exec();
|
|
19590
|
+
return this;
|
|
19591
|
+
};
|
|
19592
|
+
_proto.onComplete = function onComplete(func) {
|
|
19593
|
+
this._onComplete = func;
|
|
19594
|
+
return this;
|
|
19595
|
+
};
|
|
19596
|
+
_proto.onError = function onError(func) {
|
|
19597
|
+
this._onError = func;
|
|
19598
|
+
return this;
|
|
19599
|
+
};
|
|
19600
|
+
_proto.cancel = function cancel() {
|
|
19601
|
+
window.clearTimeout(this._timeoutId);
|
|
19602
|
+
};
|
|
19603
|
+
_proto.exec = function exec() {
|
|
19604
|
+
var _this = this;
|
|
19605
|
+
if (this._currentCount >= this.totalCount) {
|
|
19606
|
+
this._onError && this._onError(this._error);
|
|
19607
|
+
return;
|
|
19608
|
+
}
|
|
19609
|
+
this._currentCount++;
|
|
19610
|
+
this.execFunc(this._currentCount).then(function(result) {
|
|
19611
|
+
return _this._onComplete && _this._onComplete(result);
|
|
19612
|
+
}).catch(function(e) {
|
|
19613
|
+
_this._error = e;
|
|
19614
|
+
_this._timeoutId = window.setTimeout(_this.exec, _this.interval);
|
|
19615
|
+
});
|
|
19616
|
+
};
|
|
19617
|
+
return MultiExecutor;
|
|
19618
|
+
}();
|
|
19619
|
+
|
|
19463
19620
|
/**
|
|
19464
19621
|
* ResourceManager
|
|
19465
19622
|
*/ var ResourceManager = /*#__PURE__*/ function() {
|
|
@@ -19555,6 +19712,23 @@ var /** @internal */ PromiseState;
|
|
|
19555
19712
|
};
|
|
19556
19713
|
/**
|
|
19557
19714
|
* @internal
|
|
19715
|
+
*/ _proto._getRemoteUrl = function _getRemoteUrl(url) {
|
|
19716
|
+
var _this__virtualPathMap_url;
|
|
19717
|
+
return (_this__virtualPathMap_url = this._virtualPathMap[url]) != null ? _this__virtualPathMap_url : url;
|
|
19718
|
+
};
|
|
19719
|
+
/**
|
|
19720
|
+
* @internal
|
|
19721
|
+
*/ _proto._requestByRemoteUrl = function _requestByRemoteUrl(url, config) {
|
|
19722
|
+
return request(url, config);
|
|
19723
|
+
};
|
|
19724
|
+
/**
|
|
19725
|
+
* @internal
|
|
19726
|
+
*/ _proto._request = function _request(url, config) {
|
|
19727
|
+
var remoteUrl = this._getRemoteUrl(url);
|
|
19728
|
+
return this._requestByRemoteUrl(remoteUrl, config);
|
|
19729
|
+
};
|
|
19730
|
+
/**
|
|
19731
|
+
* @internal
|
|
19558
19732
|
*/ _proto._onSubAssetSuccess = function _onSubAssetSuccess(assetBaseURL, assetSubPath, value) {
|
|
19559
19733
|
var _this__subAssetPromiseCallbacks_remoteAssetBaseURL;
|
|
19560
19734
|
var _this__virtualPathMap_assetBaseURL;
|
|
@@ -24084,7 +24258,21 @@ ShaderPool.init();
|
|
|
24084
24258
|
mesh.uploadData(false);
|
|
24085
24259
|
};
|
|
24086
24260
|
_proto._initMesh = function _initMesh(engine) {
|
|
24087
|
-
this._mesh = this._createPlane(engine);
|
|
24261
|
+
var mesh = this._mesh = this._createPlane(engine);
|
|
24262
|
+
engine.resourceManager.addContentRestorer(new /*#__PURE__*/ (function(ContentRestorer) {
|
|
24263
|
+
_inherits(_class, ContentRestorer);
|
|
24264
|
+
function _class() {
|
|
24265
|
+
return ContentRestorer.call(this, mesh);
|
|
24266
|
+
}
|
|
24267
|
+
var _proto = _class.prototype;
|
|
24268
|
+
_proto.restoreContent = function restoreContent() {
|
|
24269
|
+
mesh.setPositions(mesh.getPositions());
|
|
24270
|
+
mesh.setUVs(mesh.getUVs());
|
|
24271
|
+
mesh.setIndices(mesh.getIndices());
|
|
24272
|
+
mesh.uploadData(false);
|
|
24273
|
+
};
|
|
24274
|
+
return _class;
|
|
24275
|
+
}(ContentRestorer))());
|
|
24088
24276
|
this._mesh._addReferCount(1);
|
|
24089
24277
|
};
|
|
24090
24278
|
_proto._initMaterial = function _initMaterial(engine) {
|
|
@@ -26331,163 +26519,12 @@ __decorate([
|
|
|
26331
26519
|
ignoreClone
|
|
26332
26520
|
], Script.prototype, "_entityScriptsIndex", void 0);
|
|
26333
26521
|
|
|
26334
|
-
var mimeType = {
|
|
26335
|
-
json: "json",
|
|
26336
|
-
gltf: "json",
|
|
26337
|
-
mtl: "json",
|
|
26338
|
-
prefab: "json",
|
|
26339
|
-
txt: "text",
|
|
26340
|
-
bin: "arraybuffer",
|
|
26341
|
-
png: "image",
|
|
26342
|
-
webp: "image",
|
|
26343
|
-
jpg: "image"
|
|
26344
|
-
};
|
|
26345
|
-
var defaultRetryCount = 1;
|
|
26346
|
-
var defaultTimeout = Infinity;
|
|
26347
|
-
var defaultInterval = 500;
|
|
26348
|
-
/**
|
|
26349
|
-
* Web request.
|
|
26350
|
-
* @param url - The link
|
|
26351
|
-
* @param config - Load configuration
|
|
26352
|
-
*/ function request(url, config) {
|
|
26353
|
-
if (config === void 0) config = {};
|
|
26354
|
-
return new AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
|
|
26355
|
-
var _config_retryCount;
|
|
26356
|
-
var retryCount = (_config_retryCount = config.retryCount) != null ? _config_retryCount : defaultRetryCount;
|
|
26357
|
-
var _config_retryInterval;
|
|
26358
|
-
var retryInterval = (_config_retryInterval = config.retryInterval) != null ? _config_retryInterval : defaultInterval;
|
|
26359
|
-
var _config_timeout;
|
|
26360
|
-
config.timeout = (_config_timeout = config.timeout) != null ? _config_timeout : defaultTimeout;
|
|
26361
|
-
var _config_type;
|
|
26362
|
-
config.type = (_config_type = config.type) != null ? _config_type : getMimeTypeFromUrl(url);
|
|
26363
|
-
var executor = new MultiExecutor(function() {
|
|
26364
|
-
return requestRes(url, config).onProgress(setTaskCompleteProgress, setTaskDetailProgress);
|
|
26365
|
-
}, retryCount, retryInterval);
|
|
26366
|
-
executor.start().onError(reject).onComplete(resolve);
|
|
26367
|
-
});
|
|
26368
|
-
}
|
|
26369
|
-
function requestRes(url, config) {
|
|
26370
|
-
return new AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
|
|
26371
|
-
var xhr = new XMLHttpRequest();
|
|
26372
|
-
var isImg = config.type === "image";
|
|
26373
|
-
xhr.timeout = config.timeout;
|
|
26374
|
-
var _config_method;
|
|
26375
|
-
config.method = (_config_method = config.method) != null ? _config_method : "get";
|
|
26376
|
-
xhr.onload = function() {
|
|
26377
|
-
if (xhr.status < 200 || xhr.status >= 300) {
|
|
26378
|
-
reject(new Error("request failed from: " + url));
|
|
26379
|
-
return;
|
|
26380
|
-
}
|
|
26381
|
-
var _xhr_response;
|
|
26382
|
-
var result = (_xhr_response = xhr.response) != null ? _xhr_response : xhr.responseText;
|
|
26383
|
-
if (isImg) {
|
|
26384
|
-
var img = new Image();
|
|
26385
|
-
img.onload = function() {
|
|
26386
|
-
// Call requestAnimationFrame to avoid iOS's bug.
|
|
26387
|
-
requestAnimationFrame(function() {
|
|
26388
|
-
setTaskCompleteProgress(1, 1);
|
|
26389
|
-
//@ts-ignore
|
|
26390
|
-
resolve(img);
|
|
26391
|
-
img.onload = null;
|
|
26392
|
-
img.onerror = null;
|
|
26393
|
-
img.onabort = null;
|
|
26394
|
-
URL.revokeObjectURL(img.src);
|
|
26395
|
-
});
|
|
26396
|
-
};
|
|
26397
|
-
img.onerror = img.onabort = function() {
|
|
26398
|
-
reject(new Error("request " + img.src + " fail"));
|
|
26399
|
-
URL.revokeObjectURL(img.src);
|
|
26400
|
-
};
|
|
26401
|
-
img.crossOrigin = "anonymous";
|
|
26402
|
-
img.src = URL.createObjectURL(result);
|
|
26403
|
-
} else {
|
|
26404
|
-
setTaskCompleteProgress(1, 1);
|
|
26405
|
-
resolve(result);
|
|
26406
|
-
}
|
|
26407
|
-
};
|
|
26408
|
-
xhr.onerror = function() {
|
|
26409
|
-
reject(new Error("request failed from: " + url));
|
|
26410
|
-
};
|
|
26411
|
-
xhr.ontimeout = function() {
|
|
26412
|
-
reject(new Error("request timeout from: " + url));
|
|
26413
|
-
};
|
|
26414
|
-
xhr.onprogress = function(e) {
|
|
26415
|
-
if (e.lengthComputable) {
|
|
26416
|
-
setTaskDetailProgress(url, e.loaded, e.total);
|
|
26417
|
-
}
|
|
26418
|
-
};
|
|
26419
|
-
xhr.open(config.method, url, true);
|
|
26420
|
-
xhr.withCredentials = config.credentials === "include";
|
|
26421
|
-
// @ts-ignore
|
|
26422
|
-
xhr.responseType = isImg ? "blob" : config.type;
|
|
26423
|
-
var headers = config.headers;
|
|
26424
|
-
if (headers) {
|
|
26425
|
-
Object.keys(headers).forEach(function(name) {
|
|
26426
|
-
xhr.setRequestHeader(name, headers[name]);
|
|
26427
|
-
});
|
|
26428
|
-
}
|
|
26429
|
-
// @ts-ignore
|
|
26430
|
-
xhr.send(config.body);
|
|
26431
|
-
});
|
|
26432
|
-
}
|
|
26433
|
-
function getMimeTypeFromUrl(url) {
|
|
26434
|
-
var extname = url.substring(url.lastIndexOf(".") + 1);
|
|
26435
|
-
return mimeType[extname];
|
|
26436
|
-
}
|
|
26437
|
-
var MultiExecutor = /*#__PURE__*/ function() {
|
|
26438
|
-
function MultiExecutor(execFunc, totalCount, interval) {
|
|
26439
|
-
this.execFunc = execFunc;
|
|
26440
|
-
this.totalCount = totalCount;
|
|
26441
|
-
this.interval = interval;
|
|
26442
|
-
this._timeoutId = -100;
|
|
26443
|
-
this._currentCount = 0;
|
|
26444
|
-
this.exec = this.exec.bind(this);
|
|
26445
|
-
}
|
|
26446
|
-
var _proto = MultiExecutor.prototype;
|
|
26447
|
-
_proto.start = function start() {
|
|
26448
|
-
this.exec();
|
|
26449
|
-
return this;
|
|
26450
|
-
};
|
|
26451
|
-
_proto.onComplete = function onComplete(func) {
|
|
26452
|
-
this._onComplete = func;
|
|
26453
|
-
return this;
|
|
26454
|
-
};
|
|
26455
|
-
_proto.onError = function onError(func) {
|
|
26456
|
-
this._onError = func;
|
|
26457
|
-
return this;
|
|
26458
|
-
};
|
|
26459
|
-
_proto.cancel = function cancel() {
|
|
26460
|
-
window.clearTimeout(this._timeoutId);
|
|
26461
|
-
};
|
|
26462
|
-
_proto.exec = function exec() {
|
|
26463
|
-
var _this = this;
|
|
26464
|
-
if (this._currentCount >= this.totalCount) {
|
|
26465
|
-
this._onError && this._onError(this._error);
|
|
26466
|
-
return;
|
|
26467
|
-
}
|
|
26468
|
-
this._currentCount++;
|
|
26469
|
-
this.execFunc(this._currentCount).then(function(result) {
|
|
26470
|
-
return _this._onComplete && _this._onComplete(result);
|
|
26471
|
-
}).catch(function(e) {
|
|
26472
|
-
_this._error = e;
|
|
26473
|
-
_this._timeoutId = window.setTimeout(_this.exec, _this.interval);
|
|
26474
|
-
});
|
|
26475
|
-
};
|
|
26476
|
-
return MultiExecutor;
|
|
26477
|
-
}();
|
|
26478
|
-
|
|
26479
26522
|
/**
|
|
26480
26523
|
* Loader abstract class.
|
|
26481
26524
|
*/ var Loader = /*#__PURE__*/ function() {
|
|
26482
26525
|
function Loader(useCache) {
|
|
26483
26526
|
this.useCache = useCache;
|
|
26484
26527
|
}
|
|
26485
|
-
var _proto = Loader.prototype;
|
|
26486
|
-
_proto.request = function request1(url, resourceManager, config) {
|
|
26487
|
-
var _resourceManager__virtualPathMap_url;
|
|
26488
|
-
var remoteUrl = (_resourceManager__virtualPathMap_url = resourceManager._virtualPathMap[url]) != null ? _resourceManager__virtualPathMap_url : url;
|
|
26489
|
-
return request(remoteUrl, config);
|
|
26490
|
-
};
|
|
26491
26528
|
/**
|
|
26492
26529
|
* Register a class with a string name for serialization and deserialization.
|
|
26493
26530
|
* @param key - class name
|
|
@@ -31478,6 +31515,7 @@ var MainModule = /*#__PURE__*/ function() {
|
|
|
31478
31515
|
/** Control how the Particle Generator applies its Transform component to the particles it emits. */ this.scalingMode = ParticleScaleMode.Local;
|
|
31479
31516
|
/** If set to true, the Particle Generator automatically begins to play on startup. */ this.playOnEnabled = true;
|
|
31480
31517
|
/** @internal */ this._maxParticleBuffer = 1000;
|
|
31518
|
+
/** @internal */ this._startDelayRand = new Rand(0, ParticleRandomSubSeeds.StartDelay);
|
|
31481
31519
|
/** @internal */ this._startSpeedRand = new Rand(0, ParticleRandomSubSeeds.StartSpeed);
|
|
31482
31520
|
/** @internal */ this._startLifeTimeRand = new Rand(0, ParticleRandomSubSeeds.StartLifetime);
|
|
31483
31521
|
/** @internal */ this._startColorRand = new Rand(0, ParticleRandomSubSeeds.StartColor);
|
|
@@ -31762,6 +31800,9 @@ __decorate([
|
|
|
31762
31800
|
__decorate([
|
|
31763
31801
|
ignoreClone
|
|
31764
31802
|
], MainModule.prototype, "_maxParticleBuffer", void 0);
|
|
31803
|
+
__decorate([
|
|
31804
|
+
ignoreClone
|
|
31805
|
+
], MainModule.prototype, "_startDelayRand", void 0);
|
|
31765
31806
|
__decorate([
|
|
31766
31807
|
ignoreClone
|
|
31767
31808
|
], MainModule.prototype, "_startSpeedRand", void 0);
|
|
@@ -32606,6 +32647,7 @@ __decorate([
|
|
|
32606
32647
|
this._transformedBoundsCount = 0;
|
|
32607
32648
|
this._firstActiveTransformedBoundingBox = 0;
|
|
32608
32649
|
this._firstFreeTransformedBoundingBox = 0;
|
|
32650
|
+
this._playStartDelay = 0;
|
|
32609
32651
|
this._renderer = renderer;
|
|
32610
32652
|
var subPrimitive = new SubPrimitive();
|
|
32611
32653
|
subPrimitive.start = 0;
|
|
@@ -32634,6 +32676,7 @@ __decorate([
|
|
|
32634
32676
|
if (this.useAutoRandomSeed) {
|
|
32635
32677
|
this._resetGlobalRandSeed(Math.floor(Math.random() * 0xffffffff)); // 2^32 - 1
|
|
32636
32678
|
}
|
|
32679
|
+
this._playStartDelay = this.main.startDelay.evaluate(undefined, this.main._startDelayRand.random());
|
|
32637
32680
|
}
|
|
32638
32681
|
};
|
|
32639
32682
|
/**
|
|
@@ -32703,7 +32746,18 @@ __decorate([
|
|
|
32703
32746
|
var _this = this, main = _this.main, emission = _this.emission;
|
|
32704
32747
|
var duration = main.duration;
|
|
32705
32748
|
var lastPlayTime = this._playTime;
|
|
32706
|
-
|
|
32749
|
+
var deltaTime = elapsedTime * main.simulationSpeed;
|
|
32750
|
+
// Process start delay time
|
|
32751
|
+
if (this._playStartDelay > 0) {
|
|
32752
|
+
var remainingDelay = this._playStartDelay -= deltaTime;
|
|
32753
|
+
if (remainingDelay < 0) {
|
|
32754
|
+
this._playTime -= remainingDelay;
|
|
32755
|
+
this._playStartDelay = 0;
|
|
32756
|
+
} else {
|
|
32757
|
+
return;
|
|
32758
|
+
}
|
|
32759
|
+
}
|
|
32760
|
+
this._playTime += deltaTime;
|
|
32707
32761
|
this._retireActiveParticles();
|
|
32708
32762
|
this._freeRetiredParticles();
|
|
32709
32763
|
if (main.simulationSpace === ParticleSimulationSpace.World) {
|
|
@@ -33480,6 +33534,9 @@ __decorate([
|
|
|
33480
33534
|
__decorate([
|
|
33481
33535
|
ignoreClone
|
|
33482
33536
|
], ParticleGenerator.prototype, "_firstFreeTransformedBoundingBox", void 0);
|
|
33537
|
+
__decorate([
|
|
33538
|
+
ignoreClone
|
|
33539
|
+
], ParticleGenerator.prototype, "_playStartDelay", void 0);
|
|
33483
33540
|
|
|
33484
33541
|
/**
|
|
33485
33542
|
* Particle Material.
|