Exemple #1
0
            public override void AcknowledgeAuthorityLoss(NativeArray <ArchetypeChunk> chunkArray, ComponentSystemBase system,
                                                          ComponentUpdateSystem updateSystem)
            {
                var authorityLossType = system.GetArchetypeChunkComponentType <AuthorityLossImminent <Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFields.Component> >();
                var spatialEntityType = system.GetArchetypeChunkComponentType <SpatialEntityId>();

                foreach (var chunk in chunkArray)
                {
                    var authorityArray       = chunk.GetNativeArray(authorityLossType);
                    var spatialEntityIdArray = chunk.GetNativeArray(spatialEntityType);

                    for (int i = 0; i < authorityArray.Length; ++i)
                    {
                        if (authorityArray[i].AcknowledgeAuthorityLoss)
                        {
                            updateSystem.AcknowledgeAuthorityLoss(spatialEntityIdArray[i].EntityId,
                                                                  1003);
                        }
                    }
                }
            }
            public override void AcknowledgeAuthorityLoss(NativeArray <ArchetypeChunk> chunkArray, ComponentSystemBase system,
                                                          ComponentUpdateSystem updateSystem)
            {
                var authorityLossType = system.GetArchetypeChunkComponentType <AuthorityLossImminent <global::Improbable.TestSchema.ExhaustiveSingular.Component> >();
                var spatialEntityType = system.GetArchetypeChunkComponentType <SpatialEntityId>();

                foreach (var chunk in chunkArray)
                {
                    var authorityArray       = chunk.GetNativeArray(authorityLossType);
                    var spatialEntityIdArray = chunk.GetNativeArray(spatialEntityType);

                    for (int i = 0; i < authorityArray.Length; ++i)
                    {
                        if (authorityArray[i].AcknowledgeAuthorityLoss)
                        {
                            updateSystem.AcknowledgeAuthorityLoss(spatialEntityIdArray[i].EntityId,
                                                                  197715);
                        }
                    }
                }
            }
Exemple #3
0
            public override void AcknowledgeAuthorityLoss(NativeArray <ArchetypeChunk> chunkArray, ComponentSystemBase system,
                                                          ComponentUpdateSystem updateSystem)
            {
                var authorityLossType = system.GetArchetypeChunkComponentType <AuthorityLossImminent <Improbable.PlayerLifecycle.PlayerHeartbeatClient.Component> >();
                var spatialEntityType = system.GetArchetypeChunkComponentType <SpatialEntityId>();

                foreach (var chunk in chunkArray)
                {
                    var authorityArray       = chunk.GetNativeArray(authorityLossType);
                    var spatialEntityIdArray = chunk.GetNativeArray(spatialEntityType);

                    for (int i = 0; i < authorityArray.Length; ++i)
                    {
                        if (authorityArray[i].AcknowledgeAuthorityLoss)
                        {
                            updateSystem.AcknowledgeAuthorityLoss(spatialEntityIdArray[i].EntityId,
                                                                  13001);
                        }
                    }
                }
            }
Exemple #4
0
        protected override void OnCreate()
        {
            base.OnCreate();

            updateSystem = World.GetExistingSystem <ComponentUpdateSystem>();

            initBaseComponentTypes = new[]
            {
                ComponentType.ReadWrite <KinematicStateWhenAuth>(),
                ComponentType.ReadOnly <NewlyAddedSpatialOSEntity>(),
                ComponentType.ReadOnly <TransformInternal.ComponentAuthority>()
            };

            authBaseComponentTypes = new[]
            {
                ComponentType.ReadWrite <KinematicStateWhenAuth>(),
                ComponentType.ReadOnly <SpatialEntityId>(),
            };

            RegisterTransformSyncType(new RigidbodyTransformSync());
        }
        protected override void OnCreateManager()
        {
            base.OnCreateManager();

            updateSystem = World.GetExistingManager <ComponentUpdateSystem>();

            newEntityGroup = GetComponentGroup(
                ComponentType.Create <KinematicStateWhenAuth>(),
                ComponentType.ReadOnly <Rigidbody>(),
                ComponentType.ReadOnly <NewlyAddedSpatialOSEntity>(),
                ComponentType.ReadOnly <TransformInternal.ComponentAuthority>()
                );
            newEntityGroup.SetFilter(TransformInternal.ComponentAuthority.NotAuthoritative);

            authChangeGroup = GetComponentGroup(
                ComponentType.Create <KinematicStateWhenAuth>(),
                ComponentType.ReadOnly <Rigidbody>(),
                ComponentType.ReadOnly <SpatialEntityId>(),
                ComponentType.Subtractive <NewlyAddedSpatialOSEntity>()
                );
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            updateSystem = World.GetExistingSystem <ComponentUpdateSystem>();

            interpolationGroup = GetEntityQuery(new EntityQueryDesc
            {
                All = new[]
                {
                    ComponentType.ReadWrite <BufferedTransform>(),
                    ComponentType.ReadWrite <DeferredUpdateTransform>(),
                    ComponentType.ReadOnly <TransformInternal.Component>(),
                    ComponentType.ReadOnly <SpatialEntityId>(),
                    ComponentType.ReadOnly <InterpolationConfig>(),
                },
                None = new[]
                {
                    ComponentType.ReadOnly <TransformInternal.HasAuthority>()
                }
            });
        }
