А вот кастинг типа при каждой установке свойства в классе Transform
public Transform parent
{
get
{
return this.parentInternal;
}
set
{
if (this is RectTransform)
{
Debug.LogWarning("Parent of RectTransform is being set with parent property. Consider using the SetParent method instead, with the worldPositionStays argument set to false. This will retain local orientation and scale rather than world orientation and scale, which can prevent common UI scaling issues.", this);
}
this.parentInternal = value;
}
}
Почему бы в сеттер не воткнуть SetParent.