public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
            {
                NativeArray <BlockSwitchData>       blockSwitches      = chunk.GetNativeArray(this.blockSwitchType);
                NativeArray <SwitchGroupAppearData> switchGroupAppears = chunk.GetNativeArray(this.switchGroupAppearType);

                for (int ci = 0, cn = chunk.Count; ci < cn; ci++)
                {
                    // Show blocks in group if switch activated

                    BlockSwitchData       blockSwitch       = blockSwitches[ci];
                    SwitchGroupAppearData switchGroupAppear = switchGroupAppears[ci];

                    if (blockSwitch.wasJustActivated && blockSwitch.currentState == BlockSwitchState.On)
                    {
                        // Show group blocks

                        if (this.entityBuffer.Exists(switchGroupAppear.groupRoot))
                        {
                            DynamicBuffer <EntityElement> entityBuff = this.entityBuffer[switchGroupAppear.groupRoot];

                            for (int i = 0, n = entityBuff.Length; i < n; i++)
                            {
                                EntityUtils.EnableEntityHierarchy(ref ecb, chunkIndex, entityBuff[i], in this.childrenBuffer);
                            }
                        }
                    }
                }
            }
            public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
            {
                NativeArray <BlockSwitchData> blockSwitches = chunk.GetNativeArray(this.blockSwitchType);

                for (int ci = 0, cn = chunk.Count; ci < cn; ci++)
                {
                    // Reset activate flag

                    BlockSwitchData blockSwitch = blockSwitches[ci];
                    if (blockSwitch.wasJustActivated)
                    {
                        blockSwitch.wasJustActivated = false;

                        // Apply changes
                        blockSwitches[ci] = blockSwitch;
                    }
                }
            }
            public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
            {
                NativeArray <BlockPlayerCollisionData> blockCollisions = chunk.GetNativeArray(this.blockPlayerCollisionType);
                NativeArray <BlockSwitchData>          blockSwitches   = chunk.GetNativeArray(this.blockSwitchType);

                for (int ci = 0, cn = chunk.Count; ci < cn; ci++)
                {
                    // Activate switch if entered block

                    BlockPlayerCollisionData blockCollision = blockCollisions[ci];
                    BlockSwitchData          blockSwitch    = blockSwitches[ci];

                    if (blockCollision.triggerState == PhysicsTriggerState.Enter)
                    {
                        blockSwitch.Activate();
                    }

                    // Apply changes
                    blockSwitches[ci] = blockSwitch;
                }
            }