반응형

 

경고 전문
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.

→ 번역
RectTransform 의 부모는 부모 속성으로 설정됩니다. 대신 setParent 메서드를 사용하고 worldPositionStays 인수를 false로 설정하는 것이 좋습니다. 이렇게 하면 월드 방향과 스케일이 아닌 로컬 방향과 스케일이 유지되어 일반적인 UI 스케일 문제를 방지할 수 있습니다.

 

위의 경고문은  transform.parent 대신 transform.SetParent() 메서드를 사용을 권고하는 경고이다.

RectTransform에서 parent 사용 시 UI에 스케일링 관련 이슈가 있어 SetParent를 사용하는것을 권하고있다.

 

transform.parent = parent_panel; //경고의 원인

transform.SetParent(parent_panel); //이와 같이 SetParent()메서드로 변경해서 사용

 

반응형

+ Recent posts