Transform.forward, right, up

public Vector3 right{ get; set; }  오른쪽 방향 (x 축 중심이 향하는 positive 방향, 레드 화살표)

public Vector3    up{ get; set; }     위쪽 방향 (y 축 중심이 향하는 positive 방향, 그린 화살표)

public Vector3 forward{ get; set; }  앞쪽 방향 (z 축 중심이 향하는 positive 방향, 블루 화살표)


Transform.childCount

public int childCount { get; } 트랜스폼이 가지는 자식 트랜스폼의 수를 나타낸다.


Transform.parent, SetParent

public Transform parent { get; set; } 해당 객체의 부모를 가져오거나 set으로 변경한다. 부모와의 상대적인 관계에서 position scale position이 따라 바뀐다.
public void SetParent(Transform parent); 변경할 부모 객체를 설정한다. 

public void SetParent(Transform parent, bool worldPositionStays); 이 메서드가 parent와 다른 것은 트랜스폼이 글로벌 방향이 아닌 로컬 방향을 유지하도록 한다

(If true, the parent-relative position, scale and rotation are modified such that the object keeps the same world space position, rotation and scale as before.)

그리고 Rectransform 사용할 때 UI의 일반적인 스케일링 문제로  worldPositionStays를 false 로 하여 SetParent()를 사용할 것을 유니티에서 요구하고 있다.


+ Recent posts