Say I have a USTRUCT, FCustomGameMode, that is UPROPERTY inside a USaveGame subclass, containing the following:
UENUM(BlueprintType)
enum class ESpawningPolicy : uint8
{
None,
OneAtATime,
Multiple,
};
USTRUCT(BlueprintType)
struct FCustomGameMode
{
GENERATED_BODY()
UPROPERTY(EditDefaultsOnly)
bool bUseBatchSpawning;
UPROPERTY(EditDefaultsOnly)
ESpawningPolicy SpawningPolicy;
};
Let’s say I decide I want to delete the boolean variable “Batch Spawning” and instead make an enum of it, shown below:
UENUM(BlueprintType)
enum class ESpawningPolicy : uint8
{
None,
OneAtATime,
Multiple,
Batch,
};
USTRUCT(BlueprintType)
struct FCustomGameMode
{
GENERATED_BODY()
UPROPERTY(EditDefaultsOnly)
ESpawningPolicy SpawningPolicy;
};
How would I go about creating a function to update already existing SaveGames to this new design? More specifically, how would I access the old bUseBatchSpawning boolean variable and set the SpawningPolicy enum to “Batch”?
My main concern is how to reference a variable that is deleted. Could I somehow still access the property from older SaveGame where it still existed using its FName or something?
Thanks,
Mark