// Fill out your copyright notice in the Description page of Project Settings. #include "CppBaseWidget.h" void UCppBaseWidget::NativeConstruct() { Super::NativeConstruct(); } void UCppBaseWidget::NativeTick(const FGeometry& MyGeometry, float DeltaTime) { Super::NativeTick(MyGeometry, DeltaTime); } bool UCppBaseWidget::CanTick(float interval) { if ((GetWorld()->GetTimeSeconds() - timeLastTick) > interval) { timeLastTick = GetWorld()->GetTimeSeconds(); return true; } return false; } void UCppBaseWidget::PlayAnimationMode(TEnumAsByte mode, int32 priorityIndex) { CppAnimation* animation = GetAnimationWithMode(&mode); if (!animation) return; animation->PlayAnimationMode(&mode, &priorityIndex); } CppAnimation* UCppBaseWidget::GetAnimationWithMode(TEnumAsByte* mode) { for (int32 i = 0; i < Animations.Num(); ++i) { if (Animations[i].CanMode(mode)) return &Animations[i]; } return nullptr; } void UCppBaseWidget::AddAnimation(UUserWidget* owner, UWidgetAnimation* animation, TArray modes, TEnumAsByte modeAtCreation, int32 priorityIndex) { Animations.Add(CppAnimation(owner, animation, &modes, &modeAtCreation, &priorityIndex)); }