public void AddHeightmapToStack(float[,] heightmap) { heightmap = (float[, ])heightmap.Clone(); HeightmapRenderer newRenderer = Instantiate(heightmapRendererPrefab, transform).GetComponent <HeightmapRenderer>(); newRenderer.RenderHeightmap(heightmap); heightmapStack.Insert(0, newRenderer); }
void CombineHeightmaps(float[,] result) { if (heightmapStack.Count < 2) { print("Cant combine as there are less than 2 heightmaps in the stack"); return; } HeightmapRenderer top = heightmapStack[heightmapStack.Count - 1]; HeightmapRenderer newTop = heightmapStack[heightmapStack.Count - 2]; top.CombineTo(newTop.transform, transitionTime); newTop.CombineFrom(result, transitionTime); heightmapStack.Remove(top); //StartCoroutine(MoveCameraVerticallyRoutine(-spacing, transitionTime)); }