2.1.2版本。两个不同ccb创建的精灵texture id 是一样的,导致不能用ccspritebatchnode是怎么回事!!
case 101: { node = (Guai*)ccbReader->readNodeGraphFromFile("ptjs1.ccbi", layer); if (fujiedian1==NULL) { fujiedian1=CCSpriteBatchNode::create("ccbResources/ptjs1.png"); layer->addChild(fujiedian1); } CCLog("guai1,%d",node->getTexture()->getName()); CCLog("fujiedian1,%d",fujiedian1->getTexture()->getName()); fujiedian1->addChild(node); break; } case 102: { node = (Guai*)ccbReader->readNodeGraphFromFile("ptjs2.ccbi", layer); if (fujiedian2==NULL) { fujiedian2=CCSpriteBatchNode::create("ccbResources/ptjs2.png"); layer->addChild(fujiedian2); } CCLog("guai2,%d",node->getTexture()->getName()); CCLog("fujiedian2,%d",fujiedian2->getTexture()->getName()); fujiedian2->addChild(node); ``` 输出是 Cocos2d: guai1,1 Cocos2d: fujiedian1,1 Cocos2d: guai2,1 Cocos2d: fujiedian2,3