protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new CloseJob {
            commandBuffer = m_Barrier.CreateCommandBuffer()
        };
        var handle = job.ScheduleSingle(this, inputDeps);

        m_Barrier.AddJobHandleForProducer(handle);
        return(handle);
    }
Ejemplo n.º 2
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            //
            inputDeps = new CloseJob
            {
                commandBuffer = endBarrier.CreateCommandBuffer().ToConcurrent(),
                driver        = driver,
            }
            .ScheduleSingle(this, inputDeps);


            //
            inputDeps = _driver.ScheduleUpdate(inputDeps);


            //
            if (_listening)
            {
                inputDeps = new AcceptJob()
                {
                    NetworkInBuffer            = typeof(NetworkInBuffer),
                    NetworkReliableOutBuffer   = typeof(NetworkReliableOutBuffer),
                    NetworkUnreliableOutBuffer = typeof(NetworkUnreliableOutBuffer),
                    endCommandBuffer           = endBarrier.CreateCommandBuffer(),
                    driver = _driver,
                }
                .Schedule(inputDeps);


#if UNITY_EDITOR
                OnRename();
#endif
            }
            else if (connectEntity != Entity.Null)
            {
                OnClose();
            }


            endBarrier.AddJobHandleForProducer(inputDeps);
            return(inputDeps);
        }