MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / setupCallback

Method setupCallback

Source/Node/Model.cpp:562–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562void Model::setupCallback() {
563 for (const auto& animationGroup : _animationGroups) {
564 if (animationGroup->animations.empty()) {
565 continue;
566 }
567 float duration = 0.0f;
568 for (const auto& animation : animationGroup->animations) {
569 float d = animation->getDuration();
570 if (duration < d) {
571 duration = d;
572 }
573 }
574 Action* action = animationGroup->animations[0]->getAction();
575 float d = action->getDuration();
576 if (d < duration) {
577 action = Sequence::create(
578 std::move(action->getAction()),
579 Delay::alloc(duration - d));
580 }
581 Node* node = animationGroup->animations[0]->getNode();
582 node->slot("ActionEnd"_slice, [this, action](Event* event) {
583 Action* eventAction = nullptr;
584 Node* target = nullptr;
585 if (event->get(eventAction, target) && action == eventAction) {
586 onActionEnd();
587 }
588 });
589 animationGroup->duration = action->getDuration();
590 animationGroup->animations[0]->setAction(action);
591 }
592}
593
594NS_DORA_END

Callers

nothing calls this directly

Calls 10

moveFunction · 0.85
setActionMethod · 0.80
getMethod · 0.65
createFunction · 0.50
allocFunction · 0.50
emptyMethod · 0.45
getDurationMethod · 0.45
getActionMethod · 0.45
getNodeMethod · 0.45
slotMethod · 0.45

Tested by

no test coverage detected