title: Get only the parent fields from an inherited class
body: <p>I have a class called Stats</p>
  <pre><code>public class Stats : ScriptableObject
  {
      public double vitality;   
      public double stamina;     
      public double endurance; 
  } 
  </code></pre>
  <p>I also have a class that inherits Stats</p>
  <pre><code>public class Equipment : Stats
  {
      public string name;
      // other fields that define equipment
  } 
  </code></pre>
  <p>I want to be able to get all the fields from the instance of Stats that is inherited from Equipment</p>
  <p>So I added this in an Interface class</p>
  <pre><code>    public void AddStats(Equipment equippedItem)
      {
          Stats stats = equippedItem as Stats;
          if (stats != null)
          {
              GetPropertyValues(stats);
          }
      }
     public static void GetPropertyValues(System.Object obj)
     {
          Type t = obj.GetType();
          FieldInfo[] fis = t.GetFields(BindingFlags.Instance | BindingFlags.Public);
          foreach (var fieldInfo in fis)
                  Debug.Log(fieldInfo.FieldType + &quot; &quot; + fieldInfo.Name + &quot; &quot; + fieldInfo.GetValue(obj));
     }
  </code></pre>
  <p>The issue is that it is getting all the fields from the Equipment as well.</p>
  <p>How could I make it so that only gets the fields from Stats?</p>