28 lines
486 B
C#
28 lines
486 B
C#
|
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 ()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
}
|