I get UStructProperty from Object using this
UStructProperty* Property = FindField<UStructProperty>(Object->GetClass(), Pair.Key);
Now… I need to know if this property contains FColor or FLinearColor. How to do this?
I get UStructProperty from Object using this
UStructProperty* Property = FindField<UStructProperty>(Object->GetClass(), Pair.Key);
Now… I need to know if this property contains FColor or FLinearColor. How to do this?
Check the type of the Struct member within the property (it’s a UScriptStruct/UStruct which is like the UClass of structs).
Since those are intrinsic structs you have to use TBaseStructure, eg)
if (Property->Struct == TBaseStructure<FColor>::Get())
{
}
else if (Property->Struct == TBaseStructure<FLinearColor>::Get())
{
}
But for generated USTRUCT types you can use FMyStruct::StaticStruct() as the comparison instead.