Exemple #7
0
        protected override void OnCreate()
        {
            base.OnCreate();

            worker       = World.GetExistingSystem <WorkerSystem>();
            updateSystem = World.GetExistingSystem <ComponentUpdateSystem>();

            transformGroup = GetEntityQuery(new EntityQueryDesc
            {
                All = new[]
                {
                    ComponentType.ReadWrite <TransformToSet>(),
                    ComponentType.ReadOnly <TransformInternal.Component>(),
                    ComponentType.ReadOnly <SpatialEntityId>(),
                    ComponentType.ReadOnly <DirectReceiveTag>(),
                },
                None = new[]
                {
                    ComponentType.ReadOnly <TransformInternal.HasAuthority>()
                }
            });
        }
Exemple #8
0
        protected override void OnCreate()
        {
            base.OnCreate();

            workerSystem          = World.GetExistingSystem <WorkerSystem>();
            componentUpdateSystem = World.GetExistingSystem <ComponentUpdateSystem>();
            commandSystem         = World.GetExistingSystem <CommandSystem>();

            initGroup = GetEntityQuery(
                ComponentType.ReadOnly <HealthRegenComponent.Component>(),
                ComponentType.Exclude <HealthRegenData>(),
                ComponentType.ReadOnly <HealthComponent.HasAuthority>()
                );

            regenGroup = GetEntityQuery(
                ComponentType.ReadWrite <HealthRegenComponent.Component>(),
                ComponentType.ReadWrite <HealthRegenData>(),
                ComponentType.ReadOnly <HealthComponent.Component>(),
                ComponentType.ReadOnly <SpatialEntityId>(),
                ComponentType.ReadOnly <HealthComponent.HasAuthority>()
                );
        }
Exemple #9
0
            public void SendUpdates(
                NativeArray <ArchetypeChunk> chunkArray,
                ComponentSystemBase system,
                EntityManager entityManager,
                ComponentUpdateSystem componentUpdateSystem)
            {
                using (componentMarker.Auto())
                {
                    var spatialOSEntityType = system.GetArchetypeChunkComponentType <SpatialEntityId>(true);
                    var componentType       = system.GetArchetypeChunkComponentType <global::Improbable.Tests.DependencyTestGrandchild.Component>();

                    foreach (var chunk in chunkArray)
                    {
                        var entityIdArray  = chunk.GetNativeArray(spatialOSEntityType);
                        var componentArray = chunk.GetNativeArray(componentType);

                        for (var i = 0; i < componentArray.Length; i++)
                        {
                            var data = componentArray[i];

                            if (data.IsDataDirty())
                            {
                                var update = new Update();

                                if (data.IsDataDirty(0))
                                {
                                    update.Grandchild = data.Grandchild;
                                }

                                componentUpdateSystem.SendUpdate(in update, entityIdArray[i].EntityId);
                                data.MarkDataClean();
                                componentArray[i] = data;
                            }
                        }
                    }
                }
            }
