Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

revision1

using UnityEngine;
using System.Collections;

public class DemoScript : MonoBehaviour {

    public Light myLight;

    void Update () {
        if (Input.GetKey ("space")) {
            myLight.enabled = true;
        } else {
            myLight.enabled = false;
        }
    }
}
Source by learn.unity.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
4+3 =