Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Last active September 21, 2015 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unitycoder/79a986dcb810482c53af to your computer and use it in GitHub Desktop.
Save unitycoder/79a986dcb810482c53af to your computer and use it in GitHub Desktop.
Force Terrain Details DrawDistance over the 250 limit
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class ForceGrassDistanceInEditor : MonoBehaviour {
public float distance=250; // 250 is max in terrain settings, but not here
Terrain terrain;
void Start () {
terrain = GetComponent<Terrain>();
if (terrain==null)
{
Debug.LogError("This gameobject is not terrain, disabling forced details distance", gameObject);
this.enabled=false;
return;
}
}
// WARNING: this runs update loop inside editor, you dont need this if you dont change the value
void Update()
{
terrain.detailObjectDistance = distance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment