How to get reference to BP from c++ class?

I have a class AMySettings in c ++ with int32 SomeInt. In the editor I created a child BP_AMySettings , in which I set SomeInt = 15. I also have class FCustomMenu in another module, which is used only to edit the appearance of BP_AMySettings content. I only have a reference to class AMySettings with the default value of SomeInt.

How do I get the SomeInt value from BP_AMySettings to c ++ to class FCustomMenu?

The value must be taken while the editor is running, without starting the game. It is possible that SomeInt will not be changed in BP_AMySettings from the last run and in this case class FCustomMenu should know its value right after the editor is started.

Some code for better understanding:


 class MYGAME_API AMySettings : public AActor
 int32 SomeInt;


 class FCustomMenu : public IDetailCustomization
 static TSharedRef<IDetailCustomization> MakeInstance();
 virtual void CustomizeDetails(IDetailLayoutBuilder& DetailBuilder) override;
 int32 SomeIntFromBP;


 void FCustomMenu ::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
    SomeIntFromBP = (here I want value from BP_AMySettings not from AMySettings )

i have an idea but can you post some of the code so i can make sure i understand the question clearly

I understand the question, but can you give some information on the types of the classes? is class A an actor or…?
I know how to spawn a blueprint class from C++ but i don’t think that is what you mean.

Solution to the problem is to use Game Singleton Class.