mirror of
https://github.com/ConjureETS/PillowFight.git
synced 2026-03-24 17:10:59 +00:00
20 lines
373 B
C#
20 lines
373 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
[RequireComponent(typeof(Light))]
|
|
public class LightOnOff : MonoBehaviour {
|
|
|
|
private Light light;
|
|
|
|
// Use this for initialization
|
|
void Start () {
|
|
light = GetComponent<Light>();
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
if(Input.GetKeyDown(KeyCode.Space))
|
|
light.enabled = !light.enabled;
|
|
}
|
|
}
|