@dcl/ecs 7.3.40-7698451743.commit-c9c61fe → 7.3.40-7717066166.commit-ece036d
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/components/generated/global.gen.d.ts +8 -0
- package/dist/components/generated/global.gen.js +4 -0
- package/dist/components/generated/index.gen.d.ts +16 -0
- package/dist/components/generated/index.gen.js +22 -0
- package/dist/components/generated/pb/decentraland/sdk/components/avatar_emote_command.gen.d.ts +2 -13
- package/dist/components/generated/pb/decentraland/sdk/components/avatar_emote_command.gen.js +14 -43
- package/dist/components/generated/pb/decentraland/sdk/components/avatar_equipped_data.gen.d.ts +1 -1
- package/dist/components/generated/pb/decentraland/sdk/components/avatar_equipped_data.gen.js +3 -3
- package/dist/engine/component.d.ts +6 -0
- package/dist/engine/entity.d.ts +8 -4
- package/dist/engine/entity.js +13 -48
- package/dist/engine/grow-only-value-set-component-definition.js +9 -1
- package/dist/engine/index.js +28 -9
- package/dist/engine/lww-element-set-component-definition.js +8 -1
- package/dist/engine/types.d.ts +2 -1
- package/dist/systems/crdt/index.js +1 -1
- package/dist-cjs/components/generated/global.gen.d.ts +8 -0
- package/dist-cjs/components/generated/global.gen.js +5 -1
- package/dist-cjs/components/generated/index.gen.d.ts +16 -0
- package/dist-cjs/components/generated/index.gen.js +27 -1
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/avatar_emote_command.gen.d.ts +2 -13
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/avatar_emote_command.gen.js +15 -44
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/avatar_equipped_data.gen.d.ts +1 -1
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/avatar_equipped_data.gen.js +3 -3
- package/dist-cjs/engine/component.d.ts +6 -0
- package/dist-cjs/engine/entity.d.ts +8 -4
- package/dist-cjs/engine/entity.js +15 -50
- package/dist-cjs/engine/grow-only-value-set-component-definition.js +9 -1
- package/dist-cjs/engine/index.js +27 -8
- package/dist-cjs/engine/lww-element-set-component-definition.js +8 -1
- package/dist-cjs/engine/types.d.ts +2 -1
- package/dist-cjs/systems/crdt/index.js +1 -1
- package/package.json +2 -2
|
@@ -3,6 +3,9 @@ export * from './index.gen';
|
|
|
3
3
|
import { PBAudioSource } from './pb/decentraland/sdk/components/audio_source.gen';
|
|
4
4
|
import { PBAudioStream } from './pb/decentraland/sdk/components/audio_stream.gen';
|
|
5
5
|
import { PBAvatarAttach } from './pb/decentraland/sdk/components/avatar_attach.gen';
|
|
6
|
+
import { PBAvatarBase } from './pb/decentraland/sdk/components/avatar_base.gen';
|
|
7
|
+
import { PBAvatarEmoteCommand } from './pb/decentraland/sdk/components/avatar_emote_command.gen';
|
|
8
|
+
import { PBAvatarEquippedData } from './pb/decentraland/sdk/components/avatar_equipped_data.gen';
|
|
6
9
|
import { PBAvatarModifierArea } from './pb/decentraland/sdk/components/avatar_modifier_area.gen';
|
|
7
10
|
import { PBAvatarShape } from './pb/decentraland/sdk/components/avatar_shape.gen';
|
|
8
11
|
import { PBBillboard } from './pb/decentraland/sdk/components/billboard.gen';
|
|
@@ -12,6 +15,7 @@ import { PBEngineInfo } from './pb/decentraland/sdk/components/engine_info.gen';
|
|
|
12
15
|
import { PBGltfContainer } from './pb/decentraland/sdk/components/gltf_container.gen';
|
|
13
16
|
import { PBGltfContainerLoadingState } from './pb/decentraland/sdk/components/gltf_container_loading_state.gen';
|
|
14
17
|
import { PBNftShape } from './pb/decentraland/sdk/components/nft_shape.gen';
|
|
18
|
+
import { PBPlayerIdentityData } from './pb/decentraland/sdk/components/player_identity_data.gen';
|
|
15
19
|
import { PBPointerEvents } from './pb/decentraland/sdk/components/pointer_events.gen';
|
|
16
20
|
import { PBPointerEventsResult } from './pb/decentraland/sdk/components/pointer_events_result.gen';
|
|
17
21
|
import { PBPointerLock } from './pb/decentraland/sdk/components/pointer_lock.gen';
|
|
@@ -34,6 +38,9 @@ import { PBVisibilityComponent } from './pb/decentraland/sdk/components/visibili
|
|
|
34
38
|
/** @public */ export declare const AudioSource: LastWriteWinElementSetComponentDefinition<PBAudioSource>;
|
|
35
39
|
/** @public */ export declare const AudioStream: LastWriteWinElementSetComponentDefinition<PBAudioStream>;
|
|
36
40
|
/** @public */ export declare const AvatarAttach: LastWriteWinElementSetComponentDefinition<PBAvatarAttach>;
|
|
41
|
+
/** @public */ export declare const AvatarBase: LastWriteWinElementSetComponentDefinition<PBAvatarBase>;
|
|
42
|
+
/** @public */ export declare const AvatarEmoteCommand: GrowOnlyValueSetComponentDefinition<PBAvatarEmoteCommand>;
|
|
43
|
+
/** @public */ export declare const AvatarEquippedData: LastWriteWinElementSetComponentDefinition<PBAvatarEquippedData>;
|
|
37
44
|
/** @public */ export declare const AvatarModifierArea: LastWriteWinElementSetComponentDefinition<PBAvatarModifierArea>;
|
|
38
45
|
/** @public */ export declare const AvatarShape: LastWriteWinElementSetComponentDefinition<PBAvatarShape>;
|
|
39
46
|
/** @public */ export declare const Billboard: LastWriteWinElementSetComponentDefinition<PBBillboard>;
|
|
@@ -43,6 +50,7 @@ import { PBVisibilityComponent } from './pb/decentraland/sdk/components/visibili
|
|
|
43
50
|
/** @public */ export declare const GltfContainer: LastWriteWinElementSetComponentDefinition<PBGltfContainer>;
|
|
44
51
|
/** @public */ export declare const GltfContainerLoadingState: LastWriteWinElementSetComponentDefinition<PBGltfContainerLoadingState>;
|
|
45
52
|
/** @public */ export declare const NftShape: LastWriteWinElementSetComponentDefinition<PBNftShape>;
|
|
53
|
+
/** @public */ export declare const PlayerIdentityData: LastWriteWinElementSetComponentDefinition<PBPlayerIdentityData>;
|
|
46
54
|
/** @public */ export declare const PointerEvents: LastWriteWinElementSetComponentDefinition<PBPointerEvents>;
|
|
47
55
|
/** @public */ export declare const PointerEventsResult: GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>;
|
|
48
56
|
/** @public */ export declare const PointerLock: LastWriteWinElementSetComponentDefinition<PBPointerLock>;
|
|
@@ -4,6 +4,9 @@ export * from './index.gen';
|
|
|
4
4
|
/** @public */ export const AudioSource = /* @__PURE__ */ components.AudioSource(engine);
|
|
5
5
|
/** @public */ export const AudioStream = /* @__PURE__ */ components.AudioStream(engine);
|
|
6
6
|
/** @public */ export const AvatarAttach = /* @__PURE__ */ components.AvatarAttach(engine);
|
|
7
|
+
/** @public */ export const AvatarBase = /* @__PURE__ */ components.AvatarBase(engine);
|
|
8
|
+
/** @public */ export const AvatarEmoteCommand = /* @__PURE__ */ components.AvatarEmoteCommand(engine);
|
|
9
|
+
/** @public */ export const AvatarEquippedData = /* @__PURE__ */ components.AvatarEquippedData(engine);
|
|
7
10
|
/** @public */ export const AvatarModifierArea = /* @__PURE__ */ components.AvatarModifierArea(engine);
|
|
8
11
|
/** @public */ export const AvatarShape = /* @__PURE__ */ components.AvatarShape(engine);
|
|
9
12
|
/** @public */ export const Billboard = /* @__PURE__ */ components.Billboard(engine);
|
|
@@ -13,6 +16,7 @@ export * from './index.gen';
|
|
|
13
16
|
/** @public */ export const GltfContainer = /* @__PURE__ */ components.GltfContainer(engine);
|
|
14
17
|
/** @public */ export const GltfContainerLoadingState = /* @__PURE__ */ components.GltfContainerLoadingState(engine);
|
|
15
18
|
/** @public */ export const NftShape = /* @__PURE__ */ components.NftShape(engine);
|
|
19
|
+
/** @public */ export const PlayerIdentityData = /* @__PURE__ */ components.PlayerIdentityData(engine);
|
|
16
20
|
/** @public */ export const PointerEvents = /* @__PURE__ */ components.PointerEvents(engine);
|
|
17
21
|
/** @public */ export const PointerEventsResult = /* @__PURE__ */ components.PointerEventsResult(engine);
|
|
18
22
|
/** @public */ export const PointerLock = /* @__PURE__ */ components.PointerLock(engine);
|
|
@@ -4,6 +4,9 @@ import { PBAnimator } from './pb/decentraland/sdk/components/animator.gen';
|
|
|
4
4
|
import { PBAudioSource } from './pb/decentraland/sdk/components/audio_source.gen';
|
|
5
5
|
import { PBAudioStream } from './pb/decentraland/sdk/components/audio_stream.gen';
|
|
6
6
|
import { PBAvatarAttach } from './pb/decentraland/sdk/components/avatar_attach.gen';
|
|
7
|
+
import { PBAvatarBase } from './pb/decentraland/sdk/components/avatar_base.gen';
|
|
8
|
+
import { PBAvatarEmoteCommand } from './pb/decentraland/sdk/components/avatar_emote_command.gen';
|
|
9
|
+
import { PBAvatarEquippedData } from './pb/decentraland/sdk/components/avatar_equipped_data.gen';
|
|
7
10
|
import { PBAvatarModifierArea } from './pb/decentraland/sdk/components/avatar_modifier_area.gen';
|
|
8
11
|
import { PBAvatarShape } from './pb/decentraland/sdk/components/avatar_shape.gen';
|
|
9
12
|
import { PBBillboard } from './pb/decentraland/sdk/components/billboard.gen';
|
|
@@ -16,6 +19,7 @@ import { PBMaterial } from './pb/decentraland/sdk/components/material.gen';
|
|
|
16
19
|
import { PBMeshCollider } from './pb/decentraland/sdk/components/mesh_collider.gen';
|
|
17
20
|
import { PBMeshRenderer } from './pb/decentraland/sdk/components/mesh_renderer.gen';
|
|
18
21
|
import { PBNftShape } from './pb/decentraland/sdk/components/nft_shape.gen';
|
|
22
|
+
import { PBPlayerIdentityData } from './pb/decentraland/sdk/components/player_identity_data.gen';
|
|
19
23
|
import { PBPointerEvents } from './pb/decentraland/sdk/components/pointer_events.gen';
|
|
20
24
|
import { PBPointerEventsResult } from './pb/decentraland/sdk/components/pointer_events_result.gen';
|
|
21
25
|
import { PBPointerLock } from './pb/decentraland/sdk/components/pointer_lock.gen';
|
|
@@ -40,6 +44,9 @@ export * from './pb/decentraland/sdk/components/animator.gen';
|
|
|
40
44
|
export * from './pb/decentraland/sdk/components/audio_source.gen';
|
|
41
45
|
export * from './pb/decentraland/sdk/components/audio_stream.gen';
|
|
42
46
|
export * from './pb/decentraland/sdk/components/avatar_attach.gen';
|
|
47
|
+
export * from './pb/decentraland/sdk/components/avatar_base.gen';
|
|
48
|
+
export * from './pb/decentraland/sdk/components/avatar_emote_command.gen';
|
|
49
|
+
export * from './pb/decentraland/sdk/components/avatar_equipped_data.gen';
|
|
43
50
|
export * from './pb/decentraland/sdk/components/avatar_modifier_area.gen';
|
|
44
51
|
export * from './pb/decentraland/sdk/components/avatar_shape.gen';
|
|
45
52
|
export * from './pb/decentraland/sdk/components/billboard.gen';
|
|
@@ -52,6 +59,7 @@ export * from './pb/decentraland/sdk/components/material.gen';
|
|
|
52
59
|
export * from './pb/decentraland/sdk/components/mesh_collider.gen';
|
|
53
60
|
export * from './pb/decentraland/sdk/components/mesh_renderer.gen';
|
|
54
61
|
export * from './pb/decentraland/sdk/components/nft_shape.gen';
|
|
62
|
+
export * from './pb/decentraland/sdk/components/player_identity_data.gen';
|
|
55
63
|
export * from './pb/decentraland/sdk/components/pointer_events.gen';
|
|
56
64
|
export * from './pb/decentraland/sdk/components/pointer_events_result.gen';
|
|
57
65
|
export * from './pb/decentraland/sdk/components/pointer_lock.gen';
|
|
@@ -78,6 +86,9 @@ export type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<an
|
|
|
78
86
|
/** @public */ export declare const AudioSource: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAudioSource>>;
|
|
79
87
|
/** @public */ export declare const AudioStream: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAudioStream>>;
|
|
80
88
|
/** @public */ export declare const AvatarAttach: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAvatarAttach>>;
|
|
89
|
+
/** @public */ export declare const AvatarBase: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAvatarBase>>;
|
|
90
|
+
/** @public */ export declare const AvatarEmoteCommand: GSetComponentGetter<GrowOnlyValueSetComponentDefinition<PBAvatarEmoteCommand>>;
|
|
91
|
+
/** @public */ export declare const AvatarEquippedData: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAvatarEquippedData>>;
|
|
81
92
|
/** @public */ export declare const AvatarModifierArea: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAvatarModifierArea>>;
|
|
82
93
|
/** @public */ export declare const AvatarShape: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAvatarShape>>;
|
|
83
94
|
/** @public */ export declare const Billboard: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBBillboard>>;
|
|
@@ -90,6 +101,7 @@ export type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<an
|
|
|
90
101
|
/** @public */ export declare const MeshCollider: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshCollider>>;
|
|
91
102
|
/** @public */ export declare const MeshRenderer: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshRenderer>>;
|
|
92
103
|
/** @public */ export declare const NftShape: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBNftShape>>;
|
|
104
|
+
/** @public */ export declare const PlayerIdentityData: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPlayerIdentityData>>;
|
|
93
105
|
/** @public */ export declare const PointerEvents: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPointerEvents>>;
|
|
94
106
|
/** @public */ export declare const PointerEventsResult: GSetComponentGetter<GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>>;
|
|
95
107
|
/** @public */ export declare const PointerLock: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPointerLock>>;
|
|
@@ -116,6 +128,9 @@ export declare const componentDefinitionByName: {
|
|
|
116
128
|
"core::AudioSource": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAudioSource>>;
|
|
117
129
|
"core::AudioStream": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAudioStream>>;
|
|
118
130
|
"core::AvatarAttach": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAvatarAttach>>;
|
|
131
|
+
"core::AvatarBase": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAvatarBase>>;
|
|
132
|
+
"core::AvatarEmoteCommand": GSetComponentGetter<GrowOnlyValueSetComponentDefinition<PBAvatarEmoteCommand>>;
|
|
133
|
+
"core::AvatarEquippedData": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAvatarEquippedData>>;
|
|
119
134
|
"core::AvatarModifierArea": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAvatarModifierArea>>;
|
|
120
135
|
"core::AvatarShape": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBAvatarShape>>;
|
|
121
136
|
"core::Billboard": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBBillboard>>;
|
|
@@ -128,6 +143,7 @@ export declare const componentDefinitionByName: {
|
|
|
128
143
|
"core::MeshCollider": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshCollider>>;
|
|
129
144
|
"core::MeshRenderer": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshRenderer>>;
|
|
130
145
|
"core::NftShape": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBNftShape>>;
|
|
146
|
+
"core::PlayerIdentityData": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPlayerIdentityData>>;
|
|
131
147
|
"core::PointerEvents": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPointerEvents>>;
|
|
132
148
|
"core::PointerEventsResult": GSetComponentGetter<GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>>;
|
|
133
149
|
"core::PointerLock": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPointerLock>>;
|
|
@@ -2,6 +2,9 @@ import { AnimatorSchema } from './Animator.gen';
|
|
|
2
2
|
import { AudioSourceSchema } from './AudioSource.gen';
|
|
3
3
|
import { AudioStreamSchema } from './AudioStream.gen';
|
|
4
4
|
import { AvatarAttachSchema } from './AvatarAttach.gen';
|
|
5
|
+
import { AvatarBaseSchema } from './AvatarBase.gen';
|
|
6
|
+
import { AvatarEmoteCommandSchema } from './AvatarEmoteCommand.gen';
|
|
7
|
+
import { AvatarEquippedDataSchema } from './AvatarEquippedData.gen';
|
|
5
8
|
import { AvatarModifierAreaSchema } from './AvatarModifierArea.gen';
|
|
6
9
|
import { AvatarShapeSchema } from './AvatarShape.gen';
|
|
7
10
|
import { BillboardSchema } from './Billboard.gen';
|
|
@@ -14,6 +17,7 @@ import { MaterialSchema } from './Material.gen';
|
|
|
14
17
|
import { MeshColliderSchema } from './MeshCollider.gen';
|
|
15
18
|
import { MeshRendererSchema } from './MeshRenderer.gen';
|
|
16
19
|
import { NftShapeSchema } from './NftShape.gen';
|
|
20
|
+
import { PlayerIdentityDataSchema } from './PlayerIdentityData.gen';
|
|
17
21
|
import { PointerEventsSchema } from './PointerEvents.gen';
|
|
18
22
|
import { PointerEventsResultSchema } from './PointerEventsResult.gen';
|
|
19
23
|
import { PointerLockSchema } from './PointerLock.gen';
|
|
@@ -38,6 +42,9 @@ export * from './pb/decentraland/sdk/components/animator.gen';
|
|
|
38
42
|
export * from './pb/decentraland/sdk/components/audio_source.gen';
|
|
39
43
|
export * from './pb/decentraland/sdk/components/audio_stream.gen';
|
|
40
44
|
export * from './pb/decentraland/sdk/components/avatar_attach.gen';
|
|
45
|
+
export * from './pb/decentraland/sdk/components/avatar_base.gen';
|
|
46
|
+
export * from './pb/decentraland/sdk/components/avatar_emote_command.gen';
|
|
47
|
+
export * from './pb/decentraland/sdk/components/avatar_equipped_data.gen';
|
|
41
48
|
export * from './pb/decentraland/sdk/components/avatar_modifier_area.gen';
|
|
42
49
|
export * from './pb/decentraland/sdk/components/avatar_shape.gen';
|
|
43
50
|
export * from './pb/decentraland/sdk/components/billboard.gen';
|
|
@@ -50,6 +57,7 @@ export * from './pb/decentraland/sdk/components/material.gen';
|
|
|
50
57
|
export * from './pb/decentraland/sdk/components/mesh_collider.gen';
|
|
51
58
|
export * from './pb/decentraland/sdk/components/mesh_renderer.gen';
|
|
52
59
|
export * from './pb/decentraland/sdk/components/nft_shape.gen';
|
|
60
|
+
export * from './pb/decentraland/sdk/components/player_identity_data.gen';
|
|
53
61
|
export * from './pb/decentraland/sdk/components/pointer_events.gen';
|
|
54
62
|
export * from './pb/decentraland/sdk/components/pointer_events_result.gen';
|
|
55
63
|
export * from './pb/decentraland/sdk/components/pointer_lock.gen';
|
|
@@ -78,6 +86,14 @@ export * from './pb/decentraland/sdk/components/visibility_component.gen';
|
|
|
78
86
|
/* @__PURE__ */ engine.defineComponentFromSchema("core::AudioStream", AudioStreamSchema);
|
|
79
87
|
/** @public */ export const AvatarAttach = engine =>
|
|
80
88
|
/* @__PURE__ */ engine.defineComponentFromSchema("core::AvatarAttach", AvatarAttachSchema);
|
|
89
|
+
/** @public */ export const AvatarBase = engine =>
|
|
90
|
+
/* @__PURE__ */ engine.defineComponentFromSchema("core::AvatarBase", AvatarBaseSchema);
|
|
91
|
+
/** @public */ export const AvatarEmoteCommand = (engine) => /* @__PURE__ */ engine.defineValueSetComponentFromSchema("core::AvatarEmoteCommand", AvatarEmoteCommandSchema, {
|
|
92
|
+
timestampFunction: (t) => t.timestamp,
|
|
93
|
+
maxElements: 100
|
|
94
|
+
});
|
|
95
|
+
/** @public */ export const AvatarEquippedData = engine =>
|
|
96
|
+
/* @__PURE__ */ engine.defineComponentFromSchema("core::AvatarEquippedData", AvatarEquippedDataSchema);
|
|
81
97
|
/** @public */ export const AvatarModifierArea = engine =>
|
|
82
98
|
/* @__PURE__ */ engine.defineComponentFromSchema("core::AvatarModifierArea", AvatarModifierAreaSchema);
|
|
83
99
|
/** @public */ export const AvatarShape = engine =>
|
|
@@ -102,6 +118,8 @@ export * from './pb/decentraland/sdk/components/visibility_component.gen';
|
|
|
102
118
|
/* @__PURE__ */ engine.defineComponentFromSchema("core::MeshRenderer", MeshRendererSchema);
|
|
103
119
|
/** @public */ export const NftShape = engine =>
|
|
104
120
|
/* @__PURE__ */ engine.defineComponentFromSchema("core::NftShape", NftShapeSchema);
|
|
121
|
+
/** @public */ export const PlayerIdentityData = engine =>
|
|
122
|
+
/* @__PURE__ */ engine.defineComponentFromSchema("core::PlayerIdentityData", PlayerIdentityDataSchema);
|
|
105
123
|
/** @public */ export const PointerEvents = engine =>
|
|
106
124
|
/* @__PURE__ */ engine.defineComponentFromSchema("core::PointerEvents", PointerEventsSchema);
|
|
107
125
|
/** @public */ export const PointerEventsResult = (engine) => /* @__PURE__ */ engine.defineValueSetComponentFromSchema("core::PointerEventsResult", PointerEventsResultSchema, {
|
|
@@ -152,6 +170,9 @@ export const componentDefinitionByName = /* @__PURE__ */ {
|
|
|
152
170
|
"core::AudioSource": AudioSource,
|
|
153
171
|
"core::AudioStream": AudioStream,
|
|
154
172
|
"core::AvatarAttach": AvatarAttach,
|
|
173
|
+
"core::AvatarBase": AvatarBase,
|
|
174
|
+
"core::AvatarEmoteCommand": AvatarEmoteCommand,
|
|
175
|
+
"core::AvatarEquippedData": AvatarEquippedData,
|
|
155
176
|
"core::AvatarModifierArea": AvatarModifierArea,
|
|
156
177
|
"core::AvatarShape": AvatarShape,
|
|
157
178
|
"core::Billboard": Billboard,
|
|
@@ -164,6 +185,7 @@ export const componentDefinitionByName = /* @__PURE__ */ {
|
|
|
164
185
|
"core::MeshCollider": MeshCollider,
|
|
165
186
|
"core::MeshRenderer": MeshRenderer,
|
|
166
187
|
"core::NftShape": NftShape,
|
|
188
|
+
"core::PlayerIdentityData": PlayerIdentityData,
|
|
167
189
|
"core::PointerEvents": PointerEvents,
|
|
168
190
|
"core::PointerEventsResult": PointerEventsResult,
|
|
169
191
|
"core::PointerLock": PointerLock,
|
package/dist/components/generated/pb/decentraland/sdk/components/avatar_emote_command.gen.d.ts
CHANGED
|
@@ -7,14 +7,10 @@ import _m0 from "protobufjs/minimal";
|
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
9
|
export interface PBAvatarEmoteCommand {
|
|
10
|
-
emoteCommand: PBAvatarEmoteCommand_EmoteCommand | undefined;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export interface PBAvatarEmoteCommand_EmoteCommand {
|
|
16
10
|
emoteUrn: string;
|
|
17
11
|
loop: boolean;
|
|
12
|
+
/** monotonic counter */
|
|
13
|
+
timestamp: number;
|
|
18
14
|
}
|
|
19
15
|
/**
|
|
20
16
|
* @public
|
|
@@ -23,10 +19,3 @@ export declare namespace PBAvatarEmoteCommand {
|
|
|
23
19
|
function encode(message: PBAvatarEmoteCommand, writer?: _m0.Writer): _m0.Writer;
|
|
24
20
|
function decode(input: _m0.Reader | Uint8Array, length?: number): PBAvatarEmoteCommand;
|
|
25
21
|
}
|
|
26
|
-
/**
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
export declare namespace PBAvatarEmoteCommand_EmoteCommand {
|
|
30
|
-
function encode(message: PBAvatarEmoteCommand_EmoteCommand, writer?: _m0.Writer): _m0.Writer;
|
|
31
|
-
function decode(input: _m0.Reader | Uint8Array, length?: number): PBAvatarEmoteCommand_EmoteCommand;
|
|
32
|
-
}
|
package/dist/components/generated/pb/decentraland/sdk/components/avatar_emote_command.gen.js
CHANGED
|
@@ -2,51 +2,13 @@
|
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
3
|
const protobufPackageSarasa = "decentraland.sdk.components";
|
|
4
4
|
function createBasePBAvatarEmoteCommand() {
|
|
5
|
-
return {
|
|
5
|
+
return { emoteUrn: "", loop: false, timestamp: 0 };
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
10
|
export var PBAvatarEmoteCommand;
|
|
11
11
|
(function (PBAvatarEmoteCommand) {
|
|
12
|
-
function encode(message, writer = _m0.Writer.create()) {
|
|
13
|
-
if (message.emoteCommand !== undefined) {
|
|
14
|
-
PBAvatarEmoteCommand_EmoteCommand.encode(message.emoteCommand, writer.uint32(10).fork()).ldelim();
|
|
15
|
-
}
|
|
16
|
-
return writer;
|
|
17
|
-
}
|
|
18
|
-
PBAvatarEmoteCommand.encode = encode;
|
|
19
|
-
function decode(input, length) {
|
|
20
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
21
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
22
|
-
const message = createBasePBAvatarEmoteCommand();
|
|
23
|
-
while (reader.pos < end) {
|
|
24
|
-
const tag = reader.uint32();
|
|
25
|
-
switch (tag >>> 3) {
|
|
26
|
-
case 1:
|
|
27
|
-
if (tag !== 10) {
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
message.emoteCommand = PBAvatarEmoteCommand_EmoteCommand.decode(reader, reader.uint32());
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
reader.skipType(tag & 7);
|
|
37
|
-
}
|
|
38
|
-
return message;
|
|
39
|
-
}
|
|
40
|
-
PBAvatarEmoteCommand.decode = decode;
|
|
41
|
-
})(PBAvatarEmoteCommand || (PBAvatarEmoteCommand = {}));
|
|
42
|
-
function createBasePBAvatarEmoteCommand_EmoteCommand() {
|
|
43
|
-
return { emoteUrn: "", loop: false };
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* @public
|
|
47
|
-
*/
|
|
48
|
-
export var PBAvatarEmoteCommand_EmoteCommand;
|
|
49
|
-
(function (PBAvatarEmoteCommand_EmoteCommand) {
|
|
50
12
|
function encode(message, writer = _m0.Writer.create()) {
|
|
51
13
|
if (message.emoteUrn !== "") {
|
|
52
14
|
writer.uint32(10).string(message.emoteUrn);
|
|
@@ -54,13 +16,16 @@ export var PBAvatarEmoteCommand_EmoteCommand;
|
|
|
54
16
|
if (message.loop === true) {
|
|
55
17
|
writer.uint32(16).bool(message.loop);
|
|
56
18
|
}
|
|
19
|
+
if (message.timestamp !== 0) {
|
|
20
|
+
writer.uint32(24).uint32(message.timestamp);
|
|
21
|
+
}
|
|
57
22
|
return writer;
|
|
58
23
|
}
|
|
59
|
-
|
|
24
|
+
PBAvatarEmoteCommand.encode = encode;
|
|
60
25
|
function decode(input, length) {
|
|
61
26
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
62
27
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
63
|
-
const message =
|
|
28
|
+
const message = createBasePBAvatarEmoteCommand();
|
|
64
29
|
while (reader.pos < end) {
|
|
65
30
|
const tag = reader.uint32();
|
|
66
31
|
switch (tag >>> 3) {
|
|
@@ -76,6 +41,12 @@ export var PBAvatarEmoteCommand_EmoteCommand;
|
|
|
76
41
|
}
|
|
77
42
|
message.loop = reader.bool();
|
|
78
43
|
continue;
|
|
44
|
+
case 3:
|
|
45
|
+
if (tag !== 24) {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
message.timestamp = reader.uint32();
|
|
49
|
+
continue;
|
|
79
50
|
}
|
|
80
51
|
if ((tag & 7) === 4 || tag === 0) {
|
|
81
52
|
break;
|
|
@@ -84,5 +55,5 @@ export var PBAvatarEmoteCommand_EmoteCommand;
|
|
|
84
55
|
}
|
|
85
56
|
return message;
|
|
86
57
|
}
|
|
87
|
-
|
|
88
|
-
})(
|
|
58
|
+
PBAvatarEmoteCommand.decode = decode;
|
|
59
|
+
})(PBAvatarEmoteCommand || (PBAvatarEmoteCommand = {}));
|
package/dist/components/generated/pb/decentraland/sdk/components/avatar_equipped_data.gen.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
3
|
const protobufPackageSarasa = "decentraland.sdk.components";
|
|
4
4
|
function createBasePBAvatarEquippedData() {
|
|
5
|
-
return { wearableUrns: [],
|
|
5
|
+
return { wearableUrns: [], emoteUrns: [] };
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* @public
|
|
@@ -13,7 +13,7 @@ export var PBAvatarEquippedData;
|
|
|
13
13
|
for (const v of message.wearableUrns) {
|
|
14
14
|
writer.uint32(10).string(v);
|
|
15
15
|
}
|
|
16
|
-
for (const v of message.
|
|
16
|
+
for (const v of message.emoteUrns) {
|
|
17
17
|
writer.uint32(18).string(v);
|
|
18
18
|
}
|
|
19
19
|
return writer;
|
|
@@ -36,7 +36,7 @@ export var PBAvatarEquippedData;
|
|
|
36
36
|
if (tag !== 18) {
|
|
37
37
|
break;
|
|
38
38
|
}
|
|
39
|
-
message.
|
|
39
|
+
message.emoteUrns.push(reader.string());
|
|
40
40
|
continue;
|
|
41
41
|
}
|
|
42
42
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -64,6 +64,12 @@ export interface BaseComponent<T> {
|
|
|
64
64
|
* @returns
|
|
65
65
|
*/
|
|
66
66
|
get(entity: Entity): any;
|
|
67
|
+
/**
|
|
68
|
+
* @public
|
|
69
|
+
* Triggers the callback if the entity has changed on the last tick.
|
|
70
|
+
* If the value is undefined, the component was deleted.
|
|
71
|
+
*/
|
|
72
|
+
onChange(entity: Entity, cb: (value: T | undefined) => void): void;
|
|
67
73
|
}
|
|
68
74
|
/**
|
|
69
75
|
* @public
|
package/dist/engine/entity.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ export type Entity = number & {
|
|
|
21
21
|
* This first 512 entities are reserved by the renderer
|
|
22
22
|
*/
|
|
23
23
|
export declare const RESERVED_STATIC_ENTITIES = 512;
|
|
24
|
-
export declare const RESERVED_LOCAL_ENTITIES = 65535;
|
|
25
24
|
/**
|
|
26
25
|
* @public
|
|
27
26
|
*/
|
|
@@ -54,9 +53,9 @@ export declare enum EntityState {
|
|
|
54
53
|
Reserved = 3
|
|
55
54
|
}
|
|
56
55
|
/**
|
|
57
|
-
* @
|
|
56
|
+
* @public
|
|
58
57
|
*/
|
|
59
|
-
export type
|
|
58
|
+
export type IEntityContainer = {
|
|
60
59
|
generateEntity(networked?: boolean): Entity;
|
|
61
60
|
removeEntity(entity: Entity): boolean;
|
|
62
61
|
getEntityState(entity: Entity): EntityState;
|
|
@@ -64,5 +63,10 @@ export type EntityContainer = {
|
|
|
64
63
|
releaseRemovedEntities(): Entity[];
|
|
65
64
|
updateRemovedEntity(entity: Entity): boolean;
|
|
66
65
|
updateUsedEntity(entity: Entity): boolean;
|
|
67
|
-
setNetworkEntitiesRange(reservedLocalEntities: number, range: [number, number]): void;
|
|
68
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
export declare function createEntityContainer(opts?: {
|
|
71
|
+
reservedStaticEntities: number;
|
|
72
|
+
}): IEntityContainer;
|
package/dist/engine/entity.js
CHANGED
|
@@ -17,8 +17,6 @@ export const MAX_ENTITY_NUMBER = MAX_U16;
|
|
|
17
17
|
* This first 512 entities are reserved by the renderer
|
|
18
18
|
*/
|
|
19
19
|
export const RESERVED_STATIC_ENTITIES = 512;
|
|
20
|
-
// Max amount of local entities that can be created
|
|
21
|
-
export const RESERVED_LOCAL_ENTITIES = MAX_ENTITY_NUMBER;
|
|
22
20
|
/**
|
|
23
21
|
* @public
|
|
24
22
|
*/
|
|
@@ -59,35 +57,20 @@ export var EntityState;
|
|
|
59
57
|
EntityState[EntityState["Reserved"] = 3] = "Reserved";
|
|
60
58
|
})(EntityState || (EntityState = {}));
|
|
61
59
|
/**
|
|
62
|
-
* @
|
|
60
|
+
* @public
|
|
63
61
|
*/
|
|
64
|
-
export function
|
|
62
|
+
export function createEntityContainer(opts) {
|
|
63
|
+
const reservedStaticEntities = opts?.reservedStaticEntities ?? RESERVED_STATIC_ENTITIES;
|
|
65
64
|
// Local entities counter
|
|
66
|
-
let entityCounter =
|
|
67
|
-
// Network entities counter
|
|
68
|
-
let networkEntityCounter;
|
|
69
|
-
// Network entities range that can be created by the user
|
|
70
|
-
let networkedEntitiesRange;
|
|
65
|
+
let entityCounter = reservedStaticEntities;
|
|
71
66
|
const usedEntities = new Set();
|
|
72
67
|
let toRemoveEntities = [];
|
|
73
68
|
const removedEntities = createVersionGSet();
|
|
74
|
-
|
|
75
|
-
function setNetworkEntitiesRange(reservedLocalEntities, range) {
|
|
76
|
-
localEntitiesAvailable = reservedLocalEntities;
|
|
77
|
-
networkedEntitiesRange = range;
|
|
78
|
-
networkEntityCounter = range[0];
|
|
79
|
-
}
|
|
80
|
-
function generateNewEntity(networked) {
|
|
69
|
+
function generateNewEntity() {
|
|
81
70
|
if (entityCounter > MAX_ENTITY_NUMBER - 1) {
|
|
82
71
|
throw new Error(`It fails trying to generate an entity out of range ${MAX_ENTITY_NUMBER}.`);
|
|
83
72
|
}
|
|
84
|
-
|
|
85
|
-
throw new Error(`Max amount of network entities reached ${networkedEntitiesRange[1]} `);
|
|
86
|
-
}
|
|
87
|
-
if (!networked && entityCounter >= localEntitiesAvailable) {
|
|
88
|
-
throw new Error(`Max amount of local entities reached ${localEntitiesAvailable}`);
|
|
89
|
-
}
|
|
90
|
-
const entityNumber = networked ? networkEntityCounter++ : entityCounter++;
|
|
73
|
+
const entityNumber = entityCounter++;
|
|
91
74
|
const entityVersion = removedEntities.getMap().has(entityNumber)
|
|
92
75
|
? removedEntities.getMap().get(entityNumber) + 1
|
|
93
76
|
: 0;
|
|
@@ -98,31 +81,14 @@ export function EntityContainer() {
|
|
|
98
81
|
usedEntities.add(entity);
|
|
99
82
|
return entity;
|
|
100
83
|
}
|
|
101
|
-
function generateEntity(
|
|
102
|
-
|
|
103
|
-
throw new Error('Network entities ranged not initialized. Connect to a CRDT Server');
|
|
104
|
-
}
|
|
105
|
-
const usedNetworkSize = (networkedEntitiesRange &&
|
|
106
|
-
[...usedEntities.values()].filter(($) => {
|
|
107
|
-
const [entityId] = EntityUtils.fromEntityId($);
|
|
108
|
-
return entityId >= networkedEntitiesRange[0] && entityId <= networkedEntitiesRange[1];
|
|
109
|
-
}).length) ??
|
|
110
|
-
0;
|
|
111
|
-
const usedSize = usedEntities.size - usedNetworkSize;
|
|
112
|
-
// If all entities until `entityCounter` are being used, we need to generate another one
|
|
113
|
-
if (!networked && usedSize + RESERVED_STATIC_ENTITIES >= entityCounter) {
|
|
114
|
-
return generateNewEntity(networked);
|
|
115
|
-
}
|
|
84
|
+
function generateEntity() {
|
|
85
|
+
const usedSize = usedEntities.size;
|
|
116
86
|
// If all entities until `entityCounter` are being used, we need to generate another one
|
|
117
|
-
if (
|
|
118
|
-
return generateNewEntity(
|
|
87
|
+
if (usedSize + reservedStaticEntities >= entityCounter) {
|
|
88
|
+
return generateNewEntity();
|
|
119
89
|
}
|
|
120
90
|
for (const [number, version] of removedEntities.getMap()) {
|
|
121
91
|
if (version < MAX_U16) {
|
|
122
|
-
if (networked && (number < networkedEntitiesRange[0] || number > networkedEntitiesRange[1]))
|
|
123
|
-
continue;
|
|
124
|
-
if (!networked && number >= localEntitiesAvailable)
|
|
125
|
-
continue;
|
|
126
92
|
const entity = EntityUtils.toEntityId(number, version + 1);
|
|
127
93
|
// If the entity is not being used, we can re-use it
|
|
128
94
|
// If the entity was removed in this tick, we're not counting for the usedEntities, but we have it in the toRemoveEntityArray
|
|
@@ -132,10 +98,10 @@ export function EntityContainer() {
|
|
|
132
98
|
}
|
|
133
99
|
}
|
|
134
100
|
}
|
|
135
|
-
return generateNewEntity(
|
|
101
|
+
return generateNewEntity();
|
|
136
102
|
}
|
|
137
103
|
function removeEntity(entity) {
|
|
138
|
-
if (entity <
|
|
104
|
+
if (entity < reservedStaticEntities)
|
|
139
105
|
return false;
|
|
140
106
|
if (usedEntities.has(entity)) {
|
|
141
107
|
usedEntities.delete(entity);
|
|
@@ -184,7 +150,7 @@ export function EntityContainer() {
|
|
|
184
150
|
}
|
|
185
151
|
function getEntityState(entity) {
|
|
186
152
|
const [n, v] = EntityUtils.fromEntityId(entity);
|
|
187
|
-
if (n <
|
|
153
|
+
if (n < reservedStaticEntities) {
|
|
188
154
|
return EntityState.Reserved;
|
|
189
155
|
}
|
|
190
156
|
if (usedEntities.has(entity)) {
|
|
@@ -197,7 +163,6 @@ export function EntityContainer() {
|
|
|
197
163
|
return EntityState.Unknown;
|
|
198
164
|
}
|
|
199
165
|
return {
|
|
200
|
-
setNetworkEntitiesRange,
|
|
201
166
|
generateEntity,
|
|
202
167
|
removeEntity,
|
|
203
168
|
getExistingEntities() {
|
|
@@ -21,6 +21,7 @@ export function createValueSetComponentDefinitionFromSchema(componentName, compo
|
|
|
21
21
|
const data = new Map();
|
|
22
22
|
const dirtyIterator = new Set();
|
|
23
23
|
const queuedCommands = [];
|
|
24
|
+
const onChangeCallbacks = new Map();
|
|
24
25
|
// only sort the array if the latest (N) element has a timestamp <= N-1
|
|
25
26
|
function shouldSort(row) {
|
|
26
27
|
const len = row.raw.length;
|
|
@@ -123,7 +124,8 @@ export function createValueSetComponentDefinitionFromSchema(componentName, compo
|
|
|
123
124
|
updateFromCrdt(_body) {
|
|
124
125
|
if (_body.type === CrdtMessageType.APPEND_VALUE) {
|
|
125
126
|
const buf = new ReadWriteByteBuffer(_body.data);
|
|
126
|
-
append(_body.entityId, schema.deserialize(buf));
|
|
127
|
+
const { value } = append(_body.entityId, schema.deserialize(buf));
|
|
128
|
+
return [null, value];
|
|
127
129
|
}
|
|
128
130
|
return [null, undefined];
|
|
129
131
|
},
|
|
@@ -137,6 +139,12 @@ export function createValueSetComponentDefinitionFromSchema(componentName, compo
|
|
|
137
139
|
AppendValueOperation.write(entity, 0, componentId, buf.toBinary(), buffer);
|
|
138
140
|
}
|
|
139
141
|
}
|
|
142
|
+
},
|
|
143
|
+
onChange(entity, cb) {
|
|
144
|
+
onChangeCallbacks.set(entity, cb);
|
|
145
|
+
},
|
|
146
|
+
__onChangeCallbacks(entity) {
|
|
147
|
+
return onChangeCallbacks.get(entity);
|
|
140
148
|
}
|
|
141
149
|
};
|
|
142
150
|
return ret;
|
package/dist/engine/index.js
CHANGED
|
@@ -4,15 +4,16 @@ import { checkNotThenable } from '../runtime/invariant';
|
|
|
4
4
|
import { Schemas } from '../schemas';
|
|
5
5
|
import { crdtSceneSystem } from '../systems/crdt';
|
|
6
6
|
import { createComponentDefinitionFromSchema } from './lww-element-set-component-definition';
|
|
7
|
-
import {
|
|
7
|
+
import { createEntityContainer } from './entity';
|
|
8
8
|
import { SystemContainer, SYSTEMS_REGULAR_PRIORITY } from './systems';
|
|
9
9
|
import { createValueSetComponentDefinitionFromSchema } from './grow-only-value-set-component-definition';
|
|
10
10
|
import { removeEntityWithChildren as removeEntityWithChildrenEngine } from '../runtime/helpers/tree';
|
|
11
|
+
import { CrdtMessageType } from '../serialization/crdt';
|
|
11
12
|
export * from './input';
|
|
12
13
|
export * from './readonly';
|
|
13
14
|
export * from './types';
|
|
14
|
-
function preEngine() {
|
|
15
|
-
const entityContainer =
|
|
15
|
+
function preEngine(options) {
|
|
16
|
+
const entityContainer = options?.entityContainer ?? createEntityContainer();
|
|
16
17
|
const componentsDefinition = new Map();
|
|
17
18
|
const systems = SystemContainer();
|
|
18
19
|
let sealed = false;
|
|
@@ -28,8 +29,9 @@ function preEngine() {
|
|
|
28
29
|
}
|
|
29
30
|
function removeEntity(entity) {
|
|
30
31
|
for (const [, component] of componentsDefinition) {
|
|
31
|
-
// TODO: hack for the moment.
|
|
32
|
-
//
|
|
32
|
+
// TODO: hack for the moment.
|
|
33
|
+
// We still need the NetworkEntity to forward this message to the SyncTransport.
|
|
34
|
+
// If we remove it then we can't notify the other users which entity was deleted.
|
|
33
35
|
if (component.componentName === 'core-schema::Network-Entity')
|
|
34
36
|
continue;
|
|
35
37
|
component.entityDeleted(entity, true);
|
|
@@ -130,8 +132,8 @@ function preEngine() {
|
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
134
|
function getEntityOrNullByName(value) {
|
|
133
|
-
const
|
|
134
|
-
for (const [entity, name] of getEntitiesWith(
|
|
135
|
+
const NameComponent = components.Name({ defineComponent });
|
|
136
|
+
for (const [entity, name] of getEntitiesWith(NameComponent)) {
|
|
135
137
|
if (name.value === value)
|
|
136
138
|
return entity;
|
|
137
139
|
}
|
|
@@ -197,8 +199,25 @@ function preEngine() {
|
|
|
197
199
|
* @deprecated Prevent manual usage prefer "engine" for scene development
|
|
198
200
|
*/
|
|
199
201
|
export function Engine(options) {
|
|
200
|
-
const partialEngine = preEngine();
|
|
201
|
-
const
|
|
202
|
+
const partialEngine = preEngine(options);
|
|
203
|
+
const onChangeFunction = (entity, operation, component, componentValue) => {
|
|
204
|
+
if (operation === CrdtMessageType.DELETE_ENTITY) {
|
|
205
|
+
for (const component of partialEngine.componentsIter()) {
|
|
206
|
+
const onChange = component?.__onChangeCallbacks(entity);
|
|
207
|
+
if (onChange) {
|
|
208
|
+
onChange(undefined);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
const onChange = component?.__onChangeCallbacks(entity);
|
|
214
|
+
if (onChange) {
|
|
215
|
+
onChange(componentValue);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return options?.onChangeFunction(entity, operation, component, componentValue);
|
|
219
|
+
};
|
|
220
|
+
const crdtSystem = crdtSceneSystem(partialEngine, onChangeFunction);
|
|
202
221
|
async function update(dt) {
|
|
203
222
|
await crdtSystem.receiveMessages();
|
|
204
223
|
for (const system of partialEngine.getSystems()) {
|