If you want your class to be initialized on the start of the game(mode), you can simply write a function (override) BeginPlay and EndPlay on your gamemode class, then initialize/deinitialize your class out of this functions.
If you want your class to be initialized on the start of the game(mode), you can simply write a function (override) BeginPlay and EndPlay on your gamemode class, then initialize/deinitialize your class out of this functions.