@dcl/playground-assets 7.0.6-4006744889.commit-c6aff5f → 7.0.6-4009803567.commit-112733c
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/alpha.d.ts +0 -2
- package/dist/beta.d.ts +0 -2
- package/dist/index.bundled.d.ts +0 -2
- package/dist/index.js +70 -135
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/playground/sdk/apis.d.ts +1 -1
- package/dist/playground/sdk/dcl-sdk.package.json +16 -5
- package/dist/playground/snippets/billboard.ts +2 -7
- package/dist/playground/snippets/cube-spawner.ts +2 -13
- package/dist/playground/snippets/material.ts +1 -8
- package/dist/playground/snippets/mesh.ts +2 -9
- package/dist/playground/snippets/pointer-events.ts +1 -6
- package/dist/playground/snippets/raycast-hit-many.ts +4 -17
- package/dist/playground/snippets/raycast-hit.ts +3 -14
- package/dist/playground-assets.d.ts +0 -2
- package/etc/playground-assets.api.json +0 -33
- package/etc/playground-assets.api.md +0 -5
- package/package.json +3 -3
package/dist/alpha.d.ts
CHANGED
|
@@ -2866,8 +2866,6 @@ export declare const onRealmChangedObservable: Observable<{
|
|
|
2866
2866
|
|
|
2867
2867
|
export declare const onSceneReadyObservable: Observable<unknown>;
|
|
2868
2868
|
|
|
2869
|
-
export declare function onStart(): Promise<void>;
|
|
2870
|
-
|
|
2871
2869
|
export declare function onUpdate(deltaTime: number): Promise<void>;
|
|
2872
2870
|
|
|
2873
2871
|
export declare const onVideoEvent: Observable<{
|
package/dist/beta.d.ts
CHANGED
|
@@ -2866,8 +2866,6 @@ export declare const onRealmChangedObservable: Observable<{
|
|
|
2866
2866
|
|
|
2867
2867
|
export declare const onSceneReadyObservable: Observable<unknown>;
|
|
2868
2868
|
|
|
2869
|
-
export declare function onStart(): Promise<void>;
|
|
2870
|
-
|
|
2871
2869
|
export declare function onUpdate(deltaTime: number): Promise<void>;
|
|
2872
2870
|
|
|
2873
2871
|
export declare const onVideoEvent: Observable<{
|
package/dist/index.bundled.d.ts
CHANGED
|
@@ -2866,8 +2866,6 @@ export declare const onRealmChangedObservable: Observable<{
|
|
|
2866
2866
|
|
|
2867
2867
|
export declare const onSceneReadyObservable: Observable<unknown>;
|
|
2868
2868
|
|
|
2869
|
-
export declare function onStart(): Promise<void>;
|
|
2870
|
-
|
|
2871
2869
|
export declare function onUpdate(deltaTime: number): Promise<void>;
|
|
2872
2870
|
|
|
2873
2871
|
export declare const onVideoEvent: Observable<{
|
package/dist/index.js
CHANGED
|
@@ -12533,9 +12533,7 @@
|
|
|
12533
12533
|
const theComponent = MeshCollider$2(engine);
|
|
12534
12534
|
function getCollisionMask(layers) {
|
|
12535
12535
|
if (Array.isArray(layers)) {
|
|
12536
|
-
return layers
|
|
12537
|
-
.map((item) => item)
|
|
12538
|
-
.reduce((prev, item) => prev | item, 0);
|
|
12536
|
+
return layers.map((item) => item).reduce((prev, item) => prev | item, 0);
|
|
12539
12537
|
}
|
|
12540
12538
|
else if (layers) {
|
|
12541
12539
|
return layers;
|
|
@@ -12811,48 +12809,34 @@
|
|
|
12811
12809
|
var utf8Exports = requireUtf8();
|
|
12812
12810
|
|
|
12813
12811
|
const CRC_TABLE = new Int32Array([
|
|
12814
|
-
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
|
|
12815
|
-
|
|
12816
|
-
|
|
12817
|
-
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
|
|
12827
|
-
|
|
12828
|
-
|
|
12829
|
-
|
|
12830
|
-
|
|
12831
|
-
|
|
12832
|
-
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
|
|
12836
|
-
|
|
12837
|
-
|
|
12838
|
-
|
|
12839
|
-
|
|
12840
|
-
|
|
12841
|
-
|
|
12842
|
-
0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
|
|
12843
|
-
0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
|
|
12844
|
-
0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
|
|
12845
|
-
0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
|
|
12846
|
-
0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
|
|
12847
|
-
0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
|
|
12848
|
-
0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
|
|
12849
|
-
0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
|
|
12850
|
-
0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
|
|
12851
|
-
0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
|
|
12852
|
-
0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
|
|
12853
|
-
0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
|
|
12854
|
-
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
|
|
12855
|
-
0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
|
|
12812
|
+
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832,
|
|
12813
|
+
0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
|
|
12814
|
+
0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a,
|
|
12815
|
+
0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
|
|
12816
|
+
0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
|
|
12817
|
+
0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
|
|
12818
|
+
0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab,
|
|
12819
|
+
0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
|
|
12820
|
+
0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4,
|
|
12821
|
+
0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
|
|
12822
|
+
0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074,
|
|
12823
|
+
0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
|
|
12824
|
+
0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525,
|
|
12825
|
+
0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
|
|
12826
|
+
0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
|
|
12827
|
+
0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
|
|
12828
|
+
0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76,
|
|
12829
|
+
0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
|
|
12830
|
+
0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6,
|
|
12831
|
+
0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
|
|
12832
|
+
0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7,
|
|
12833
|
+
0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
|
|
12834
|
+
0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7,
|
|
12835
|
+
0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
|
|
12836
|
+
0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
|
|
12837
|
+
0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
|
|
12838
|
+
0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330,
|
|
12839
|
+
0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
|
|
12856
12840
|
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
|
|
12857
12841
|
]);
|
|
12858
12842
|
function _crc32(buf, previous) {
|
|
@@ -12883,9 +12867,7 @@
|
|
|
12883
12867
|
|
|
12884
12868
|
function checkNotThenable(t, error) {
|
|
12885
12869
|
if (globalThis.DEBUG) {
|
|
12886
|
-
if (t &&
|
|
12887
|
-
typeof t === 'object' &&
|
|
12888
|
-
typeof t.then === 'function') {
|
|
12870
|
+
if (t && typeof t === 'object' && typeof t.then === 'function') {
|
|
12889
12871
|
throw new Error(error);
|
|
12890
12872
|
}
|
|
12891
12873
|
}
|
|
@@ -13656,18 +13638,14 @@
|
|
|
13656
13638
|
* @returns [entityNumber, entityVersion]
|
|
13657
13639
|
*/
|
|
13658
13640
|
function fromEntityId(entityId) {
|
|
13659
|
-
return [
|
|
13660
|
-
(entityId & MAX_U16) >>> 0,
|
|
13661
|
-
(((entityId & MASK_UPPER_16_ON_32) >> 16) & MAX_U16) >>> 0
|
|
13662
|
-
];
|
|
13641
|
+
return [(entityId & MAX_U16) >>> 0, (((entityId & MASK_UPPER_16_ON_32) >> 16) & MAX_U16) >>> 0];
|
|
13663
13642
|
}
|
|
13664
13643
|
EntityUtils.fromEntityId = fromEntityId;
|
|
13665
13644
|
/**
|
|
13666
13645
|
* @returns compound number from entityNumber and entityVerison
|
|
13667
13646
|
*/
|
|
13668
13647
|
function toEntityId(entityNumber, entityVersion) {
|
|
13669
|
-
return (((entityNumber & MAX_U16) | ((entityVersion & MAX_U16) << 16)) >>>
|
|
13670
|
-
0);
|
|
13648
|
+
return (((entityNumber & MAX_U16) | ((entityVersion & MAX_U16) << 16)) >>> 0);
|
|
13671
13649
|
}
|
|
13672
13650
|
EntityUtils.toEntityId = toEntityId;
|
|
13673
13651
|
})(exports.EntityUtils || (exports.EntityUtils = {}));
|
|
@@ -14268,9 +14246,7 @@
|
|
|
14268
14246
|
...header,
|
|
14269
14247
|
...message,
|
|
14270
14248
|
transportId,
|
|
14271
|
-
messageBuffer: buffer
|
|
14272
|
-
.buffer()
|
|
14273
|
-
.subarray(offset, buffer.currentReadOffset())
|
|
14249
|
+
messageBuffer: buffer.buffer().subarray(offset, buffer.currentReadOffset())
|
|
14274
14250
|
});
|
|
14275
14251
|
}
|
|
14276
14252
|
else if (header.type === exports.CrdtMessageType.PUT_COMPONENT) {
|
|
@@ -14279,9 +14255,7 @@
|
|
|
14279
14255
|
...header,
|
|
14280
14256
|
...message,
|
|
14281
14257
|
transportId,
|
|
14282
|
-
messageBuffer: buffer
|
|
14283
|
-
.buffer()
|
|
14284
|
-
.subarray(offset, buffer.currentReadOffset())
|
|
14258
|
+
messageBuffer: buffer.buffer().subarray(offset, buffer.currentReadOffset())
|
|
14285
14259
|
});
|
|
14286
14260
|
}
|
|
14287
14261
|
else if (header.type === exports.CrdtMessageType.DELETE_ENTITY) {
|
|
@@ -14290,9 +14264,7 @@
|
|
|
14290
14264
|
...header,
|
|
14291
14265
|
...message,
|
|
14292
14266
|
transportId,
|
|
14293
|
-
messageBuffer: buffer
|
|
14294
|
-
.buffer()
|
|
14295
|
-
.subarray(offset, buffer.currentReadOffset())
|
|
14267
|
+
messageBuffer: buffer.buffer().subarray(offset, buffer.currentReadOffset())
|
|
14296
14268
|
});
|
|
14297
14269
|
// Unknown message, we skip it
|
|
14298
14270
|
}
|
|
@@ -14367,17 +14339,13 @@
|
|
|
14367
14339
|
const data = new ReadWriteByteBuffer(msg.data);
|
|
14368
14340
|
component.upsertFromBinary(msg.entityId, data, false);
|
|
14369
14341
|
}
|
|
14370
|
-
onProcessEntityComponentChange &&
|
|
14371
|
-
onProcessEntityComponentChange(msg.entityId, msg.type, component);
|
|
14342
|
+
onProcessEntityComponentChange && onProcessEntityComponentChange(msg.entityId, msg.type, component);
|
|
14372
14343
|
break;
|
|
14373
14344
|
// CRDT outdated message. Resend this message to the transport
|
|
14374
14345
|
// To do this we add this message to a queue that will be processed at the end of the update tick
|
|
14375
14346
|
case typesExports.ProcessMessageResultType.StateOutdatedData:
|
|
14376
14347
|
case typesExports.ProcessMessageResultType.StateOutdatedTimestamp:
|
|
14377
|
-
const current = crdtClient
|
|
14378
|
-
.getState()
|
|
14379
|
-
.components.get(msg.componentId)
|
|
14380
|
-
?.get(msg.entityId);
|
|
14348
|
+
const current = crdtClient.getState().components.get(msg.componentId)?.get(msg.entityId);
|
|
14381
14349
|
if (current) {
|
|
14382
14350
|
const offset = bufferForOutdated.currentWriteOffset();
|
|
14383
14351
|
const ts = current.timestamp;
|
|
@@ -14389,9 +14357,7 @@
|
|
|
14389
14357
|
}
|
|
14390
14358
|
outdatedMessages.push({
|
|
14391
14359
|
...msg,
|
|
14392
|
-
messageBuffer: bufferForOutdated
|
|
14393
|
-
.buffer()
|
|
14394
|
-
.subarray(offset, bufferForOutdated.currentWriteOffset())
|
|
14360
|
+
messageBuffer: bufferForOutdated.buffer().subarray(offset, bufferForOutdated.currentWriteOffset())
|
|
14395
14361
|
});
|
|
14396
14362
|
}
|
|
14397
14363
|
break;
|
|
@@ -14412,8 +14378,7 @@
|
|
|
14412
14378
|
definition.deleteFrom(entity, false);
|
|
14413
14379
|
}
|
|
14414
14380
|
engine.entityContainer.updateRemovedEntity(entity);
|
|
14415
|
-
onProcessEntityComponentChange &&
|
|
14416
|
-
onProcessEntityComponentChange(entity, exports.CrdtMessageType.DELETE_ENTITY);
|
|
14381
|
+
onProcessEntityComponentChange && onProcessEntityComponentChange(entity, exports.CrdtMessageType.DELETE_ENTITY);
|
|
14417
14382
|
}
|
|
14418
14383
|
}
|
|
14419
14384
|
/**
|
|
@@ -14441,9 +14406,7 @@
|
|
|
14441
14406
|
else {
|
|
14442
14407
|
entitySet.push(entity);
|
|
14443
14408
|
onProcessEntityComponentChange &&
|
|
14444
|
-
onProcessEntityComponentChange(entity, componentValue === null
|
|
14445
|
-
? exports.CrdtMessageType.DELETE_COMPONENT
|
|
14446
|
-
: exports.CrdtMessageType.PUT_COMPONENT, component);
|
|
14409
|
+
onProcessEntityComponentChange(entity, componentValue === null ? exports.CrdtMessageType.DELETE_COMPONENT : exports.CrdtMessageType.PUT_COMPONENT, component);
|
|
14447
14410
|
}
|
|
14448
14411
|
}
|
|
14449
14412
|
}
|
|
@@ -14484,9 +14447,7 @@
|
|
|
14484
14447
|
}
|
|
14485
14448
|
crdtMessages.push({
|
|
14486
14449
|
...transportMessage,
|
|
14487
|
-
messageBuffer: buffer
|
|
14488
|
-
.buffer()
|
|
14489
|
-
.subarray(offset, buffer.currentWriteOffset())
|
|
14450
|
+
messageBuffer: buffer.buffer().subarray(offset, buffer.currentWriteOffset())
|
|
14490
14451
|
});
|
|
14491
14452
|
}
|
|
14492
14453
|
}
|
|
@@ -14499,9 +14460,7 @@
|
|
|
14499
14460
|
crdtMessages.push({
|
|
14500
14461
|
type: exports.CrdtMessageType.DELETE_ENTITY,
|
|
14501
14462
|
entityId,
|
|
14502
|
-
messageBuffer: buffer
|
|
14503
|
-
.buffer()
|
|
14504
|
-
.subarray(offset, buffer.currentWriteOffset())
|
|
14463
|
+
messageBuffer: buffer.buffer().subarray(offset, buffer.currentWriteOffset())
|
|
14505
14464
|
});
|
|
14506
14465
|
}
|
|
14507
14466
|
// Send CRDT messages to transports
|
|
@@ -14525,14 +14484,11 @@
|
|
|
14525
14484
|
}
|
|
14526
14485
|
// Then we send all the new crdtMessages that the transport needs to process
|
|
14527
14486
|
for (const message of crdtMessages) {
|
|
14528
|
-
if (message.transportId !== transportIndex &&
|
|
14529
|
-
transport.filter(message)) {
|
|
14487
|
+
if (message.transportId !== transportIndex && transport.filter(message)) {
|
|
14530
14488
|
transportBuffer.writeBuffer(message.messageBuffer, false);
|
|
14531
14489
|
}
|
|
14532
14490
|
}
|
|
14533
|
-
const message = transportBuffer.currentWriteOffset()
|
|
14534
|
-
? transportBuffer.toBinary()
|
|
14535
|
-
: new Uint8Array([]);
|
|
14491
|
+
const message = transportBuffer.currentWriteOffset() ? transportBuffer.toBinary() : new Uint8Array([]);
|
|
14536
14492
|
await transport.send(message);
|
|
14537
14493
|
}
|
|
14538
14494
|
}
|
|
@@ -14613,21 +14569,13 @@
|
|
|
14613
14569
|
if (component) {
|
|
14614
14570
|
throw new Error(`[create] Component ${componentName} for ${entity} already exists`);
|
|
14615
14571
|
}
|
|
14616
|
-
const usedValue = value === undefined
|
|
14617
|
-
? schema.create()
|
|
14618
|
-
: schema.extend
|
|
14619
|
-
? schema.extend(value)
|
|
14620
|
-
: value;
|
|
14572
|
+
const usedValue = value === undefined ? schema.create() : schema.extend ? schema.extend(value) : value;
|
|
14621
14573
|
data.set(entity, usedValue);
|
|
14622
14574
|
dirtyIterator.add(entity);
|
|
14623
14575
|
return usedValue;
|
|
14624
14576
|
},
|
|
14625
14577
|
createOrReplace(entity, value) {
|
|
14626
|
-
const usedValue = value === undefined
|
|
14627
|
-
? schema.create()
|
|
14628
|
-
: schema.extend
|
|
14629
|
-
? schema.extend(value)
|
|
14630
|
-
: value;
|
|
14578
|
+
const usedValue = value === undefined ? schema.create() : schema.extend ? schema.extend(value) : value;
|
|
14631
14579
|
data.set(entity, usedValue);
|
|
14632
14580
|
dirtyIterator.add(entity);
|
|
14633
14581
|
return usedValue;
|
|
@@ -14838,8 +14786,7 @@
|
|
|
14838
14786
|
return null;
|
|
14839
14787
|
const state = InternalInputStateComponent.get(engine.RootEntity);
|
|
14840
14788
|
// If the DOWN command has happen before the UP commands, it means that that a clicked has happen
|
|
14841
|
-
if (down.timestamp < up.timestamp &&
|
|
14842
|
-
up.timestamp > state.timestampLastUpdate) {
|
|
14789
|
+
if (down.timestamp < up.timestamp && up.timestamp > state.timestampLastUpdate) {
|
|
14843
14790
|
InternalInputStateComponent.getMutable(engine.RootEntity).currentTimestamp = Math.max(up.timestamp, state.currentTimestamp);
|
|
14844
14791
|
return { up, down };
|
|
14845
14792
|
}
|
|
@@ -15159,7 +15106,7 @@
|
|
|
15159
15106
|
});
|
|
15160
15107
|
const eventsMap = new Map();
|
|
15161
15108
|
function getEvent(entity) {
|
|
15162
|
-
return
|
|
15109
|
+
return eventsMap.get(entity) || eventsMap.set(entity, new Map()).get(entity);
|
|
15163
15110
|
}
|
|
15164
15111
|
function setPointerEvent(entity, type, opts) {
|
|
15165
15112
|
if (opts.hoverText || opts.showFeedback) {
|
|
@@ -40743,9 +40690,7 @@
|
|
|
40743
40690
|
* @internal
|
|
40744
40691
|
*/
|
|
40745
40692
|
function getJustify(justify) {
|
|
40746
|
-
const value = justify
|
|
40747
|
-
? parseJustify[justify]
|
|
40748
|
-
: 0 /* YGJustify.YGJ_FLEX_START */;
|
|
40693
|
+
const value = justify ? parseJustify[justify] : 0 /* YGJustify.YGJ_FLEX_START */;
|
|
40749
40694
|
return { justifyContent: value };
|
|
40750
40695
|
}
|
|
40751
40696
|
const parseJustify = {
|
|
@@ -40777,9 +40722,7 @@
|
|
|
40777
40722
|
* @internal
|
|
40778
40723
|
*/
|
|
40779
40724
|
function getFlexDirection(flexDirection) {
|
|
40780
|
-
const value = flexDirection
|
|
40781
|
-
? parseFlexDirection[flexDirection]
|
|
40782
|
-
: 0 /* YGFlexDirection.YGFD_ROW */;
|
|
40725
|
+
const value = flexDirection ? parseFlexDirection[flexDirection] : 0 /* YGFlexDirection.YGFD_ROW */;
|
|
40783
40726
|
return { flexDirection: value };
|
|
40784
40727
|
}
|
|
40785
40728
|
const parseFlexDirection = {
|
|
@@ -40804,9 +40747,7 @@
|
|
|
40804
40747
|
* @internal
|
|
40805
40748
|
*/
|
|
40806
40749
|
function getOverflow(overflow) {
|
|
40807
|
-
const value = overflow
|
|
40808
|
-
? parseOverflow[overflow]
|
|
40809
|
-
: 0 /* YGOverflow.YGO_VISIBLE */;
|
|
40750
|
+
const value = overflow ? parseOverflow[overflow] : 0 /* YGOverflow.YGO_VISIBLE */;
|
|
40810
40751
|
return { overflow: value };
|
|
40811
40752
|
}
|
|
40812
40753
|
const parseOverflow = {
|
|
@@ -40818,9 +40759,7 @@
|
|
|
40818
40759
|
* @internal
|
|
40819
40760
|
*/
|
|
40820
40761
|
function getPoistionType(position) {
|
|
40821
|
-
const value = position
|
|
40822
|
-
? parsePositionType[position]
|
|
40823
|
-
: 0 /* YGPositionType.YGPT_RELATIVE */;
|
|
40762
|
+
const value = position ? parsePositionType[position] : 0 /* YGPositionType.YGPT_RELATIVE */;
|
|
40824
40763
|
return { positionType: value };
|
|
40825
40764
|
}
|
|
40826
40765
|
const parsePositionType = {
|
|
@@ -40911,9 +40850,7 @@
|
|
|
40911
40850
|
* @internal
|
|
40912
40851
|
*/
|
|
40913
40852
|
function getTextureMode(mode) {
|
|
40914
|
-
const value = mode
|
|
40915
|
-
? parseTextureMode[mode]
|
|
40916
|
-
: 1 /* BackgroundTextureMode.CENTER */;
|
|
40853
|
+
const value = mode ? parseTextureMode[mode] : 1 /* BackgroundTextureMode.CENTER */;
|
|
40917
40854
|
return { textureMode: value };
|
|
40918
40855
|
}
|
|
40919
40856
|
function isAvatarTexture(props) {
|
|
@@ -40985,9 +40922,7 @@
|
|
|
40985
40922
|
function parseProps(props) {
|
|
40986
40923
|
const { uiTransform, uiBackground, ...otherProps } = props;
|
|
40987
40924
|
const uiTransformProps = parseUiTransform(uiTransform);
|
|
40988
|
-
const uiBackgroundProps = uiBackground
|
|
40989
|
-
? { uiBackground: parseUiBackground(uiBackground) }
|
|
40990
|
-
: undefined;
|
|
40925
|
+
const uiBackgroundProps = uiBackground ? { uiBackground: parseUiBackground(uiBackground) } : undefined;
|
|
40991
40926
|
return {
|
|
40992
40927
|
...otherProps,
|
|
40993
40928
|
uiTransform: uiTransformProps,
|
|
@@ -41350,9 +41285,7 @@
|
|
|
41350
41285
|
return;
|
|
41351
41286
|
}
|
|
41352
41287
|
if (update.props) {
|
|
41353
|
-
const pointerEvent = update.component === 'onMouseDown'
|
|
41354
|
-
? pointerEvents.onPointerDown
|
|
41355
|
-
: pointerEvents.onPointerUp;
|
|
41288
|
+
const pointerEvent = update.component === 'onMouseDown' ? pointerEvents.onPointerDown : pointerEvents.onPointerUp;
|
|
41356
41289
|
pointerEvent(instance.entity, update.props, {
|
|
41357
41290
|
button: 0 /* InputAction.IA_POINTER */,
|
|
41358
41291
|
// We add this showFeedBack so the pointerEventSystem creates a PointerEvent component with our entity
|
|
@@ -41369,8 +41302,7 @@
|
|
|
41369
41302
|
function upsertComponent(instance, props, componentName) {
|
|
41370
41303
|
const componentId = getComponentId[componentName];
|
|
41371
41304
|
const Component = engine.getComponent(componentId);
|
|
41372
|
-
const component = Component.getMutableOrNull(instance.entity) ||
|
|
41373
|
-
Component.create(instance.entity);
|
|
41305
|
+
const component = Component.getMutableOrNull(instance.entity) || Component.create(instance.entity);
|
|
41374
41306
|
for (const key in props) {
|
|
41375
41307
|
const keyProp = key;
|
|
41376
41308
|
if (key === 'onChange') {
|
|
@@ -41430,8 +41362,7 @@
|
|
|
41430
41362
|
removeChildEntity(child);
|
|
41431
41363
|
}
|
|
41432
41364
|
function updateOnChange(entity, componentId, state) {
|
|
41433
|
-
const event = changeEvents.get(entity) ||
|
|
41434
|
-
changeEvents.set(entity, new Map()).get(entity);
|
|
41365
|
+
const event = changeEvents.get(entity) || changeEvents.set(entity, new Map()).get(entity);
|
|
41435
41366
|
const oldState = event.get(componentId);
|
|
41436
41367
|
const fn = state?.fn;
|
|
41437
41368
|
const value = state?.value ?? oldState?.value;
|
|
@@ -41624,8 +41555,7 @@
|
|
|
41624
41555
|
}
|
|
41625
41556
|
removeCallback(callback, scope) {
|
|
41626
41557
|
for (let index = 0; index < this._observers.length; index++) {
|
|
41627
|
-
if (this._observers[index].callback === callback &&
|
|
41628
|
-
(!scope || scope === this._observers[index].scope)) {
|
|
41558
|
+
if (this._observers[index].callback === callback && (!scope || scope === this._observers[index].scope)) {
|
|
41629
41559
|
this._deferUnregister(this._observers[index]);
|
|
41630
41560
|
return true;
|
|
41631
41561
|
}
|
|
@@ -41648,10 +41578,7 @@
|
|
|
41648
41578
|
}
|
|
41649
41579
|
if (obs.mask & mask) {
|
|
41650
41580
|
if (obs.scope) {
|
|
41651
|
-
state.lastReturnValue = obs.callback.apply(obs.scope, [
|
|
41652
|
-
eventData,
|
|
41653
|
-
state
|
|
41654
|
-
]);
|
|
41581
|
+
state.lastReturnValue = obs.callback.apply(obs.scope, [eventData, state]);
|
|
41655
41582
|
}
|
|
41656
41583
|
else {
|
|
41657
41584
|
state.lastReturnValue = obs.callback(eventData, state);
|
|
@@ -41922,8 +41849,7 @@
|
|
|
41922
41849
|
}
|
|
41923
41850
|
},
|
|
41924
41851
|
filter(message) {
|
|
41925
|
-
if ((message.type === exports.CrdtMessageType.PUT_COMPONENT ||
|
|
41926
|
-
message.type === exports.CrdtMessageType.DELETE_COMPONENT) &&
|
|
41852
|
+
if ((message.type === exports.CrdtMessageType.PUT_COMPONENT || message.type === exports.CrdtMessageType.DELETE_COMPONENT) &&
|
|
41927
41853
|
message.componentId > MAX_STATIC_COMPONENT) {
|
|
41928
41854
|
return false;
|
|
41929
41855
|
}
|
|
@@ -41933,7 +41859,8 @@
|
|
|
41933
41859
|
return rendererTransport;
|
|
41934
41860
|
}
|
|
41935
41861
|
|
|
41936
|
-
|
|
41862
|
+
const rendererTransport = createRendererTransport({ crdtSendToRenderer: EngineApi.crdtSendToRenderer });
|
|
41863
|
+
engine.addTransport(rendererTransport);
|
|
41937
41864
|
setSubscribeFunction(EngineApi.subscribe);
|
|
41938
41865
|
async function onUpdate(deltaTime) {
|
|
41939
41866
|
await engine.update(deltaTime);
|
|
@@ -41941,6 +41868,14 @@
|
|
|
41941
41868
|
}
|
|
41942
41869
|
async function onStart() {
|
|
41943
41870
|
await engine.seal();
|
|
41871
|
+
const response = await EngineApi.crdtGetState({ data: new Uint8Array() });
|
|
41872
|
+
if (!!rendererTransport.onmessage) {
|
|
41873
|
+
if (response && response.data && response.data.length) {
|
|
41874
|
+
for (const byteArray of response.data) {
|
|
41875
|
+
rendererTransport.onmessage(byteArray);
|
|
41876
|
+
}
|
|
41877
|
+
}
|
|
41878
|
+
}
|
|
41944
41879
|
}
|
|
41945
41880
|
|
|
41946
41881
|
exports.AMOUNT_VERSION_AVAILABLE = AMOUNT_VERSION_AVAILABLE;
|