Cocostudio通过Json生成的Sprite怎么获取大小

高人,遇到问题了,在Cocostudio通过Json文件产生的Sprite怎么获取Size,怎么我获取的Size都是零,我如何做碰撞检测。

auto node = SceneReader::getInstance()->createNodeWithSceneFile(“Demomap/publish/RPGGame.json”);
if (node) {
this->addChild(node, 0);
}

auto hostCity = (node->getChildByTag(10004)->getChildByTag(10006)->getComponent("CCSprite")->getOwner());
auto vec = hostCity->getBoundingBox();
log("hostCity x %.2f y %.2f width %.2f height %.2f", hostCity->getPositionX(), hostCity->getPositionY(),
    vec.size.width, vec.size.height);

这个时候的getBoundingBox和getContentSize都是0.

auto node = SceneReader::getInstance()->createNodeWithSceneFile(“Demomap/publish/RPGGame.json”);
if (node) {
this->addChild(node, 0);
}

auto hostCity = (node->getChildByTag(10004)->getChildByTag(10006)->getComponent("CCSprite")->getOwner());
auto size = hostCity->getChildren().at(0)->getContentSize();
log("hostCity x %.2f y %.2f width %.2f height %.2f", hostCity->getPositionX(), hostCity->getPositionY(),
    size.width, size.height);

我自己解决了,不过这些代码也太奇怪了。真的不明白框架是怎么设计的?

node->getChildByTag(10004)->getChildByTag(10006)->getComponent(“CCSprite”)->getNode()->getContentSize();