| | 1 | | using System; |
| | 2 | | using DCL.ECSRuntime; |
| | 3 | | using DCL.ECS7; |
| | 4 | | using DCLPlugins.ECSComponents; |
| | 5 | |
|
| | 6 | | namespace DCL.ECSComponents |
| | 7 | | { |
| | 8 | | public class ECS7ComponentsComposer : IDisposable |
| | 9 | | { |
| | 10 | | private readonly TransformRegister transformRegister; |
| | 11 | | private readonly SphereShapeRegister sphereShapeRegister; |
| | 12 | | private readonly BoxShapeRegister boxShapeRegister; |
| | 13 | | private readonly PlaneShapeRegister planeShapeRegister; |
| | 14 | | private readonly CylinderShapeRegister cylinderShapeRegister; |
| | 15 | | private readonly AudioStreamRegister audioStreamRegister; |
| | 16 | | private readonly AudioSourceRegister audioSourceRegister; |
| | 17 | | private readonly GLTFShapeRegister gltfRegister; |
| | 18 | | private readonly ECSTextShapeRegister textShapeRegister; |
| | 19 | | private readonly NFTShapeRegister nftRegister; |
| | 20 | | private readonly OnPointerDownRegister pointerDownRegister; |
| | 21 | | private readonly OnPointerUpRegister pointerUpRegister; |
| | 22 | | private readonly AnimatorRegister animatorRegister; |
| | 23 | | private readonly BillboardRegister billboardRegister; |
| | 24 | | private readonly CameraModeAreaRegister cameraModeAreaRegister; |
| | 25 | | private readonly AvatarModifierAreaRegister avatarModifierAreaRegister; |
| | 26 | | private readonly AvatarAttachRegister avatarAttachRegister; |
| | 27 | |
|
| | 28 | | // Those components are only here to serialize over the wire, we don't need a handler for these |
| | 29 | | private readonly OnPointerDownResultRegister pointerDownResultRegister; |
| | 30 | | private readonly OnPointerUpResultRegister pointerUpResultRegister; |
| | 31 | |
|
| 0 | 32 | | public ECS7ComponentsComposer(ECSComponentsFactory componentsFactory, IECSComponentWriter componentsWriter) |
| | 33 | | { |
| 0 | 34 | | transformRegister = new TransformRegister(ComponentID.TRANSFORM, componentsFactory, componentsWriter); |
| 0 | 35 | | sphereShapeRegister = new SphereShapeRegister(ComponentID.SPHERE_SHAPE, componentsFactory, componentsWriter) |
| 0 | 36 | | boxShapeRegister = new BoxShapeRegister(ComponentID.BOX_SHAPE, componentsFactory, componentsWriter); |
| 0 | 37 | | planeShapeRegister = new PlaneShapeRegister(ComponentID.PLANE_SHAPE, componentsFactory, componentsWriter); |
| 0 | 38 | | cylinderShapeRegister = new CylinderShapeRegister(ComponentID.CYLINDER_SHAPE, componentsFactory, componentsW |
| 0 | 39 | | audioStreamRegister = new AudioStreamRegister(ComponentID.AUDIO_STREAM, componentsFactory, componentsWriter) |
| 0 | 40 | | audioSourceRegister = new AudioSourceRegister(ComponentID.AUDIO_SOURCE, componentsFactory, componentsWriter) |
| 0 | 41 | | nftRegister = new NFTShapeRegister(ComponentID.NFT_SHAPE, componentsFactory, componentsWriter); |
| 0 | 42 | | textShapeRegister = new ECSTextShapeRegister(ComponentID.TEXT_SHAPE, componentsFactory, componentsWriter); |
| 0 | 43 | | gltfRegister = new GLTFShapeRegister(ComponentID.GLTF_SHAPE, componentsFactory, componentsWriter); |
| 0 | 44 | | pointerDownRegister = new OnPointerDownRegister(ComponentID.ON_POINTER_DOWN, componentsFactory, componentsWr |
| 0 | 45 | | pointerUpRegister = new OnPointerUpRegister(ComponentID.ON_POINTER_UP, componentsFactory, componentsWriter); |
| 0 | 46 | | animatorRegister = new AnimatorRegister(ComponentID.ANIMATOR, componentsFactory, componentsWriter); |
| 0 | 47 | | billboardRegister = new BillboardRegister(ComponentID.BILLBOARD, componentsFactory, componentsWriter); |
| 0 | 48 | | avatarAttachRegister = new AvatarAttachRegister(ComponentID.AVATAR_ATTACH, componentsFactory, componentsWrit |
| 0 | 49 | | avatarModifierAreaRegister = new AvatarModifierAreaRegister(ComponentID.AVATAR_MODIFIER_AREA, componentsFact |
| 0 | 50 | | cameraModeAreaRegister = new CameraModeAreaRegister(ComponentID.CAMERA_MODE_AREA, componentsFactory, compone |
| | 51 | |
|
| | 52 | | // Components without a handler |
| 0 | 53 | | pointerDownResultRegister = new OnPointerDownResultRegister(ComponentID.ON_POINTER_DOWN_RESULT, componentsFa |
| 0 | 54 | | pointerUpResultRegister = new OnPointerUpResultRegister(ComponentID.ON_POINTER_UP_RESULT, componentsFactory, |
| 0 | 55 | | } |
| | 56 | |
|
| | 57 | | public void Dispose() |
| | 58 | | { |
| 0 | 59 | | transformRegister.Dispose(); |
| 0 | 60 | | sphereShapeRegister.Dispose(); |
| 0 | 61 | | boxShapeRegister.Dispose(); |
| 0 | 62 | | billboardRegister.Dispose(); |
| 0 | 63 | | planeShapeRegister.Dispose(); |
| 0 | 64 | | cylinderShapeRegister.Dispose(); |
| 0 | 65 | | audioStreamRegister.Dispose(); |
| 0 | 66 | | audioSourceRegister.Dispose(); |
| 0 | 67 | | textShapeRegister.Dispose(); |
| 0 | 68 | | nftRegister.Dispose(); |
| 0 | 69 | | gltfRegister.Dispose(); |
| 0 | 70 | | animatorRegister.Dispose(); |
| 0 | 71 | | avatarAttachRegister.Dispose(); |
| 0 | 72 | | avatarModifierAreaRegister.Dispose(); |
| 0 | 73 | | pointerDownRegister.Dispose(); |
| 0 | 74 | | pointerUpRegister.Dispose(); |
| 0 | 75 | | cameraModeAreaRegister.Dispose(); |
| | 76 | |
|
| | 77 | | // Components without a handler |
| 0 | 78 | | pointerDownResultRegister.Dispose(); |
| 0 | 79 | | pointerUpResultRegister.Dispose(); |
| 0 | 80 | | } |
| | 81 | | } |
| | 82 | | } |