This is a C# version of the JS code in the raywenderlich.com unity tutorial