cocos3 帧动画无限重复

    auto animation = Animation::create(); 
    animation->addSpriteFrameWithFile("NPC/hero.png");
    animation->addSpriteFrameWithFile("NPC/hero1.png");
  
    // should last 2.8 seconds. And there are 14 frames. 
    animation->setDelayPerUnit(2.8f / 14.0f); 
    animation->setRestoreOriginalFrame(true); 
    auto action = Animate::create(animation);
    auto repeat=RepeatForever::create(action);
    auto creep=RepeatForever::create(action);
    runAction(creep); 
原文地址:https://www.cnblogs.com/yufenghou/p/4189593.html