Пример #1
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var job = new FiringJob()
            {
                FireStartTime       = Time.time,
                EntityCommandBuffer = _barrier.CreateCommandBuffer()
            };

            return(job.Schedule(this, inputDeps));
        }
Пример #2
0
    //public static JobHandle ScheduleBatchRayCast(EntityCommandBuffer.Concurrent commandBuffer,
    //        NativeArray<LocalToWorld> localToWorld, NativeArray<Rotation> rotation)
    //{
    //    JobHandle rcj = new FiringJob
    //    {
    //        CommandBuffer = commandBuffer,
    //        localToWorld = localToWorld,
    //        rotation = rotation

    //    }.Schedule(localToWorld.Length, 5);
    //    return rcj;
    //}

    //protected override void OnUpdate()
    //{
    //var commandBuffer = m_Barrier.CreateCommandBuffer().ToConcurrent();
    //var localToWorld = _componentGroup.ToComponentDataArray<LocalToWorld>(Allocator.TempJob);
    //var rotation = _componentGroup.ToComponentDataArray<Rotation>(Allocator.TempJob);

    //JobHandle rayJobHandle = ScheduleBatchRayCast(commandBuffer, localToWorld, rotation);
    //rayJobHandle.Complete();
    //}

    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var commandBuffer = m_Barrier.CreateCommandBuffer().ToConcurrent();
        var job           = new FiringJob
        {
            CommandBuffer = commandBuffer,
        }.Schedule(this, inputDeps);

        //Schedule(_componentGroup, inputDeps); -> Schedule(this, inputDeps);
        m_Barrier.AddJobHandleForProducer(job);
        return(job);
    }
Пример #3
0
 protected override JobHandle OnUpdate(JobHandle inputDeps)
 {
     if (ECSWorld.Instance && ECSWorld.Instance.isStart)
     {
         var job = new FiringJob()
         {
             FireStartTime       = Time.time,
             EntityCommandBuffer = _barrier.CreateCommandBuffer()
         };
         var jobHandle = job.Schedule(this, inputDeps);
         jobHandle.Complete();
         return(jobHandle);
     }
     else
     {
         return(inputDeps);
     }
 }