EnumExtensions

Author: Juan Manuel Palacios

Overview
This script provides an instance TryParse method for .Net's System.Enum class, analogous to the non-exception-throwing TryParse methods that other .Net built-in types provide. As opposed to those, though, this extension method is an instance method, due to the very nature of C# extension methods themselves.

Note that .Net 4.0 does provide an out-of-the-box Enum.TryParse method, but that's currently not available to Unity users as of its 3.4.2 release.

Usage
Put the EnumExtensions.cs script in the Extensions folder in your Unity project and use the resulting instance TryParse method according to the code sample below.