해당 Object의 부모를 매개변수로 받은 transform으로 설정하는 것.
public void SetParent(Transform parent);
public void SetParent(Transform parent, bool worldPositionStays);
Transform parent : 부모로 두고 싶은 Transform
bool worldPositionStays : true로 설정할 경우 기존의 world 좌표를 유지한 상태로 유지됨.
Transform.Parent를 사용하면 world 좌표(크기 및 방향)가 유지되거나 local 좌표가 유지되는 걸 선택할 수 있다. 이게 제일 큰 이유이다. 특히 UI 작업시 local 좌표가 유지되어야 하는 경우가 많은데 이 때 생기는 문제를 방지할 수 있다.
https://docs.unity3d.com/kr/530/ScriptReference/Transform.SetParent.html