Cocos2dx 不能运行Spine导出的spineboy,求解

用Spine导出的 .atlas .json .png三个文件加入项目中,

然后根据:

m_pSkeletonNode = CCSkeletonAnimation::createWithFile("Spine/spineboy.json", "Spine/spineboy.atlas");

m_pSkeletonNode->setMix("walk", "jump", 0.4f);

m_pSkeletonNode->setMix("jump", "walk", 0.4f);

m_pSkeletonNode->setAnimation("walk", true);

m_pSkeletonNode->timeScale = 0.3f;

m_pSkeletonNode->debugBones = true;

m_pSkeletonNode->runAction(CCRepeatForever::create(CCSequence::create(CCFadeOut::create(1),CCFadeIn::create(1),CCDelayTime::create(5),NULL)));

CCSize windowSize = CCDirector::sharedDirector()->getWinSize();

m_pSkeletonNode->setPosition(ccp(windowSize.width / 2, 20));

addChild(m_pSkeletonNode);


这点代码准备运行一下这个Demo;

然后奇迹的事情发生了;

代码Crash在了:1 ,CCAssert(m_uReference > 0, "reference count should greater than 0");

2, void _AtlasPage_disposeTexture (AtlasPage* self) {

((CCTextureAtlas*)self->rendererObject)->release();

}


因为第一次使用Spine,还请会的朋友指点一下。

会不会是cocos2dx读取对应的Spine文件 版本不一致造成的。这个只是我的一个猜测。

我试过用2.1.5 2.2.5 3.0这几个版本都出现了这样的问题。

求助~

应该是的,我今天运行过,json文件

新的spine是

"skins": {

"default": {

"bb-head": {

"bb-head": {

"type": "boundingbox",

"vertices": 77.2608, -53.82651, 105.80151, -32.42244, 58.433777, 40.348133, 5.8296814, 37.007954, -7.0167694, -42.236595 ]

}

},

老的spine的json是

"skins": {

"default": {

导致解析到这里出问题了,cocos2dx3.2版本支持解析新的json。

我是3.2的,解析也是失败的