我有奇怪的情况,我尝试作为序列的一部分运行眨眼动作 精灵虽然方法getNumberOfRunningActions返回1,精灵不会闪烁。
其中pMatchedSymbolArray是ReelSymbol Sprite extendet类的数组
class ReelSymbol :public Sprite
{
public:
CREATE_FUNC(ReelSymbol);
ReelSymbol();
virtual bool init();
void setup();
static ReelSymbol* createWithSpriteFrameName(const std::string& spriteFrameName);
private:
int getIntFromName(std::string key);
Settings* pSettings;
};
for(ssize_t a=0; a<pMatchedSymbolArray->count();a++)
{
auto actionBlink = Blink::create(2, 5);
auto repeat = Repeat::create(actionBlink, 2);
ReelSymbol* symbol = ((ReelSymbol*)pMatchedSymbolArray->getObjectAtIndex(a));
auto actionSequence = Sequence::create(
actionBlink,
DelayTime::create(2),
CallFunc::create( std::bind(&LinesManager::AnimationUnitCallback, this, symbol,pMatchedSymbolArray->count()) ),
NULL);
ReelSymbol* thisReelSymbol = ((ReelSymbol*)pMatchedSymbolArray->getObjectAtIndex(a));
thisReelSymbol->runAction(actionSequence);
int no = thisReelSymbol->getNumberOfRunningActions();
CCLOG("getNumberOfRunningActions: %d",no);
}
void LinesManager::AnimationUnitCallback(Node* sender,int iMatchedSymbolArrayCount)
{
}
精灵只有在我跑的时候才会闪烁:
auto actionBlink = Blink::create(2, 5);
....
....
thisReelSymbol->runAction(actionBlink );
这里有什么不妥?
答案 0 :(得分:0)
如果这只是最新版本的问题,则解决方法可能同时使用两个操作。