Exemplo n.º 1
0
 static private JobHandle ScheduleGenerateOptimizationData(Data data, OptimizedInfo info, bool useCullingData, bool useHeightData, NativeArray <MergeCellInfo> mergeInfoArray, JobHandle lastHandle)
 {
     if (useCullingData && useHeightData)
     {
         var checker = new CulledHeightMergeChecker()
         {
             heights = data.HeightsRawData, colNum = data.ColNum, culled = data.CullingDataRawData
         };
         return(ScheduleGenerateOptimizationData(data, info, checker, mergeInfoArray, lastHandle));
     }
     else if (useCullingData)
     {
         var checker = new CulledMergeChecker()
         {
             culled = data.CullingDataRawData
         };
         return(ScheduleGenerateOptimizationData(data, info, checker, mergeInfoArray, lastHandle));
     }
     else if (useHeightData)
     {
         var checker = new HeightMergeChecker()
         {
             heights = data.HeightsRawData, colNum = data.ColNum
         };
         return(ScheduleGenerateOptimizationData(data, info, checker, mergeInfoArray, lastHandle));
     }
     else
     {
         return(ScheduleGenerateOptimizationData(data, info, new SimpleMergeChecker(), mergeInfoArray, lastHandle));
     }
 }
Exemplo n.º 2
0
        public void Init(Data data, float cellSize, OptimizedInfo info)
        {
            this.data     = data;
            this.cellSize = cellSize;
            this.info     = info;

            CheckData(data, info);

            Inited();
        }
Exemplo n.º 3
0
            static public JobHandle Schedule(Data data, OptimizedInfo info, MergeChecker mergeChecker, NativeArray <MergeCellInfo> optimizationCells, JobHandle dependOn = default)
            {
                var optimizationJob = new GenerateOptimizationData <MergeChecker>
                {
                    distanceColNum = data.ColNum,
                    distanceRowNum = data.RowNum,
                    mode           = info.OptimizationMode,
                    mergeChecker   = mergeChecker,
                    cells          = optimizationCells,
                    distances      = data.RawData
                };

                return(optimizationJob.Schedule(dependOn));
            }
Exemplo n.º 4
0
 static private JobHandle ScheduleGenerateOptimizationData <MergeChecker>(Data data, OptimizedInfo info, MergeChecker checker, NativeArray <MergeCellInfo> mergeInfoArray, JobHandle lastHandle)
     where MergeChecker : struct, IMergeChecker
 => GenerateOptimizationData <MergeChecker> .Schedule(data, info, checker, mergeInfoArray, lastHandle);