static CCAffineTransform NodeToB2BodyTransform(CCNode node)
        {
            CCAffineTransform transform = CCAffineTransform.Identity;

            for (CCNode n = node;
                 n != null && n.GetType() != typeof(LHGameWorldNode)
//				&& ![n isKindOfClass:[LHBackUINode class]]
//				&& ![n isKindOfClass:[LHUINode class]]
                 ;
                 n = n.Parent)
            {
                transform = CCAffineTransform.Concat(transform, n.AffineLocalTransform);
            }
            return(transform);
        }
        public override void Visit(ref CCAffineTransform parentWorldTransform)
        {
            if (positionsAreDirty)
            {
                UpdatePositions();
                AdjustScale9ImagePosition();
                positionsAreDirty = false;
            }

            var localTransform = AffineLocalTransform;
            var worldTransform = CCAffineTransform.Identity;

            CCAffineTransform.Concat(ref localTransform, ref parentWorldTransform, out worldTransform);

            if (isScale9Enabled)
            {
                for (var j = 0; j < protectedChildren.Count; j++)
                {
                    var node = protectedChildren[j] as CCSprite;

                    if (node != null)
                    {
                        node.Visit(ref worldTransform);
                    }
                    else
                    {
                        break;
                    }
                }
            }
            else
            {
                if (scale9Image != null)
                {
                    scale9Image.Visit(ref worldTransform);
                }
            }

            base.Visit(ref parentWorldTransform);
        }
 static CCAffineTransform b2BodyToParentTransform(CCNode node, LHPhysicsProtocolImp physicsImp)
 {
     return(CCAffineTransform.Concat(physicsImp.absoluteTransform(), CCAffineTransform.Invert(NodeToB2BodyTransform(node.Parent))));
 }