示例#1
0
        /// <summary>
        /// Creates & Schedules TranslationJob
        /// </summary>
        /// <param name="inputDeps">InputDependecies</param>
        /// <returns>OutputDependencies</returns>
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            // Grab Destinations (Where applicable)
            ComponentDataFromEntity <Destination> destinations = GetComponentDataFromEntity <Destination>(true);
            // Create TranslationJob
            TranslationJob job = new TranslationJob(Time.deltaTime, destinations, commandBufferSystem.CreateCommandBuffer().ToConcurrent());
            // Schedule Job
            JobHandle returnHandle = job.Schedule(this, inputDeps);

            // Add JobHandle to producer of CommandBuffer
            commandBufferSystem.AddJobHandleForProducer(returnHandle);
            return(returnHandle);
        }