title: C# Unity: Get public classes in script attached to GameObject
body: <p>edit: Vanethrane brought my attention to the fact that I am already calling classes in my examples - but I'm looking for those who's name I cannot check manually (it is for this purpose unknown).</p>
  
  <p>Still new to reflections: I'm currently reading a bunch of properties and printing them - I'm eliminating the undesired ones by giving the ones I want a name with specific prefix. For example:</p>
  
  <pre><code>var elementProperties = new object();
  
  if(element.GetComponent&lt;MyFirstScript&gt;() != null)
      elementProperties = element.GetComponent&lt;MyFirstScript&gt;();
  else if(element.GetComponent&lt;MySecondScript&gt;() != null)
      elementProperties = element.GetComponent&lt;MySecondScript&gt;();
  else
          return;
  
  System.Reflection.PropertyInfo[] properties = elementProperties.GetType().GetProperties();
  
  for(int i = 0; i &lt; properties.Length; i++)
  {
      if(properties[i].Name.Substring(0, 3) != "my_")
          continue;
      //IF VARIABLE NAME STARTS WITH "my_" DO STUFF WITH properties[i].PropertyType OR GetValue ...
  }
  </code></pre>
  
  <p>The trouble is this doesn't automatically find classes. I thought it would better fit my needs if I would instead of searching by variable name, to make a class with extra variables such as bool isReadable = true; and some other neat information (isEditable, displayName etc.).</p>
  
  <p>So, how do I go about it in this context?</p>
  
  <p>Searching in entire GameObject as opposed to single scripts would work as well.</p>