2013 May 29 - 22:59 LightmapLightApproximator.cs for Unity

An alternative to lightprobes for Unity Basic.

For my forklift project I don’t think it’s worth to invest 4500usd to buy Unity Pro with iOS & Android support. I don’t really expect to make much money from it. It’s mostly just for fun and to learn some Unity.
Since lightprobes is a Pro feature I needed something else to adapt the lighting on the forklift according to the shadows in the level.
So I created this script, it casts one or more rays from the forklift onto the ground, and then picks the color from the lightmap at that point, and then applies that value to the intensity settings of the lights that are lighting the forklift. It works pretty good.
If you give it more than one transform to cast a ray from it will use the average intensity.

You might want to use LayerMask to exclude some objects.

A poor man’s lightprobes: C# class

An example:
lightmap unity