Exemple #10
0
        protected override void OnCreate()
        {
            base.OnCreate();

            worker       = World.GetExistingSystem <WorkerSystem>();
            updateSystem = World.GetExistingSystem <ComponentUpdateSystem>();

            baseComponentTypes = new[]
            {
                ComponentType.ReadOnly <TransformInternal.Component>(),
                ComponentType.ReadOnly <SpatialEntityId>(),
                ComponentType.ReadWrite <TicksSinceLastTransformUpdate>(),
                ComponentType.ReadWrite <BufferedTransform>(),
            };

            baseExcludeComponentTypes = new[]
            {
                ComponentType.ReadOnly <NewlyAddedSpatialOSEntity>()
            };

            UpdateTransformQuery();

            RegisterTransformSyncType(new RigidbodyTransformSync());
        }
        protected override void OnCreateManager()
        {
            base.OnCreateManager();

            workerSystem          = World.GetExistingManager <WorkerSystem>();
            componentUpdateSystem = World.GetExistingManager <ComponentUpdateSystem>();
            commandSystem         = World.GetExistingManager <CommandSystem>();

            initGroup = GetComponentGroup(
                ComponentType.ReadOnly <HealthRegenComponent.Component>(),
                ComponentType.Subtractive <HealthRegenData>(),
                ComponentType.ReadOnly <HealthComponent.ComponentAuthority>()
                );
            initGroup.SetFilter(HealthComponent.ComponentAuthority.Authoritative);

            regenGroup = GetComponentGroup(
                ComponentType.Create <HealthRegenComponent.Component>(),
                ComponentType.Create <HealthRegenData>(),
                ComponentType.ReadOnly <HealthComponent.Component>(),
                ComponentType.ReadOnly <SpatialEntityId>(),
                ComponentType.ReadOnly <HealthComponent.ComponentAuthority>()
                );
            regenGroup.SetFilter(HealthComponent.ComponentAuthority.Authoritative);
        }
Exemple #12
0
            public void SendUpdates(
                NativeArray <ArchetypeChunk> chunkArray,
                ComponentSystemBase system,
                EntityManager entityManager,
                ComponentUpdateSystem componentUpdateSystem)
            {
                Profiler.BeginSample("ExhaustiveRepeated");

                var spatialOSEntityType = system.GetArchetypeChunkComponentType <SpatialEntityId>(true);
                var componentType       = system.GetArchetypeChunkComponentType <Improbable.Gdk.Tests.ExhaustiveRepeated.Component>();

                var authorityType = system.GetArchetypeChunkSharedComponentType <ComponentAuthority>();

                foreach (var chunk in chunkArray)
                {
                    var entityIdArray  = chunk.GetNativeArray(spatialOSEntityType);
                    var componentArray = chunk.GetNativeArray(componentType);

                    var authorityIndex = chunk.GetSharedComponentIndex(authorityType);

                    if (!entityManager.GetSharedComponentData <ComponentAuthority>(authorityIndex).HasAuthority)
                    {
                        continue;
                    }

                    for (var i = 0; i < componentArray.Length; i++)
                    {
                        var data = componentArray[i];
                        if (data.IsDataDirty())
                        {
                            Update update = new Update();

                            if (data.IsDataDirty(0))
                            {
                                update.Field1 = data.Field1;
                            }

                            if (data.IsDataDirty(1))
                            {
                                update.Field2 = data.Field2;
                            }

                            if (data.IsDataDirty(2))
                            {
                                update.Field3 = data.Field3;
                            }

                            if (data.IsDataDirty(3))
                            {
                                update.Field4 = data.Field4;
                            }

                            if (data.IsDataDirty(4))
                            {
                                update.Field5 = data.Field5;
                            }

                            if (data.IsDataDirty(5))
                            {
                                update.Field6 = data.Field6;
                            }

                            if (data.IsDataDirty(6))
                            {
                                update.Field7 = data.Field7;
                            }

                            if (data.IsDataDirty(7))
                            {
                                update.Field8 = data.Field8;
                            }

                            if (data.IsDataDirty(8))
                            {
                                update.Field9 = data.Field9;
                            }

                            if (data.IsDataDirty(9))
                            {
                                update.Field10 = data.Field10;
                            }

                            if (data.IsDataDirty(10))
                            {
                                update.Field11 = data.Field11;
                            }

                            if (data.IsDataDirty(11))
                            {
                                update.Field12 = data.Field12;
                            }

                            if (data.IsDataDirty(12))
                            {
                                update.Field13 = data.Field13;
                            }

                            if (data.IsDataDirty(13))
                            {
                                update.Field14 = data.Field14;
                            }

                            if (data.IsDataDirty(14))
                            {
                                update.Field15 = data.Field15;
                            }

                            if (data.IsDataDirty(15))
                            {
                                update.Field16 = data.Field16;
                            }

                            if (data.IsDataDirty(16))
                            {
                                update.Field17 = data.Field17;
                            }

                            if (data.IsDataDirty(17))
                            {
                                update.Field18 = data.Field18;
                            }

                            componentUpdateSystem.SendUpdate(in update, entityIdArray[i].EntityId);
                            data.MarkDataClean();
                            componentArray[i] = data;
                        }
                    }
                }

                Profiler.EndSample();
            }
Exemple #13
0
            public void SendEvents(NativeArray <ArchetypeChunk> chunkArray, ComponentSystemBase system, ComponentUpdateSystem componentUpdateSystem)
            {
                Profiler.BeginSample("Connection");

                var spatialOSEntityType = system.GetArchetypeChunkComponentType <SpatialEntityId>(true);
                var eventMyEventType    = system.GetArchetypeChunkComponentType <EventSender.MyEvent>(true);

                foreach (var chunk in chunkArray)
                {
                    var entityIdArray     = chunk.GetNativeArray(spatialOSEntityType);
                    var eventMyEventArray = chunk.GetNativeArray(eventMyEventType);
                    for (var i = 0; i < entityIdArray.Length; i++)
                    {
                        foreach (var e in eventMyEventArray[i].Events)
                        {
                            componentUpdateSystem.SendEvent(new MyEvent.Event(e), entityIdArray[i].EntityId);
                        }

                        eventMyEventArray[i].Events.Clear();
                    }
                }

                Profiler.EndSample();
            }
Exemple #14
0
            public void SendUpdates(
                NativeArray <ArchetypeChunk> chunkArray,
                ComponentSystemBase system,
                EntityManager entityManager,
                ComponentUpdateSystem componentUpdateSystem)
            {
                using (componentMarker.Auto())
                {
                    var spatialOSEntityType = system.GetArchetypeChunkComponentType <SpatialEntityId>(true);
                    var componentType       = system.GetArchetypeChunkComponentType <global::Improbable.TestSchema.ExhaustiveMapKey.Component>();

                    foreach (var chunk in chunkArray)
                    {
                        var entityIdArray  = chunk.GetNativeArray(spatialOSEntityType);
                        var componentArray = chunk.GetNativeArray(componentType);

                        for (var i = 0; i < componentArray.Length; i++)
                        {
                            var data = componentArray[i];

                            if (data.IsDataDirty())
                            {
                                var update = new Update();

                                if (data.IsDataDirty(0))
                                {
                                    update.Field1 = data.Field1;
                                }

                                if (data.IsDataDirty(1))
                                {
                                    update.Field2 = data.Field2;
                                }

                                if (data.IsDataDirty(2))
                                {
                                    update.Field3 = data.Field3;
                                }

                                if (data.IsDataDirty(3))
                                {
                                    update.Field4 = data.Field4;
                                }

                                if (data.IsDataDirty(4))
                                {
                                    update.Field5 = data.Field5;
                                }

                                if (data.IsDataDirty(5))
                                {
                                    update.Field6 = data.Field6;
                                }

                                if (data.IsDataDirty(6))
                                {
                                    update.Field7 = data.Field7;
                                }

                                if (data.IsDataDirty(7))
                                {
                                    update.Field8 = data.Field8;
                                }

                                if (data.IsDataDirty(8))
                                {
                                    update.Field9 = data.Field9;
                                }

                                if (data.IsDataDirty(9))
                                {
                                    update.Field10 = data.Field10;
                                }

                                if (data.IsDataDirty(10))
                                {
                                    update.Field11 = data.Field11;
                                }

                                if (data.IsDataDirty(11))
                                {
                                    update.Field12 = data.Field12;
                                }

                                if (data.IsDataDirty(12))
                                {
                                    update.Field13 = data.Field13;
                                }

                                if (data.IsDataDirty(13))
                                {
                                    update.Field14 = data.Field14;
                                }

                                if (data.IsDataDirty(14))
                                {
                                    update.Field15 = data.Field15;
                                }

                                if (data.IsDataDirty(15))
                                {
                                    update.Field16 = data.Field16;
                                }

                                if (data.IsDataDirty(16))
                                {
                                    update.Field17 = data.Field17;
                                }

                                if (data.IsDataDirty(17))
                                {
                                    update.Field18 = data.Field18;
                                }

                                componentUpdateSystem.SendUpdate(in update, entityIdArray[i].EntityId);
                                data.MarkDataClean();
                                componentArray[i] = data;
                            }
                        }
                    }
                }
            }
Exemple #15
0
 public void AcknowledgeAuthorityLoss()
 {
     ComponentUpdateSystem.AcknowledgeAuthorityLoss(EntityId, DependencyTest.ComponentId);
 }
Exemple #16
0
 public AuthorityConstraintCallbackManager(uint componentId, World world)
 {
     this.componentId      = componentId;
     componentUpdateSystem = world.GetExistingManager <ComponentUpdateSystem>();
 }
Exemple #17
0
 public void AcknowledgeAuthorityLoss()
 {
     ComponentUpdateSystem.AcknowledgeAuthorityLoss(EntityId, ExhaustiveSingular.ComponentId);
 }
 public ComponentEventCallbackManager(World world)
 {
     componentUpdateSystem = world.GetExistingSystem <ComponentUpdateSystem>();
 }
Exemple #19
0
            public void SendUpdates(
                NativeArray <ArchetypeChunk> chunkArray,
                ComponentSystemBase system,
                EntityManager entityManager,
                ComponentUpdateSystem componentUpdateSystem)
            {
                Profiler.BeginSample("ExhaustiveEntity");

                var spatialOSEntityType = system.GetArchetypeChunkComponentType <SpatialEntityId>(true);
                var componentType       = system.GetArchetypeChunkComponentType <global::Improbable.TestSchema.ExhaustiveEntity.Component>();
                var authorityType       = system.GetArchetypeChunkSharedComponentType <ComponentAuthority>();

                foreach (var chunk in chunkArray)
                {
                    var entityIdArray  = chunk.GetNativeArray(spatialOSEntityType);
                    var componentArray = chunk.GetNativeArray(componentType);
                    var authorityIndex = chunk.GetSharedComponentIndex(authorityType);

                    if (!entityManager.GetSharedComponentData <ComponentAuthority>(authorityIndex).HasAuthority)
                    {
                        continue;
                    }

                    for (var i = 0; i < componentArray.Length; i++)
                    {
                        var data = componentArray[i];

                        if (data.IsDataDirty())
                        {
                            Update update = new Update();

                            if (data.IsDataDirty(0))
                            {
                                update.Field1 = data.Field1;
                            }

                            if (data.IsDataDirty(1))
                            {
                                update.Field2 = data.Field2;
                            }

                            if (data.IsDataDirty(2))
                            {
                                update.Field3 = data.Field3;
                            }

                            if (data.IsDataDirty(3))
                            {
                                update.Field4 = data.Field4;
                            }

                            if (data.IsDataDirty(4))
                            {
                                update.Field5 = data.Field5;
                            }

                            componentUpdateSystem.SendUpdate(in update, entityIdArray[i].EntityId);
                            data.MarkDataClean();
                            componentArray[i] = data;
                        }
                    }
                }

                Profiler.EndSample();
            }
        public void SendFooEventEvent(global::Improbable.TestSchema.SomeType fooEvent)
        {
            var eventToSend = new DependentDataComponent.FooEvent.Event(fooEvent);

            ComponentUpdateSystem.SendEvent(eventToSend, EntityId);
        }
Exemple #21
0
 protected override void OnCreate()
 {
     _componentUpdateSystem = World.GetExistingSystem <ComponentUpdateSystem>();
     EntityManager.CreateEntity(ComponentType.ReadOnly <TimeRequestData>());
 }
Exemple #22
0
        public void SendRespawnEvent(global::Improbable.Common.Empty respawn)
        {
            var eventToSend = new HealthComponent.Respawn.Event(respawn);

            ComponentUpdateSystem.SendEvent(eventToSend, EntityId);
        }
Exemple #23
0
            public void SendUpdates(
                NativeArray <ArchetypeChunk> chunkArray,
                ComponentSystemBase system,
                EntityManager entityManager,
                ComponentUpdateSystem componentUpdateSystem)
            {
                Profiler.BeginSample("BlittableComponent");

                var spatialOSEntityType = system.GetArchetypeChunkComponentType <SpatialEntityId>(true);
                var componentType       = system.GetArchetypeChunkComponentType <global::Improbable.Gdk.Tests.BlittableTypes.BlittableComponent.Component>();

                var authorityType = system.GetArchetypeChunkSharedComponentType <ComponentAuthority>();

                foreach (var chunk in chunkArray)
                {
                    var entityIdArray  = chunk.GetNativeArray(spatialOSEntityType);
                    var componentArray = chunk.GetNativeArray(componentType);

                    var authorityIndex = chunk.GetSharedComponentIndex(authorityType);

                    if (!entityManager.GetSharedComponentData <ComponentAuthority>(authorityIndex).HasAuthority)
                    {
                        continue;
                    }

                    for (var i = 0; i < componentArray.Length; i++)
                    {
                        var data = componentArray[i];
                        if (data.IsDataDirty())
                        {
                            Update update = new Update();

                            if (data.IsDataDirty(0))
                            {
                                update.BoolField = data.BoolField;
                            }

                            if (data.IsDataDirty(1))
                            {
                                update.IntField = data.IntField;
                            }

                            if (data.IsDataDirty(2))
                            {
                                update.LongField = data.LongField;
                            }

                            if (data.IsDataDirty(3))
                            {
                                update.FloatField = data.FloatField;
                            }

                            if (data.IsDataDirty(4))
                            {
                                update.DoubleField = data.DoubleField;
                            }

                            componentUpdateSystem.SendUpdate(in update, entityIdArray[i].EntityId);
                            data.MarkDataClean();
                            componentArray[i] = data;
                        }
                    }
                }

                Profiler.EndSample();
            }
