city-generation/ProceduralTerrain/Assets/Scripts/HeightmapGenerator.cs

28 lines
486 B
C#
Raw Normal View History

2015-03-03 16:47:18 +00:00
using UnityEngine;
using System.Collections;
public class HeightmapGenerator : MonoBehaviour
{
public int Width = 100, Height = 100;
public float[,] Mesh;
// Use this for initialization
void Start ()
{
Mesh = new float[Width, Height];
// Initialize with perlin noise
for (int x = 0; x < Width; ++x)
for (int y = 0; y < Height; ++y)
Mesh [x, y] = Mathf.PerlinNoise (x, y);
// Generate mesh
}
// Update is called once per frame
void Update ()
{
}
}