Shamba

fog_control

Mar 18th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class fog_control : MonoBehaviour {
  6.     public float density = 0;
  7.     public Color fogcolor = Color.blue;
  8.     public bool fogstate = true;
  9.  
  10.     private void OnTriggerEnter(Collider other)
  11.     {
  12.         if(other.tag == "Player")
  13.         {
  14.             RenderSettings.fogColor = fogcolor;
  15.             RenderSettings.fogDensity = density;
  16.             RenderSettings.fog = fogstate;
  17.         }
  18.     }
  19. }
Add Comment
Please, Sign In to add comment