Apply texture to terrain based on height

Hi
Basically I have a large piece of terrain that I want to apply certain textures based on height, for example. Grass at level 2, Cliff at level 3 and Snow at level 4.

I can attempt to do this manually but it would be untidy and take more time that its worth.

I’ve had a small look on the unity help pages but there doesn’t seem to be any documentation that helps with this. Is there code for this or will I have to paint it manually?

I wrote code on my blog to do this: