public int RebuildIndexInOrder(CCSprite pobParent, int uIndex) { CCRawList <CCNode> pChildren = pobParent.Children; if (pChildren != null && pChildren.Count > 0) { CCNode[] elements = pChildren.Elements; for (int i = 0, count = pChildren.Count; i < count; i++) { if (elements[i].ZOrder < 0) { uIndex = RebuildIndexInOrder((CCSprite)pChildren[i], uIndex); } } } // ignore self (batch node) if (!pobParent.Equals(this)) { pobParent.AtlasIndex = uIndex; uIndex++; } if (pChildren != null && pChildren.Count > 0) { CCNode[] elements = pChildren.Elements; for (int i = 0, count = pChildren.Count; i < count; i++) { if (elements[i].ZOrder >= 0) { uIndex = RebuildIndexInOrder((CCSprite)elements[i], uIndex); } } } return(uIndex); }
public int RebuildIndexInOrder(CCSprite pobParent, int uIndex) { CCRawList<CCNode> pChildren = pobParent.Children; if (pChildren != null && pChildren.Count > 0) { CCNode[] elements = pChildren.Elements; for (int i = 0, count = pChildren.Count; i < count; i++) { if (elements[i].ZOrder < 0) { uIndex = RebuildIndexInOrder((CCSprite) pChildren[i], uIndex); } } } // ignore self (batch node) if (!pobParent.Equals(this)) { pobParent.AtlasIndex = uIndex; uIndex++; } if (pChildren != null && pChildren.Count > 0) { CCNode[] elements = pChildren.Elements; for (int i = 0, count = pChildren.Count; i < count; i++) { if (elements[i].ZOrder >= 0) { uIndex = RebuildIndexInOrder((CCSprite) elements[i], uIndex); } } } return uIndex; }