노드 서브 클래스에 두 개의 함수가 있습니다.이 함수는 동작으로 일부 애니메이션을 적용합니다. 하나가 실행 중이고 다른 함수가 호출되면 정상적으로 처리되도록하고 싶습니다. 그래서 나는 테스트를 만들었습니다 :지연 후 CallFunc가 호출되지 않습니다.
Monster * node = Monster::create();
addChild(node);
auto sequence1 = Sequence::create(CallFunc::create(std::bind(&Monster:: animateWalk, node)),
DelayTime::create(2.0),
NULL);
// wait 2 seconds, then call this function
auto sequence2 = Sequence::create(DelayTime::create(2.0),
CallFunc::create(std::bind(&Monster::animateBite, node)),
NULL);
auto repeat1 = RepeatForever::create(sequence1);
auto repeat2 = RepeatForever::create(sequence2);
node->runAction(repeat1);
node->runAction(repeat2);
첫 번째 함수는 (animateWalk)라고 불리지 만 두 번째 함수 (animateBite)는 호출되지 않습니다. repeat1에 대한 첫 번째 runAction을 주석 처리하면 두 번째 시퀀스가 실행됩니다. 첫 번째 함수가 실행되는 동안 지연된 후에 두 번째 함수를 실행하려면 어떻게해야합니까?
당신은'Monster :: animateBite'와'Monster :: animateWalk'에서 무엇을하고 있는지 보여줄 수 있습니까? 그럼 내가 너를 잘 도울 수있어. – Emadpres