You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
This will break existing content. An upgrade path is not available, i.e. no redirectors. #CodeReview: max.chen, frank.fella, andrew.rodham, matt.kuhlenschmidt [CL 2709960 by Max Preussner in Main branch]
54 lines
1011 B
C++
54 lines
1011 B
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "LevelSequencePCH.h"
|
|
#include "LevelSequenceObject.h"
|
|
|
|
|
|
/* FSequencerPossessedObject interface
|
|
*****************************************************************************/
|
|
|
|
UObject* FLevelSequenceObject::GetObject() const
|
|
{
|
|
// get component-less object
|
|
if (ComponentName.IsEmpty())
|
|
{
|
|
return ObjectOrOwner.Get();
|
|
}
|
|
|
|
// get cached component
|
|
if ((CachedComponent.IsValid()) && (CachedComponent->GetName() == ComponentName))
|
|
{
|
|
return CachedComponent.Get();
|
|
}
|
|
|
|
CachedComponent = nullptr;
|
|
|
|
// find & cache component
|
|
UObject* Object = ObjectOrOwner.Get();
|
|
|
|
if (Object == nullptr)
|
|
{
|
|
return nullptr;
|
|
}
|
|
|
|
AActor* Owner = Cast<AActor>(Object);
|
|
|
|
if (Owner == nullptr)
|
|
{
|
|
return Object;
|
|
}
|
|
|
|
for (UActorComponent* ActorComponent : Owner->GetComponents())
|
|
{
|
|
if (ActorComponent->GetName() == ComponentName)
|
|
{
|
|
CachedComponent = ActorComponent;
|
|
|
|
return ActorComponent;
|
|
}
|
|
}
|
|
|
|
// component not found
|
|
return nullptr;
|
|
}
|