static public T FindInParents<T> (GameObject go) where T : Component
{
if (go == null) return null;
#if UNITY_FLASH
object comp = go.GetComponent<T>();
#else
T comp = go.GetComponent<T>();
#endif
if (comp == null)
{
Transform t = go.transform.parent;
while (t != null && comp == null)
{
comp = t.gameObject.GetComponent<T>();
t = t.parent;
}
}
#if UNITY_FLASH
return (T)comp;
#else
return comp;
#endif
}