If you absolutely know your field is a TArray<uint8>
, then you can just cast to that as in your original post, without any problem.
If you want to be certain, you can add some extra checks:
UArrayProperty* field = FindField<UArrayProperty>(StructStructure, "Data");
if (field && field->Inner->IsA<UByteProperty>())
{
const TArray<uint8>& byte_array = (const TArray<uint8>&)field->GetPropertyValue_InContainer(StructData);
}
Steve