示例#1
0
        internal unsafe void AddCreateCommand(EntityCommandBufferChain *chain, int jobIndex, ECBCommand op, EntityArchetype archetype)
        {
            int num1;

            if ((chain.m_PrevCreateCommand == null) || !(chain.m_PrevCreateCommand.Archetype == archetype))
            {
                num1 = 0;
            }
            else
            {
                num1 = (int)(chain.m_PrevCreateCommand.BatchCount < 0x200);
            }
            if (num1 == 0)
            {
                CreateCommand *commandPtr2 = (CreateCommand *)ref this.Reserve(chain, jobIndex, sizeof(CreateCommand));
                commandPtr2->Header.CommandType = (int)op;
                commandPtr2->Header.TotalSize   = sizeof(CreateCommand);
                commandPtr2->Header.SortIndex   = chain.m_LastSortIndex;
                commandPtr2->Archetype          = archetype;
                commandPtr2->BatchCount         = 1;
                chain.m_PrevCreateCommand       = commandPtr2;
            }
            else
            {
                int *numPtr1 = (int *)ref chain.m_PrevCreateCommand.BatchCount;
                numPtr1[0]++;
                CreateCommand *commandPtr = (CreateCommand *)ref this.Reserve(chain, jobIndex, sizeof(CreateCommand));
                commandPtr->Header.CommandType = (int)op;
                commandPtr->Header.TotalSize   = sizeof(CreateCommand);
                commandPtr->Header.SortIndex   = chain.m_LastSortIndex;
                commandPtr->Archetype          = archetype;
                commandPtr->BatchCount         = 0;
            }
        }
 public static void Process(EntityManager entityManager, CreateCommand *it, Span <uint> lastEntities)
 {
     System.Span <ComponentType> componentTypes = new System.Span <ComponentType>(it + 1, it->ComponentCount);
     entityManager.Create(componentTypes, lastEntities);
 }
 public unsafe void TemporaryForceDisableBatching()
 {
     this.m_PrevCreateCommand = null;
     this.m_PrevEntityCommand = null;
 }