예제 #1
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var job = new MoveToPositionJob
            {
                deltaSecond = Time.DeltaTime,
                ECBuffer    = _ecbSystem.CreateCommandBuffer().ToConcurrent()
            };
            var handle = job.Schedule(this, inputDeps);

            _ecbSystem.AddJobHandleForProducer(handle);
            return(handle);
        }
    private void Update()
    {
        MoveToPositionJob transformJob = new MoveToPositionJob()
        {
            newX = Random.Range(1, 4),
            newY = Random.Range(1, 4),
            dt   = Time.deltaTime
        };

        transformJobHandle = transformJob.Schedule(transformAccessArray);
        JobHandle.ScheduleBatchedJobs();
        transformJobHandle.Complete();
        if (transformJobHandle.IsCompleted)
        {
            Debug.Log("Transform Job Completed!");
        }
    }