zfdave
1
I want to use the method “Enum.TryParse()” (which in NET4.0),
it build successful in MonoDevelop-Unity,
but UnityEditor got an error “error CS0117: System.Enum' does not contain a definition for TryParse’”
(My Unity version is 4.5.2f1)
Dose lastest version support it?
Eric5h5
2
No, Unity uses Mono 2.6, which is approximately .NET 3.5 and does not have Enum.TryParse.
Late help : but its answered in this post (by Thorarin). Just needed it too 
public static TEnum ToEnum<TEnum>(this string strEnumValue, TEnum defaultValue)
{
if (!Enum.IsDefined(typeof(TEnum), strEnumValue))
return defaultValue;
return (TEnum)Enum.Parse(typeof(TEnum), strEnumValue);
}