Esempio n. 1
0
 protected JobHandle ScheduleAttributeCombinerJob(JobHandle inputDeps)
 {
     inputDeps = new AttributeCombinerJob
     {
         AddAttributes      = AttributeHashAdd,
         DivideAttributes   = AttributeHashDivide,
         MultiplyAttributes = AttributeHashMultiply
     }.Schedule(this.actorsWithAttributesQuery, inputDeps);
     return(inputDeps);
 }
Esempio n. 2
0
        protected override JobHandle ScheduleJobs(JobHandle inputDependencies)
        {
            ScheduleAttributeJob <Components.Operators.Add>(inputDependencies, this.Queries[0], out var AttributeHashAdd, out var addJob);
            ScheduleAttributeJob <Components.Operators.Multiply>(inputDependencies, this.Queries[1], out var AttributeHashMultiply, out var mulJob);
            ScheduleAttributeJob <Components.Operators.Divide>(inputDependencies, this.Queries[2], out var AttributeHashDivide, out var divideJob);
            inputDependencies = JobHandle.CombineDependencies(addJob, divideJob, mulJob);

            inputDependencies = new AttributeCombinerJob
            {
                AddAttributes      = AttributeHashAdd,
                DivideAttributes   = AttributeHashDivide,
                MultiplyAttributes = AttributeHashMultiply
            }.Schedule(this.actorsWithAttributesQuery, inputDependencies);

            inputDependencies = AttributeHashAdd.Dispose(inputDependencies);
            inputDependencies = AttributeHashMultiply.Dispose(inputDependencies);
            inputDependencies = AttributeHashDivide.Dispose(inputDependencies);

            return(inputDependencies);
        }