title: Unity 3d - Tags or Overloaded functions?
body: <p>I have a theoretical question:
  I have 2 scenes, Galaxy and SolarSystem. Each scene calls a GUI related function to display currently selected object. The galaxy will be passing a GameoOject that is essentially a GalacticItem prefab and SolarSystem will be passing a GameObject SolarSystemItem prefab. My team has a bit of a discussion about the way to solve this:</p>
  
  <p><strong>Method 1:</strong>
  Tag each prefab and in the function have an <code>If</code> statement differentiating between one prefab and another to do its task</p>
  
  <p><strong>Method 2:</strong>
  Have an overloaded function: one with a Galaxy prefab as a parameter and the other with a SolarSystem prefab. </p>
  
  <p>Which method makes more sense and why?</p>
  
  <p>Thank you</p>
  
  <p><strong>Edit 1:</strong> </p>
  
  <p>Is there a performance benefits of using one method vs the other?</p>
  
  <p>Is there a maintenance issue of using strings/tags (method 1) to be concerned about? IE: imagine I have to rename the tag for SolarSystem prefab from "SolarSystem" to "StellarObject". Now I have to change code in every place it references "SolarSystem" as a string to "StellarObject". This is a risk, because there is a chance a programmer will miss something and it will not be caught at compilation time. </p>
  
  <p>Is Method 1 really is a proper way to use tags? Or are tags there only to id a specific object via <code>GameObject.FindWithTag</code>?</p>