Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class fog_control : MonoBehaviour {
- public float density = 0;
- private void OnTriggerEnter(Collider other)
- {
- if(other.tag == "Player")
- {
- RenderSettings.fogColor = Color.blue;
- RenderSettings.fogDensity = density;
- if(this.gameObject.tag == "on")
- {
- RenderSettings.fog = true;
- }
- else if(this.gameObject.tag == "off")
- {
- RenderSettings.fog = false;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment