forked from BilalY/Rasagar
27 lines
606 B
C#
27 lines
606 B
C#
|
using UnityEngine;
|
||
|
|
||
|
public class TerrainTreeToggle : MonoBehaviour
|
||
|
{
|
||
|
private void OnEnable()
|
||
|
{
|
||
|
var terrains = Object.FindObjectsOfType<Terrain>();
|
||
|
foreach (Terrain terrain in terrains)
|
||
|
{
|
||
|
terrain.drawTreesAndFoliage = false;
|
||
|
}
|
||
|
|
||
|
RenderSettings.fogDensity = (float)0.0001;
|
||
|
}
|
||
|
|
||
|
private void OnDisable()
|
||
|
{
|
||
|
var terrains = Object.FindObjectsOfType<Terrain>();
|
||
|
foreach (Terrain terrain in terrains)
|
||
|
{
|
||
|
terrain.drawTreesAndFoliage = true;
|
||
|
}
|
||
|
|
||
|
RenderSettings.fogDensity = (float)0.0005;
|
||
|
}
|
||
|
}
|