Ejemplo n.º 1
0
#pragma warning restore 618

    protected override JobHandle OnUpdate(JobHandle inputDependencies)
    {
        var newEntityJob = new NewEntityJob()
        {
            ConcurrentECB = m_ECBSource.CreateCommandBuffer().ToConcurrent()
        };
        var newJobHandle = newEntityJob.ScheduleSingle(m_newEntities, inputDependencies);

        m_ECBSource.AddJobHandleForProducer(newJobHandle);

        var processEntityJob = new ProcessEntityJob()
        {
            ConcurrentECB = m_ECBSource.CreateCommandBuffer().ToConcurrent()
        };
        var processJobHandle = processEntityJob.Schedule(m_activeEntities, newJobHandle);

        m_ECBSource.AddJobHandleForProducer(processJobHandle);

        var cleanupEntityJob = new CleanupEntityJob()
        {
            ConcurrentECB = m_ECBSource.CreateCommandBuffer().ToConcurrent()
        };
        var cleanupJobHandle = cleanupEntityJob.ScheduleSingle(m_destroyedEntities, processJobHandle);

        m_ECBSource.AddJobHandleForProducer(cleanupJobHandle);

        return(cleanupJobHandle);
    }
#pragma warning restore 618

        protected override JobHandle OnUpdate(JobHandle inputDependencies)
        {
            var newEntityJob = new NewEntityJob
            {
                ConcurrentECB = m_ecbSource.CreateCommandBuffer().AsParallelWriter()
            };
            var newJobHandle = newEntityJob.ScheduleSingle(m_newEntities, inputDependencies);

            m_ecbSource.AddJobHandleForProducer(newJobHandle);

            var cleanupEntityJob = new CleanupEntityJob
            {
                ConcurrentECB = m_ecbSource.CreateCommandBuffer().AsParallelWriter()
            };
            var cleanupJobHandle = cleanupEntityJob.ScheduleSingle(m_destroyedEntities, newJobHandle);

            m_ecbSource.AddJobHandleForProducer(cleanupJobHandle);

            return(cleanupJobHandle);
        }