GetProperties returns Unity props instead of my class

Unity 5.01. I have an object Owner (of type object) that is a reference to an instance of my Breed class, derived from MonoBehaviour. Calling GetProperties on any permutation (cast, “as Breed”'d, directly on the Owner object, “this” from the actual class, GetComponent from the actual class) of the Owner object returns some Unity props, like audio, light, etc. Gleaned from the Monodevelop debugger. The Owner property shows of the props I actually want to see, but the array of PropertyInfo is different.


public class Breed : MonoBehaviour {

//loads of bools, strings, etc. of many different levels of accessibility

//here's the problem--no accessors. If I had included this in my example someone would have figured this out
public int example1;

void Update () {

//no good!

    if (getprops) {

        PropertyInfo[] piArray = this.GetType().GetProperties();




This basically led me to figuring it out: C# Reflection GetProperties returning unwanted info - Unity Answers

I didn’t expect the derived properties and I wasn’t paying attention to the difference between a field and a property. It seemed like I was somehow repeatedly calling GetProperties on the wrong object behind the scenes, regardless of how I accessed it because I kept getting the same set of properties.

I’d say thanks for the help, but I just got the “I don’t understand your question, but that won’t stop me…” stuff I expected.