Updated for Unity 4.1