Advertisement
Polarwinds

Flashlight

Oct 16th, 2014
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on : boolean = false;
  2.  
  3. function Update()
  4. {
  5.     if(Input.GetKeyDown(KeyCode.F))
  6.         on = !on;
  7.     if(on)
  8.         light.enabled = true;
  9.     if(!on)
  10.         light.enabled = false;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement