Skip to content
Snippets Groups Projects
Commit 0ffeab9b authored by Chang, Ryan's avatar Chang, Ryan
Browse files

Removed unneeded stuff

parent a6f57bd3
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,6 @@ using System.Threading; ...@@ -2,7 +2,6 @@ using System.Threading;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using Unity.Mathematics;
using System.Collections.Concurrent; using System.Collections.Concurrent;
[System.Serializable] [System.Serializable]
...@@ -48,11 +47,6 @@ public class TerrainGenerator : MonoBehaviour ...@@ -48,11 +47,6 @@ public class TerrainGenerator : MonoBehaviour
[Tooltip("Dictionary of previously loaded terrains.")] [Tooltip("Dictionary of previously loaded terrains.")]
public Dictionary<Vector2Int, TerrainData> previouslyLoaded = new(); public Dictionary<Vector2Int, TerrainData> previouslyLoaded = new();
///// <summary>
///// Threads used for generating the neighboring and current terrains.
///// </summary>
//private ConcurrentBag<Thread> threads = new();
private ConcurrentQueue<TerrainGenThread> generators = new(); private ConcurrentQueue<TerrainGenThread> generators = new();
public int bagCount = 0; public int bagCount = 0;
...@@ -119,24 +113,6 @@ public class TerrainGenerator : MonoBehaviour ...@@ -119,24 +113,6 @@ public class TerrainGenerator : MonoBehaviour
{ {
yield return new WaitForSecondsRealtime(1); yield return new WaitForSecondsRealtime(1);
//bool busy = true;
//while (busy)
//{
// busy = false;
// foreach (var thread in generationThreads)
// {
// // Wait for all threads to finish.
// if (thread != null && thread.IsAlive)
// {
// busy = true;
// yield return new WaitForEndOfFrame();
// break;
// }
// }
//}
while (!generators.IsEmpty) while (!generators.IsEmpty)
{ {
if (generators.TryPeek(out TerrainGenThread tGen)) if (generators.TryPeek(out TerrainGenThread tGen))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment