FTME01_LightVisible.js 254 B

1234567891011121314151617
  1. #pragma strict
  2. var myLight : Light;
  3. function Start ()
  4. {
  5. myLight = GetComponent(Light);
  6. }
  7. function Update () {
  8. if (Input.GetKeyDown(KeyCode.UpArrow)){
  9. if(myLight.intensity == 0)
  10. myLight.intensity = 0.4;
  11. else
  12. myLight.intensity = 0;
  13. }
  14. }