From http://answers.unity3d.com/questions/331268/a-simple-animation-clip-scripting-control-example.html