public static void SetParent(Transform t, Transform parent)
{
if ((object)t.parent == (object)t)
return;
#if (UNITY_4_6 || UNITY_4_7 || UNITY_5)
t.SetParent(parent, false);
#else
Vector3 p = t.localPosition;
Vector3 s = t.localScale;
Quaternion q = t.localRotation;
t.parent = parent;
t.localPosition = p;
t.localScale = s;
t.localRotation = q;
#endif
}