PillowFight/Assets/Test/LightOnOff.cs
RosimInc 6b2560b294 Created light with mom's shadow, and a test scene with opening door.
Signed-off-by: RosimInc <rosim_inc@hotmail.com>
2015-08-22 14:24:18 -04:00

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;
}
}