Пример #1
0
        private void MakePerlinTerrain()
        {
            Vector3[] vertices = chunk.Vertices;
            int       i        = 0;

            for (int y = 0; y < Resolution; y++)
            {
                for (int x = 0; x < Resolution; x++)
                {
                    float height = terrainController.generator.GetNoiseValue(transform.position, new Vector2Int(x, y));
                    height  = Mathf.Max(Settings.MinLevel, height);
                    height *= Modifier;
                    Settings.SetMax(height);
                    Settings.SetMin(height);
                    vertices[i].y = height;
                    i++;
                }
            }

            chunk.ChangeVertices(vertices);
        }