You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira #preflight 6306736ac85b7fef22be7751 [CL 21558583 by bryan sefcik in ue5-main branch]
36 lines
1.2 KiB
C++
36 lines
1.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "InheritedSubobjectDataFactory.h"
|
|
|
|
#include "ComponentInstanceDataCache.h"
|
|
#include "Components/ActorComponent.h"
|
|
#include "Engine/SCS_Node.h" // #TODO_BH We need to remove this when the actual subobject refactor happens
|
|
#include "InheritedSubobjectData.h"
|
|
#include "Templates/Casts.h"
|
|
#include "UObject/ObjectPtr.h"
|
|
|
|
TSharedPtr<FSubobjectData> FInheritedSubobjectDataFactory::CreateSubobjectData(const FCreateSubobjectParams& Params)
|
|
{
|
|
return TSharedPtr<FInheritedSubobjectData>(new FInheritedSubobjectData(Params.Context, Params.ParentHandle, Params.bIsInheritedSCS));
|
|
}
|
|
|
|
bool FInheritedSubobjectDataFactory::ShouldCreateSubobjectData(const FCreateSubobjectParams& Params) const
|
|
{
|
|
if(UActorComponent* Component = Cast<UActorComponent>(Params.Context))
|
|
{
|
|
// Create an inherited subobject data
|
|
if(Params.bIsInheritedSCS || Component->CreationMethod != EComponentCreationMethod::Instance)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
else if (USCS_Node* SCS = Cast<USCS_Node>(Params.Context))
|
|
{
|
|
if (UActorComponent* Comp = SCS->ComponentTemplate)
|
|
{
|
|
return Comp->CreationMethod != EComponentCreationMethod::Instance;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
} |