Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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());
     }
 }
Exemplo n.º 3
0
 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());
     }
 }