Files
UnrealEngineUWP/Engine/Source/Editor/SubobjectDataInterface/Private/ChildActorSubobjectData.cpp
ben hoffman 1b38a5881b Instead of checking if something is a child actor component when attempting to maniuplate it, check if its owner is a CAC instead. If it's owner is a CAC, then it cannot be removed because it is determined by the owning CAC. Before, the code was incorrectly checking if something was just a plain old child actor component, resulting in being unable to delete, reparent, or attach to a child actor component.
#jira UE-117132
#jira UE-117332
#jira UE-117327
#jira UE-117329

#rb marc.audy
#rnx

#preflight 60d48296925f1400010bb909

#ROBOMERGE-SOURCE: CL 16773601 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16773618 by ben hoffman in ue5-release-engine-test branch]
2021-06-24 10:56:30 -04:00

32 lines
855 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "ChildActorSubobjectData.h"
FChildActorSubobjectData::FChildActorSubobjectData(UObject* ContextObject, const FSubobjectDataHandle& ParentHandle, const bool InbIsInheritedSCS)
: FInheritedSubobjectData(ContextObject, ParentHandle, InbIsInheritedSCS)
{
}
FText FChildActorSubobjectData::GetDisplayName() const
{
if(const UChildActorComponent* CAC = GetChildActorComponent())
{
return CAC->GetClass()->GetDisplayNameText();
}
return FInheritedSubobjectData::GetDisplayName();
}
FText FChildActorSubobjectData::GetActorDisplayText() const
{
if (const AActor* ChildActor = GetObject<AActor>())
{
return ChildActor->GetClass()->GetDisplayNameText();
}
return FInheritedSubobjectData::GetActorDisplayText();
}
bool FChildActorSubobjectData::IsChildActor() const
{
return true;
}