- Изменено
when i wana get an otherone with constructor
createWithFile("spineboy.json", "spineboy.atlas")
i tryed to create two SkeltonAnimation object with same file like"spineboy".
but it's not work. some bugs..in update
void CCSkeletonAnimation::update (float deltaTime) {
super::update(deltaTime);
deltaTime *= timeScale;
for (std::vector<AnimationState*>::iterator iter = states.begin(); iter != states.end(); ++iter) {
AnimationState_update(*iter, deltaTime); //this line
AnimationState_apply(*iter, skeleton);
}
Skeleton_updateWorldTransform(skeleton);
}
but, if addChild in one CCNode then no bug..
how can i get a same one?
If I add this to the end of the spineboy example it works fine:
CCSkeletonAnimation* skeletonNode2 = CCSkeletonAnimation::createWithFile("spineboy.json", "spineboy.atlas");
skeletonNode2->setAnimation("walk", true);
addChild(skeletonNode2);
try remove this line skeletonNode2->setAnimation("walk", true);
That also works fine. The second spineboy doesn't walk, just stands in the setup pose.
oh no. sorry...
it's caused by a pointer error it's works fine。