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()를 사용할 것을 유니티에서 요구하고 있다.
'UnityEngine > API 스크립팅' 카테고리의 다른 글
[Find 메서드] Find, GetChild, GetInstanceID (0) | 2018.06.12 |
---|---|
[트랜스폼 메서드] Translate, Rotate, TransformDirection (0) | 2018.06.10 |
[쿼터니언 메서드] Quaternion... (0) | 2018.06.10 |
[트랜스폼 속성] position, scale, rotation, eulerAngles (0) | 2018.06.09 |
[백터 속성과 메서드] Properties, magnitude, nomalized (0) | 2018.06.05 |