You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rnx #rb none #ROBOMERGE-SOURCE: CL 10869241 via CL 10869527 via CL 10869904 #ROBOMERGE-BOT: (v613-10869866) [CL 10870586 by ryan durand in Main branch]
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "RotatorStructCustomization.h"
|
|
#include "UObject/UnrealType.h"
|
|
|
|
|
|
TSharedRef<IPropertyTypeCustomization> FRotatorStructCustomization::MakeInstance()
|
|
{
|
|
return MakeShareable(new FRotatorStructCustomization);
|
|
}
|
|
|
|
|
|
void FRotatorStructCustomization::GetSortedChildren(TSharedRef<IPropertyHandle> StructPropertyHandle, TArray< TSharedRef<IPropertyHandle> >& OutChildren)
|
|
{
|
|
static const FName Roll("Roll");
|
|
static const FName Pitch("Pitch");
|
|
static const FName Yaw("Yaw");
|
|
|
|
TSharedPtr< IPropertyHandle > RotatorChildren[3];
|
|
|
|
uint32 NumChildren;
|
|
StructPropertyHandle->GetNumChildren(NumChildren);
|
|
|
|
for (uint32 ChildIndex = 0; ChildIndex < NumChildren; ++ChildIndex)
|
|
{
|
|
TSharedRef<IPropertyHandle> ChildHandle = StructPropertyHandle->GetChildHandle(ChildIndex).ToSharedRef();
|
|
const FName PropertyName = ChildHandle->GetProperty()->GetFName();
|
|
|
|
if (PropertyName == Roll)
|
|
{
|
|
RotatorChildren[0] = ChildHandle;
|
|
}
|
|
else if (PropertyName == Pitch)
|
|
{
|
|
RotatorChildren[1] = ChildHandle;
|
|
}
|
|
else
|
|
{
|
|
check(PropertyName == Yaw);
|
|
RotatorChildren[2] = ChildHandle;
|
|
}
|
|
}
|
|
|
|
OutChildren.Add(RotatorChildren[0].ToSharedRef());
|
|
OutChildren.Add(RotatorChildren[1].ToSharedRef());
|
|
OutChildren.Add(RotatorChildren[2].ToSharedRef());
|
|
}
|