public static string GetAssetPathByProperties(AssetPath p) { Type enumType = p.GetType(); FieldInfo[] fields = enumType.GetFields(); foreach (var field in fields) { if (field.Name.Equals(p.ToString())) { object[] attributes = field.GetCustomAttributes(typeof(AssetPathAttribute), true); if (attributes.Length > 0) { return(((AssetPathAttribute)attributes[0]).Path); } } } return(string.Empty); }