22 lines
630 B
C#
22 lines
630 B
C#
|
|
using UnityEngine;
|
|
|
|
public class FogController : MonoBehaviour
|
|
{
|
|
public bool enableFog = true;
|
|
public Color fogColor = Color.gray;
|
|
public FogMode m_fogMode = FogMode.Linear;
|
|
public float fogDensity = 0.02f;
|
|
public float startDistance = 0.0f;
|
|
public float endDistance = 100.0f;
|
|
|
|
private void OnEnable()
|
|
{
|
|
RenderSettings.fog = enableFog;
|
|
RenderSettings.fogMode = m_fogMode;
|
|
RenderSettings.fogColor = fogColor;
|
|
RenderSettings.fogDensity = fogDensity;
|
|
RenderSettings.fogStartDistance = startDistance;
|
|
RenderSettings.fogEndDistance = endDistance;
|
|
}
|
|
} |