Exemple #24
0
 public abstract void AcknowledgeAuthorityLoss(NativeArray <ArchetypeChunk> chunkArray, ComponentSystemBase system,
                                               ComponentUpdateSystem updateSystem);
Exemple #25
0
 public void SendEvents(NativeArray <ArchetypeChunk> chunkArray, ComponentSystemBase system, ComponentUpdateSystem componentUpdateSystem)
 {
 }
Exemple #26
0
 public void AcknowledgeAuthorityLoss()
 {
     ComponentUpdateSystem.AcknowledgeAuthorityLoss(EntityId, System.ComponentId);
 }
Exemple #27
0
 public void SendUpdates(NativeArray <ArchetypeChunk> chunkArray, ComponentSystemBase system,
                         EntityManager entityManager, ComponentUpdateSystem componentUpdateSystem)
 {
     throw new NotImplementedException();
 }
Exemple #28
0
 public ComponentAuthorityCallbackManager(uint componentId, World world)
 {
     this.componentId      = componentId;
     componentUpdateSystem = world.GetExistingSystem <ComponentUpdateSystem>();
 }
Exemple #29
0
 public void AcknowledgeAuthorityLoss()
 {
     ComponentUpdateSystem.AcknowledgeAuthorityLoss(EntityId, ComponentUsingNestedTypeSameName.ComponentId);
 }
Exemple #30
0
            public void SendUpdates(
                NativeArray <ArchetypeChunk> chunkArray,
                ComponentSystemBase system,
                EntityManager entityManager,
                ComponentUpdateSystem componentUpdateSystem)
            {
                Profiler.BeginSample("HealthRegenComponent");

                var spatialOSEntityType = system.GetArchetypeChunkComponentType <SpatialEntityId>(true);
                var componentType       = system.GetArchetypeChunkComponentType <Improbable.Gdk.Health.HealthRegenComponent.Component>();

                var authorityType = system.GetArchetypeChunkSharedComponentType <ComponentAuthority>();

                foreach (var chunk in chunkArray)
                {
                    var entityIdArray  = chunk.GetNativeArray(spatialOSEntityType);
                    var componentArray = chunk.GetNativeArray(componentType);

                    var authorityIndex = chunk.GetSharedComponentIndex(authorityType);

                    if (!entityManager.GetSharedComponentData <ComponentAuthority>(authorityIndex).HasAuthority)
                    {
                        continue;
                    }

                    for (var i = 0; i < componentArray.Length; i++)
                    {
                        var data = componentArray[i];
                        if (data.IsDataDirty())
                        {
                            Update update = new Update();

                            if (data.IsDataDirty(0))
                            {
                                update.DamagedRecently = data.DamagedRecently;
                            }

                            if (data.IsDataDirty(1))
                            {
                                update.RegenCooldownTimer = data.RegenCooldownTimer;
                            }

                            if (data.IsDataDirty(2))
                            {
                                update.CooldownSyncInterval = data.CooldownSyncInterval;
                            }

                            if (data.IsDataDirty(3))
                            {
                                update.RegenPauseTime = data.RegenPauseTime;
                            }

                            if (data.IsDataDirty(4))
                            {
                                update.RegenInterval = data.RegenInterval;
                            }

                            if (data.IsDataDirty(5))
                            {
                                update.RegenAmount = data.RegenAmount;
                            }

                            componentUpdateSystem.SendUpdate(in update, entityIdArray[i].EntityId);
                            data.MarkDataClean();
                            componentArray[i] = data;
                        }
                    }
                }

                Profiler.EndSample();
            }