//Runs on the MainThread
    protected override JobHandle OnUpdate(JobHandle inputDependencies)
    {
        var job = new ProduceJob
        {
            timestep  = 10,
            deltaTime = Time.deltaTime
        };

        return(job.Schedule(this, inputDependencies));
    }
예제 #2
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var current = new int2(Screen.width, Screen.height);

            if (!res.Equals(current))
            {
                res = current;
                var resizeDeps = new ResizeCanvasJob {
                    Resolution = current
                }.Schedule(this, inputDeps);

                var productionJob = new ProduceJob {
                    EvtArchetype = evtArchetype,
                    CmdBuffer    = cmdBufferSystem.CreateCommandBuffer()
                }.Schedule(resizeDeps);

                cmdBufferSystem.AddJobHandleForProducer(productionJob);

                return(productionJob);
            }

            return(inputDeps);
        }