protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var count       = _query.CalculateLength();
            var shellsQueue = new NativeArray <float3>(count, Allocator.TempJob);
            var reloadJob   = new ReloadJob
            {
                delta          = Time.deltaTime,
                shellPositions = shellsQueue
            };

            var shootJob = new ShootJob
            {
                shellPositions = shellsQueue,
                commandBuffer  = _commandBufferSystem.CreateCommandBuffer(),
                shellTemplate  = _shellTemplate
            };

            var handle = reloadJob.Schedule(_query);

            handle = shootJob.Schedule(handle);

            _commandBufferSystem.AddJobHandleForProducer(handle);

            return(handle);
        }
Пример #2
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            ShootJob job = new ShootJob
            {
                time = UnityEngine.Time.time,
            };
            JobHandle handle = job.Schedule(this, inputDeps);

            return(handle);
        }
Пример #3
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new ShootJob
        {
            Inputs    = _players.Inputs,
            PlayerPos = _players.Positions,
            Accuracy  = Bootstrap.Accuracy
        };

        return(job.Schedule(this, 1, inputDeps));
    }