Hi Aaron,
I think the best way to do this. It is create custom game engine class and implement events you want.
You should add to DefaultEngine.ini
[/Script/Engine.Engine]
GameEngine=/Script/QAGame.MyCustomGameEngine
MyCustomGameEngine.h
#pragma once
#include "Engine/GameEngine.h"
#include "MyCustomGameEngine.generated.h"
UCLASS()
class UMyCustomGameEngine : public UGameEngine
{
GENERATED_UCLASS_BODY()
// When engine starts
void Init(class IEngineLoop* InEngineLoop);
// Close engine
void PreExit();
};
MyCustomGameEngine.cpp
#include "QAGame.h"
#include "MyCustomGameEngine.h"
UMyCustomGameEngine::UMyCustomGameEngine(const FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{}
void UMyCustomGameEngine::Init(class IEngineLoop* InEngineLoop)
{
Super::Init(InEngineLoop);
}
void UMyCustomGameEngine::PreExit()
{
Super::PreExit();
}
Best regards,