public void SortWorldSpacePanelsByZOrder(int panelSortingOrder) { if (sTempList1 == null) { sTempList1 = new List<DisplayObject>(); sTempList2 = new List<int>(); } int numChildren = Stage.inst.numChildren; for (int i = 0; i < numChildren; i++) { Container obj = Stage.inst.GetChildAt(i) as Container; if (obj == null || obj.renderMode != RenderMode.WorldSpace || obj._panelOrder != panelSortingOrder) continue; //借用一下tmpBounds obj._internal_bounds.x = obj.cachedTransform.position.z; obj._internal_bounds.y = i; sTempList1.Add(obj); sTempList2.Add(i); } sTempList1.Sort(CompareZ); ChangeChildrenOrder(sTempList2, sTempList1); sTempList1.Clear(); sTempList2.Clear(); }
static public int SortWorldSpacePanelsByZOrder(IntPtr l) { try { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); System.Int32 a1; checkType(l, 2, out a1); self.SortWorldSpacePanelsByZOrder(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }