public void FormatPos(BaseOrder order = null) { m_order_list.Sort(); Vector3 temp_pos; BaseOrder temp_order; for (int idx = 0; idx < m_order_list.Count; idx++) { temp_pos = CaculPos(idx); temp_order = m_order_list[idx]; if (order == temp_order || temp_order.holderPos == temp_pos || Vector3.Distance(temp_pos, temp_order.transform.localPosition) <= 1) { continue; } temp_order.holderPos = temp_pos; MoveOrder(temp_order, temp_pos); } var rect = transform as RectTransform; if (rect.sizeDelta.y != contentHeight) { rect.sizeDelta = new Vector2(rect.sizeDelta.x, contentHeight); } }
private void MoveOrder(BaseOrder order, Vector3 pos) { order.transform.DOLocalMove(pos, (float)0.3).onComplete = () => { order.holderPos = BADPOS; }; }
public void PreInsert(BaseOrder obj_base_order) { obj_base_order.gameObject.transform.SetParent(transform); m_order_list.Add(obj_base_order); }