Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public float heightScale = 20f;
- public float detailScale = 20f;
- float seed;
- // Use this for initialization
- void Start()
- {
- //if (instance == null)
- // instance = this;
- for (int x = 0; x < mapSizeX; x++)
- {
- for (int z = 0; z < mapSizeZ; z++)
- {
- int y = (int)(Mathf.PerlinNoise((x + seed) / detailScale, (z + seed) / detailScale) * heightScale);
- GameObject g = Instantiate(grass) as GameObject;
- g.transform.position = new Vector3(x, y , z);
- g.transform.SetParent(this.transform);
- }
- }
- }`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement