Determine iPhone Type (3G vs 3GS)

Is there a way to tell the difference between a 3G and a 3GS from within script? More generally, is there a way to determine the exact hardware/device type the game is currently runnning on?

Currently I use the resolution and that only tells me whether it's iPhone 4 vs 3G/3GS.

Finally found the answer, just after posting here :)

http://unity3d.com/support/documentation/ScriptReference/iPhoneGeneration.html