void process(MeshTask task) { IntVec3 pos = Client.view.world.getChunkIndex(task.chunk.pos * Settings.chunk_size); if (pos == null) { return; } RenderChunk rc = Client.view.world.chunks[pos.x, pos.y, pos.z]; rc.setMesh(task.mesh); }
public void add(MeshTask task) { tasks.Add(task); if (tasks[0] != task) { return; } thread = new Thread(new ThreadStart(task.start)); try { thread.Start(); } catch (ThreadStateException e) { UnityEngine.Debug.Log("Thread Error" + e.ToString()); } }
public void priority(MeshTask task) { if (tasks.Count <= 1) { add(task); return; } tasks.Insert(1, task); if (tasks[0] != task) { return; } thread = new Thread(new ThreadStart(task.start)); try { thread.Start(); } catch (ThreadStateException e) { UnityEngine.Debug.Log("Thread Error" + e.ToString()); } }