333GameStudio

FLonoff

Feb 15th, 2016
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var on : boolean = false;
  2.  var shine : GameObject;
  3.  function Update()
  4.  {
  5.      if(Input.GetKeyDown(KeyCode.F))
  6.      var audio: AudioSource = GetComponent.<AudioSource>();
  7.     audio.Play();
  8.          on = !on;
  9.          
  10.      if(on)
  11.          shine.SetActive(true);
  12.        
  13.      if(!on)
  14.        shine.SetActive(false);
  15.        
  16.  }
Advertisement
Add Comment
Please, Sign In to add comment