Показать сообщение отдельно
Старый 20.08.2016, 17:22   #3
Жека
Дэвелопер
 
Регистрация: 04.09.2005
Адрес: Красноярск
Сообщений: 1,376
Написано 491 полезных сообщений
(для 886 пользователей)
Ответ: Decompiled Unity5.3 (c#)

А вот кастинг типа при каждой установке свойства в классе 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.
(Offline)
 
Ответить с цитированием
Сообщение было полезно следующим пользователям:
Mimi Neko (06.02.2017)