Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
Event system and managers

Managers are one of the most important things in UnrealEngineSDK. They allow the developer to manage things in any place he wants by sending events or getting access to certain functions. Also, if developers have a need, they can create any manager and event they want.

Experience manager

UExperienceManager is the most important manager because it allows you to add newly developed managers and they will be automatically created and processed when you start your experience. To make this manager work, you need to set up ExperienceManagerClass in APixoVRGameMode and customize SingleListenerClasses and PerPlayerListenerClasses that you want to use in your ExpirienceManager. All managers should be inherited from UBaseManager and will be created on APixoVRGameMode::InitGame. These managers will also send events when player joined, left and handling events acception. You can learn more about this in the UExperienceManager.

Creating Events

You can create events using EventLogService. It has a static NewEvent function that accepts different parameters based on your needs. Events should be inherited from UBaseEvent. Created events will be handled by ExperienceManager and then it will call HandleEvent_Impl based on type of created event in each initialized manager.

Handling Events

Any manager can handle any event, you just need to do these things:

  • Declare the event in your manager class: DECLARE_EVENT_HANDLER(EVENT_TO_HANDLE_CLASS)
    Note
    This macro contains a protected access modifier, so it will modify all following properties and functions.
  • In the constructor of your manager class, add this line DEFINE_EVENT_HANDLER(EVENT_TO_HANDLE_CLASS).
  • After that you can implement in your .cpp file function void UYourManager::HandleEvent_Impl(EVENT_TO_HANDLE_CLASS * Event) and it will be called after calling EventLogService::NewEvent with correct event type.

SDK has a number of created managers and events, you can read about them here:

  1. UStoryManager
  2. USoundManager
  3. UHintManager
  4. UApexReportingManager
  5. UFadeManager
  6. UStreamingLevelManager
  7. UGameManager