Frame* ActionTimelineCache::loadInnerActionFrameWithFlatBuffers(const flatbuffers::InnerActionFrame *flatbuffers)
{
    InnerActionFrame* frame = InnerActionFrame::create();
    
    InnerActionType innerActionType = (InnerActionType)flatbuffers->innerActionType();
    
    std::string currentAnimationFrame = flatbuffers->currentAniamtionName()->c_str();
    
    int singleFrameIndex = flatbuffers->singleFrameIndex();
    
    int frameIndex = flatbuffers->frameIndex();
    frame->setFrameIndex(frameIndex);
    
    bool tween = flatbuffers->tween() != 0;
    frame->setTween(tween);
    
    frame->setInnerActionType(innerActionType);
    frame->setSingleFrameIndex(singleFrameIndex);
    
    frame->setEnterWithName(true);
    frame->setAnimationName(currentAnimationFrame);
    
    auto easingData = flatbuffers->easingData();
    if (easingData)
    {
        loadEasingDataWithFlatBuffers(frame, easingData);
    }
    
    return frame;
}
Exemple #2
0
Frame* InnerActionFrame::clone()
{
    InnerActionFrame* frame = InnerActionFrame::create();
    frame->setInnerActionType(_innerActionType);
    frame->setSingleFrameIndex(_singleFrameIndex);
    if(_enterWithName)
    {
        frame->setEnterWithName(true);
        frame->setAnimationName(_animationName);
    }
    else
    {
        frame->setStartFrameIndex(_startFrameIndex);
        frame->setEndFrameIndex(_endFrameIndex);
    }
    frame->cloneProperty(this);

    return frame;
}