public int rebuildIndexInOrder(CCSprite pobParent, int uIndex) { List <Node> pChildren = pobParent.Children; if (pChildren != null && pChildren.Count > 0) { CCObject pObject = null; for (int i = 0; i < pChildren.Count; i++) { pObject = pChildren[i]; CCSprite pChild = pObject as CCSprite; if (pChild != null && (pChild.ZOrder < 0)) { uIndex = rebuildIndexInOrder(pChild, uIndex); } } } // ignore self (batch node) if (!pobParent.Equals(this)) { pobParent.atlasIndex = uIndex; uIndex++; } if (pChildren != null && pChildren.Count > 0) { CCObject pObject = null; for (int i = 0; i < pChildren.Count; i++) { pObject = pChildren[i]; CCSprite pChild = pObject as CCSprite; if (pChild != null && (pChild.ZOrder >= 0)) { uIndex = rebuildIndexInOrder(pChild, uIndex); } } } return(uIndex); }
public int rebuildIndexInOrder(CCSprite pobParent, int uIndex) { List <CCNode> children = pobParent.children; if ((children != null) && (children.Count > 0)) { CCObject obj2 = null; for (int i = 0; i < children.Count; i++) { obj2 = children[i]; CCSprite sprite = obj2 as CCSprite; if ((sprite != null) && (sprite.zOrder < 0)) { uIndex = this.rebuildIndexInOrder(sprite, uIndex); } } } if (!pobParent.Equals(this)) { pobParent.atlasIndex = uIndex; uIndex++; } if ((children != null) && (children.Count > 0)) { CCObject obj3 = null; for (int j = 0; j < children.Count; j++) { obj3 = children[j]; CCSprite sprite2 = obj3 as CCSprite; if ((sprite2 != null) && (sprite2.zOrder >= 0)) { uIndex = this.rebuildIndexInOrder(sprite2, uIndex); } } } return(uIndex); }
public int RebuildIndexInOrder(CCSprite pobParent, int uIndex) { RawList<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) { List<CCNode> pChildren = pobParent.children; if (pChildren != null && pChildren.Count > 0) { CCObject pObject = null; for (int i = 0; i < pChildren.Count; i++) { pObject = pChildren[i]; CCSprite pChild = pObject as CCSprite; if (pChild != null && (pChild.zOrder < 0)) { uIndex = rebuildIndexInOrder(pChild, uIndex); } } } // ignore self (batch node) if (!pobParent.Equals(this)) { pobParent.atlasIndex = uIndex; uIndex++; } if (pChildren != null && pChildren.Count > 0) { CCObject pObject = null; for (int i = 0; i < pChildren.Count; i++) { pObject = pChildren[i]; CCSprite pChild = pObject as CCSprite; if (pChild != null && (pChild.zOrder >= 0)) { uIndex = rebuildIndexInOrder(pChild, uIndex); } } } return uIndex; }