我用的是0.4的版本,因为项目是之前做的,
我有一个骨骼动画mMoveAr,他包含了角色走动,站立,跳跃等动作,每个动作分为两个骨骼,角色和武器;
现在是要给角色换装
我是这样做的,首先是所有武器骨骼的名字数组
std::string movswordBone;
…
movswordBone = std::string(“jumpto_right_sword”);
movswordBone = std::string(“jumpto_left_sword”);
movswordBone = std::string(“stand_right_sword”);
movswordBone = std::string(“stand_left_sword”);
movswordBone = std::string(“move_right_end_sword”);
movswordBone = std::string(“move_right_ing_sword”);
movswordBone = std::string(“move_right_start_sword”);
movswordBone = std::string(“move_left_end_sword”);
movswordBone = std::string(“move_left_ing_sword”);
movswordBone = std::string(“move_left_start_sword”);
这个数组包含所有武器的骨骼……
然后是换装
for (int i = 0; i < 16; i++)
{
if (movswordBone*.length() <= 0)
break;
CCSpriteDisplayData* displayData=new CCSpriteDisplayData();
displayData->setParam(pEquipment->imageName.c_str());
CCBone* bone = mMoveAr->getBone(movswordBone*.c_str());
bone->addDisplay(displayData, 1);
bone->changeDisplayByIndex(1, true);
}
但是替换之后,就只一个动作的骨骼被替换了,其它的都和之前一样,,而且角色走动一会后,所有的都和之前一样了,为什么会这样呢
换装的代码我是在论坛上看的,不知道有没有什么理解错了,,,之前一个CCArmature只包含一个动作的时候,换装很正常,,求大神指教呀
**