/// <summary> /// Loads the next few chunks as indicated by the chunk load order. /// </summary> private void LoadNearbyChunks() { if (m_BlockWorld.WorldContainer.ChunkLoader.ActiveTasks > 0 || m_BlockWorld.WorldContainer.RemeshHandler.ActiveTasks > 0) { m_CoolingDown = 3; return; } if (m_CoolingDown > 0) { m_CoolingDown--; return; } for (int i = 0; i < m_ChecksPerFrame; i++) { if (!m_ChunkLoadPatternIterator.HasNext) { return; } var pos = m_ChunkLoadPatternIterator.Next; var startedLoading = m_BlockWorld.LoadChunkAsync(pos + m_LastCameraPosition); if (startedLoading) { return; } } }
/// <summary> /// Loads the next few chunks as indicated by the chunk load order. /// </summary> private void LoadNearbyChunks() { if (m_BlockWorld.ActiveTasks > 0) { return; } for (int i = 0; i < m_ChecksPerFrame; /*i++*/) { if (!LoadPatternIterator.HasNext) { return; } var pos = LoadPatternIterator.Next; m_BlockWorld.LoadChunkAsync(pos + m_LastCameraPosition); // TODO Write server task for loading chunks async return; } }