Light a room with the cursor

This script can be used to create a "flashlight" effect, where a light is shone in the scene where the cursor is pointing.

To use it:


 * 1) Create a new C# file named CursorLight.cs, and paste in the code below
 * 2) Create a Light in your scene (Spotlight if 3D, Point Light if 2D) and attach the new Cursor Light component
 * 3) Configure the Inspector, setting the light's default's state, and whether it's 3D or not.
 * 4) To turn on and off at runtime, use the Object: Send message Action to pass Turn On and Turn Off commands to the Light object

CursorLight.cs: