Enum.TryParse

Notice: The latest version of Unity supports .Net 4.0 which provides a builtin Enum.TryParse method.

This script provides a TryParse method for the .Net (3.0 or earlier) System.Enum class, analogous to the non-exception-throwing TryParse methods that other .Net built-in types provide. However this extension method is an instance method, due to the very nature of C# extensions.

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.