public bool IsJobInQueue(Vector3 chunkLocation) { GenerateChunkJob check = new GenerateChunkJob(); check.chunkLocationToGenerate = chunkLocation; if (check.Equals(activeGenerationJob)) { return(true); } else if (generationQueue.Contains(check)) { return(true); } else if (check.Equals(activeMeshJob)) { return(true); } else if (meshGenerationQueue.Contains(check.ToMeshJob())) { return(true); } return(false); }
public void RemoveGenerationJob(GenerateChunkJob jobToRemove) { if (jobToRemove.Equals(activeGenerationJob)) { activeGenerationJob.Abort(); activeGenerationJob = null; hasActiveGenerationJob = false; } else if (!generationQueue.Contains(jobToRemove)) { if (jobToRemove.Equals(activeMeshJob)) { activeMeshJob.Abort(); activeMeshJob = null; hasActiveMeshJob = false; } else { meshGenerationQueue.Remove(jobToRemove.ToMeshJob()); } } else { generationQueue.Remove(jobToRemove); } }