More Related Content
More from Je Lyoung Kim (10)
Ngui3 5 5_example_5_기타정리
- 2. 2
Keep within panel
테이블/그리드 등의 변화 알림을 부모 컨테이너가 받을지 말지 여부
public virtual void Reposition ()
{
...
if (keepWithinPanel && mPanel != null)
{
mPanel.ConstrainTargetToBounds(myTrans, true);
UIScrollView sv = mPanel.GetComponent<UIScrollView>();
if (sv != null) sv.UpdateScrollbars(true);
}
if (onReposition != null)
onReposition();
}
UIGrid / UITable 공통
- 3. 3
플래그를 바로 설정(강제 포지션 처리)
public bool repositionNow { set { if (value) { mReposition = true; enabled = true; } } }
//초기화가 안끝난 상태에서만 플래그를 설정 -> 대략 초기화 끝난후 아무리 불러도 소용없음
public void Reposition ()
{
if (Application.isPlaying && !mInitDone && NGUITools.GetActive(this))
{
mReposition = true;
업데이트에서 항상 리포지션을 시도함으로, Reposition()은 초기화가 끝나면 자동으로 1번은
수행된다 할 수 있음.
void Update ()
{
if (mReposition) Reposition();
enabled = false;
}
Reposition / RepositionNow