예제 #1
0
        protected void SetColumn(int x, int z)
        {
#if PROFILE
            UnityEngine.Profiling.Profiler.BeginSample("SetColumn: Fill List");
#endif
            List <Chunk> column = new List <Chunk>();
            for (int y = 0; y < worldHeight; y++)
            {
                Vector3Int dest = new Vector3Int(x, y, z);
                Chunk      ch   = GetChunk(dest);
                ch._PopulateStart(dest * 32);
                column.Add(ch);
            }
#if PROFILE
            UnityEngine.Profiling.Profiler.BeginSample("SetColumn: TryAddJob");
#endif
            // Single-threaded
            MCALoaderChunkGeneratorJob pastJob = serialJob;
            serialJob = new MCALoaderChunkGeneratorJob(true, m_MCAWorld, MCAPath, x, worldHeight, z, column);
            if (pastJob != null)
            {
                serialJob.Depends(pastJob);
            }
            CustomJobs.CustomJob.TryAddJob(serialJob, (job) => { if (job == serialJob)
                                                                 {
                                                                     serialJob = null;
                                                                 }
                                           });
#if PROFILE
            UnityEngine.Profiling.Profiler.EndSample();
#endif
#if PROFILE
            UnityEngine.Profiling.Profiler.EndSample();
#endif
        }
예제 #2
0
        protected override void Update()
        {
            base.Update();

            if (CustomJobs.CustomJob.scheduledJobs.Count < 1)
            {
                serialJob = null;
            }
        }