public void RequestWorldChunkComputed(WorldChunk chunk, WorldChunkSettings setting, Action <WorldChunkComputed> callback) { ThreadStart threadStart = delegate { // Loading WorldChunkComputed chunkComputed = new WorldChunkComputed(chunk, setting); lock (chunkComputedThreadInQueue) { chunkComputedThreadInQueue.Enqueue(new MapComputingThreadInfo <WorldChunkComputed>(callback, chunkComputed)); } // End Loading.. }; new Thread(threadStart).Start(); }
public void OnWorldChunkComputedReceived(WorldChunkComputed _chunkComputed) { // Computed this.chunkComputed = _chunkComputed; this.state = ChunkStates.Computed; this.computingTime = Time.time - this.computingTime; this.isComputing = false; // Inform MapEndless MapEndless.instance.OnWorldChunkThreadReceived(this); // Rendering MapDisplay.instance.UpdateChunkDisplay(this); }