vendredi 28 juin 2019

How can I get and edit a FString inside a Struct inside a TArray using UProperties

I have these structs:

USTRUCT(BlueprintType)
struct FBaseCreateEditVariable {

    GENERATED_USTRUCT_BODY()
public:
    FBaseCreateEditVariable() {}
    UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (DisplayName = "variableName"))
        FString variableName = "";
    UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (DisplayName = "variableValue"))
        FString variableValue = "";

};

USTRUCT(BlueprintType)
struct FCreateEditVariable : public FInteractStruct {

    GENERATED_USTRUCT_BODY()
public:
    FCreateEditVariable() {}

    UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (DisplayName = "variables"))
        TArray<FBaseCreateEditVariable> variables;

};

So if I have these two variables:

UArrayProperty* arrayProp; //The property "variables" inside "FCreateEditVariable" struct
void * dir2; //The address of "variables"'s parent ("FCreateEditVariable")

How can I get and how can I edit dynamically using Uproperty and "for/while" all of the FString properties inside FBaseCreateEditVariable (can be more than these two FString variables)?

Aucun commentaire:

Enregistrer un commentaire