So I have an Attribute that I am putting on various fields.
Inside of the instance of the Attribute class, I would like to find out the value of the field it was placed on. Is that possible?
This seems like it shouldn't be terribly hard, but I seem to see no answers anywhere.
Here is a rough example of what I want:
[AttributeUsage(AttributeTargets.Field)]
public class AssetRestriction : Attribute
{
public bool ValidateAsset(Object obj)
{
return obj is -Type of the Field which this attribute is on-
}
}
These attributes are used to extend another closed system, so I don't have access to what called the ValidateAsset method to also pass in the field.