Ejemplo n.º 1
0
        protected override JobHandle OnUpdate(JobHandle inputDependencies)
        {
            var job = new SpawnerSystemJob(
                _endSimulationEntityCommandBufferSystem.CreateCommandBuffer().ToConcurrent(),
                UnityEngine.Time.deltaTime,
                new Random((uint)UnityEngine.Random.Range(0, int.MaxValue))
                );



            JobHandle jobHandle = job.Schedule(this, inputDependencies);

            _endSimulationEntityCommandBufferSystem.AddJobHandleForProducer(jobHandle);

            return(jobHandle);
        }
Ejemplo n.º 2
0
    protected override JobHandle OnUpdate(JobHandle inputDependencies)
    {
        var job = new SpawnerSystemJob
        {
            CommandBuffer = m_EntityCommandBufferSystem.CreateCommandBuffer()
        }.ScheduleSingle(this, inputDependencies);

        m_EntityCommandBufferSystem.AddJobHandleForProducer(job);
        return(job);

        // Assign values to the fields on your job here, so that it has
        // everything it needs to do its work when it runs later.
        // For example,
        //     job.deltaTime = UnityEngine.Time.deltaTime;



        // Now that the job is set up, schedule it to be run.
        // return job.Schedule(this, inputDependencies);
    }