/// <summary>
        /// Works the same as <see cref="GenerateCoroutine"/> without the
        /// yield instructions. Runs synchronously.
        /// </summary>
        /// <param name="remapMin"></param>
        /// <param name="remapMax"></param>
        private void GenerateEditor(float remapMin = 0f, float remapMax = 1f)
        {
            TerraConfig.Log($"Started tile {GridPosition.ToString()}");

            //Make & set heightmap
            MeshManager.CalculateHeightmap(GridPosition, remapMin, remapMax);

            MeshManager.SetTerrainHeightmap();
            MeshManager.SetVisible();

            //Create TilePaint object
            TilePaint painter = new TilePaint(this);

            //Make biomemap
            int[,] map = painter.GetBiomeMap();

            //Paint terrain
            painter.Paint(map);

            //Apply details to terrain
            // ReSharper disable once IteratorMethodResultIsIgnored
            ApplyDetails(painter, map);
            MeshManager.SetVisible(true);

            TerraConfig.Log("Completed tile " + GridPosition);
        }
        private IEnumerator GenerateCoroutine(Action onComplete, float remapMin = 0f, float remapMax = 1f)
        {
            TerraConfig conf = TerraConfig.Instance;

            TerraConfig.Log("Started tile " + GridPosition);

            //Make & set heightmap
            bool madeHm = false;

            MeshManager.CalculateHeightmapAsync(remapMin, remapMax, () => madeHm = true);
            while (!madeHm)
            {
                yield return(null);
            }

            MeshManager.SetTerrainHeightmap();
            MeshManager.SetVisible();

            //Create TilePaint object
            TilePaint painter = new TilePaint(this);

            //Make biomemap
            bool madeBm = false;

            int[,] map = null;
            conf.Worker.Enqueue(() => map = painter.GetBiomeMap(), () => madeBm = true);
            while (!madeBm)
            {
                yield return(null); //Skip frame until biomemap made
            }
            //Paint terrain
            bool madePaint = false;

            yield return(StartCoroutine(painter.PaintAsync(map, () => madePaint = true)));

            while (!madePaint)
            {
                yield return(null);
            }

            //Apply details to terrain
            bool madeDetails = false;

            yield return(StartCoroutine(ApplyDetails(painter, map, () => madeDetails = true)));

            while (!madeDetails)
            {
                yield return(null);
            }

            MeshManager.SetVisible(true);

            TerraConfig.Log("Completed tile " + GridPosition);
            onComplete();
        }