コード例 #1
0
            protected override void OnUpdate()
            {
                var query           = GetEntityQuery(typeof(EcsIntElement));
                var chunks          = query.CreateArchetypeChunkArray(Allocator.TempJob);
                var updateChunksJob = new UpdateChunks
                {
                    Chunks        = chunks,
                    ElementHandle = GetDynamicComponentTypeHandle(ComponentType.ReadWrite(typeof(EcsIntElement)))
                };
                var updateChunksJobHandle = updateChunksJob.Schedule(chunks.Length, 32);

                updateChunksJobHandle.Complete();
                chunks.Dispose();
            }
            protected override void OnUpdate()
            {
                var chunks          = m_Group.CreateArchetypeChunkArray(Allocator.TempJob);
                var ecsIntElements  = GetArchetypeChunkBufferType <EcsIntElement>();
                var updateChunksJob = new UpdateChunks
                {
                    Chunks         = chunks,
                    EcsIntElements = ecsIntElements
                };
                var updateChunksJobHandle = updateChunksJob.Schedule(chunks.Length, 32);

                updateChunksJobHandle.Complete();

                chunks.Dispose();
            }
コード例 #3
0
            protected override void OnUpdate()
            {
                var chunks          = m_Group.CreateArchetypeChunkArray(Allocator.TempJob);
                var ecsTestDataType = GetArchetypeChunkComponentType <EcsTestData>();
                var updateChunksJob = new UpdateChunks
                {
                    Chunks          = chunks,
                    EcsTestDataType = ecsTestDataType
                };
                var updateChunksJobHandle = updateChunksJob.Schedule(chunks.Length, 32);

                updateChunksJobHandle.Complete();

                // LastSystemVersion bumped after update. Check for change
                // needs to occur inside system update.
                m_LastAllChanged = true;
                for (int i = 0; i < chunks.Length; i++)
                {
                    m_LastAllChanged &= chunks[i].DidChange(ecsTestDataType, LastSystemVersion);
                }

                chunks.Dispose();
            }