public void InitFocusing(UIScrollView focusScroll, UITableLayout grid, Action <Transform> focusCallback = null) { scalingCoverage = Vector3.Distance(focusCenter.position, coverRadius.position); if (focusScroll == null) { return; } if (scroll != null) { scroll.onDragFinished -= FocusTarget; } this.grid = grid; this.scroll = focusScroll; this.focusCallback = focusCallback; if (scroll.isActiveAndEnabled) { FocusTarget(); scroll.onDragFinished += FocusTarget; } if (null == restrictObj) { CreateRestrictObject(); } }
protected override void Preprocess(Component comp) { UITableLayout layout = comp as UITableLayout; Deactivate(layout.rowPrefab); Deactivate(layout.columnPrefab); Deactivate(layout.defaultPrefab); }
void OnEnable() { UITableLayout grid = (UITableLayout)target; inspector = new UITableLayoutInspectorImpl(grid); inspector.OnEnable(); SerializedObject obj = new SerializedObject(grid); varInspector = new SerializedInspector(obj, "gizmoColor"); }
void OnEnable() { if (grid == null) { grid = GetComponent <UITableLayout>(); } if (grid != null) { grid.AddListener(this); } }
public override void OnEnable() { GameObject sel = Selection.activeGameObject; if (sel != null) { UITableLayout layout = sel.GetComponent <UITableLayout>(); if (layout != null) { grid = layout; SetLayout(grid); } } }
/// <summary> /// Default behaviour for the Label, Slider, Sprite /// </summary> /// <param name="t">T.</param> /// <param name="val">Value.</param> /// <param name="status">Status.</param> public static void SetValue(UITableLayout grid, UITableCell c, int row, int column, object val, Action <UITableCell> initFunc = null) { if (c != null) { c.containerGrid = grid; c.row = row; c.column = column; c.SetCell(val, initFunc); } else { c.go.SetActive(val != null); } }
/** * Row중 UILabel인 경우 text color를 바꾸어준다. * @param row row 값은 title row를 포함한 실제 row번호(zero-based) */ public static void SetRowColor(this UITableLayout table, int row, Color color) { string colorStr = NGUIUtil.ConvertColor2Str(color); for (int col = table.columnHeader; col < table.columnCount; col++) { UITableCell c = table.GetCell(row + table.rowHeader, col); if (c != null) { UILabel label = c.GetComponent <UILabel>(); if (label != null) { label.SetText(colorStr + label.text); } } } }
public static void RepositionNow(Transform trans) { UILayout layout = trans.GetComponent <UILayout>(); /* Grid일 경우 Grid에 추가된 순서대로 update한다. */ if (layout is UITableLayout) { UITableLayout grid = (UITableLayout)layout; foreach (var child in grid.components) { if (child == null) { continue; } if (child.go.activeSelf) { RepositionNow(child.transform); } } } else { for (int i = 0; i < trans.childCount; i++) { Transform child = trans.GetChild(i); if (child.gameObject.activeSelf) { RepositionNow(child); } } } if (layout != null && layout.enabled) { layout.Reposition(); } }
public void SetLayout(UITableLayout grid) { this.grid = grid; this.inspector = new UITableLayoutInspectorImpl(grid); this.inspector.OnEnable(); }
public void SetLayout(UITableLayout table) { this.table = table; this.inspector = new UITableLayoutInspectorImpl(table); this.inspector.OnEnable(); }
public UITableLayoutInspectorImpl(UITableLayout grid) { this.grid = grid; }