using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Underwater : MonoBehaviour
{

    public Color ColorNormal;
    public Color ColorFog;

    void Start()
    {
        
    }


    void Update()
    {
        if (transform.position.y < 0f)
        {
            RenderSettings.fogColor = ColorFog;
            RenderSettings.fogDensity = 0.1f;
        }
        else
        {
            RenderSettings.fogColor = ColorNormal;
            RenderSettings.fogDensity = 0f;
        }
    }

}
