Guest User

###

a guest
Apr 28th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Game : MonoBehaviour
  6. {
  7.     private Light myLight;
  8.     // Start is called before the first frame update
  9.     void Start()
  10.     {
  11.         myLight = GetComponent<Light>();
  12.     }
  13.  
  14.     // Update is called once per frame
  15.     void Update()
  16.     {
  17.         if (Input.GetKeyUp(KeyCode.Space))
  18.             myLight.enabled = !myLight.enabled;
  19.     }
  20. }
Add Comment
Please, Sign In to add comment