本文整理汇总了C++中UMovieScene::GetTimeRange方法的典型用法代码示例。如果您正苦于以下问题:C++ UMovieScene::GetTimeRange方法的具体用法?C++ UMovieScene::GetTimeRange怎么用?C++ UMovieScene::GetTimeRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMovieScene
的用法示例。
在下文中一共展示了UMovieScene::GetTimeRange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitSequencePlayer
void UUMGSequencePlayer::InitSequencePlayer( const UWidgetAnimation& InAnimation, UUserWidget& UserWidget )
{
Animation = &InAnimation;
UMovieScene* MovieScene = Animation->MovieScene;
// Cache the time range of the sequence to determine when we stop
TimeRange = MovieScene->GetTimeRange();
RuntimeBindings = NewObject<UMovieSceneBindings>(this);
RuntimeBindings->SetRootMovieScene( MovieScene );
UWidgetTree* WidgetTree = UserWidget.WidgetTree;
TMap<FGuid, TArray<UObject*> > GuidToRuntimeObjectMap;
// Bind to Runtime Objects
for (const FWidgetAnimationBinding& Binding : InAnimation.AnimationBindings)
{
UObject* FoundObject = Binding.FindRuntimeObject( *WidgetTree );
if( FoundObject )
{
TArray<UObject*>& Objects = GuidToRuntimeObjectMap.FindOrAdd(Binding.AnimationGuid);
Objects.Add(FoundObject);
}
}
for( auto It = GuidToRuntimeObjectMap.CreateConstIterator(); It; ++It )
{
RuntimeBindings->AddBinding( It.Key(), It.Value() );
}
}
示例2: FindEndTimeForShot
float UMovieSceneShotTrack::FindEndTimeForShot( float StartTime )
{
float EndTime = 0;
bool bFoundEndTime = false;
for( UMovieSceneSection* Section : SubMovieSceneSections )
{
if( Section->GetStartTime() >= StartTime )
{
EndTime = Section->GetStartTime();
bFoundEndTime = true;
break;
}
}
if( !bFoundEndTime )
{
UMovieScene* OwnerScene = GetTypedOuter<UMovieScene>();
// End time should just end where the movie scene ends. Ensure it is at least the same as start time (this should only happen when the movie scene has an initial time range smaller than the start time
EndTime = FMath::Max( OwnerScene->GetTimeRange().GetUpperBoundValue(), StartTime );
}
if( StartTime == EndTime )
{
// Give the shot a reasonable length of time to start out with. A 0 time shot is not usable
EndTime = StartTime + .5f;
}
return EndTime;
}