I think what you need to use is the EditCondition meta data inside of the UPROPERTY()
In your case it would be UPROPERTY(meta=(EditCondition = “ShowVariables”))
You can find more information here: Properties | Unreal Engine Documentation.
I hope this helps