Page cover image

Getting started

Explanation of how to implement the system to an object

  1. Open your object that you want to bind an event to and add the EasyEventManagerInterface.

  2. Recompile your Blueprint to be able to find the functions in the Right-Click Menu;

    or implement it through the Interface panel on the left side:

  3. Now you are ready to bind an event by using either BindEvent() or BindEventTag()

    You can call BindEvent() or UnbindEvent() from anywhere!

  4. Implement the OnEventCalled() or OnEventTagCalled() function from the Interface

And that's it! Now you can use CallEvent() or CallEventTag() anywhere you want, easy right?

This part is only for those who want to use it in C++!

C++ Implementation

  1. Implement the EasyEventManagerInterface to your c++ class

Header file:

public IEasyEventManagerInterface

Example:

class AMyActor : public AActor, public IEasyEventManagerInterface
{
}

  1. Now you are ready to bind an event by using either BindEvent() or BindEventTag()

Cpp file:

// For Tag usage
#include "GameplayTagsManager.h"

void AMyActor::BeginPlay()
{
  UEasyEventManagerLibrary::BindEvent(this, FName("MyEvent"), Object);
  // or for tags
  UEasyEventManagerLibrary::BindEventTag(this, UGameplayTagsManager::Get().RequestGameplayTag(FName("MyEventTag"), true), Object);
  
  // call parent function
  Super::BeginPlay();
}

You can call BindEvent() or UnbindEvent() from anywhere!

  1. Implement the OnEventCalled() or OnEventTagCalled() function from the Interface

Header file:

virtual void OnEventCalled_Implementation(FName Event, const FString& Message, UObject* Payload);
virtual void OnEventTagCalled_Implementation(FGameplayTag EventTag, const FString& Message, UObject* Payload);

Cpp file:

void AMyActor::OnEventCalled_Implementation(FName Event, const FString& Message, UObject* Payload)
{
   //some code
}

void AMyActor::OnEventTagCalled_Implementation(FGameplayTag EventTag, const FString& Message, UObject* Payload)
{
   //some code
}

  1. And that's it! Now you can use CallEvent() or CallEventTag() anywhere you want, easy right?

Last updated