Updated code for Unity 4.6b20