Skip to content

Instantly share code, notes, and snippets.

@wowbroforce
Created February 15, 2020 19:00
Show Gist options
  • Save wowbroforce/8c7c5f6b27cbed21e4e512697741b1c8 to your computer and use it in GitHub Desktop.
Save wowbroforce/8c7c5f6b27cbed21e4e512697741b1c8 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class GameEventListener : MonoBehaviour
{
public GameEvent @event;
public UnityEvent response;
private void OnEnable()
{
@event.Register(listener: this);
}
private void OnDisable()
{
@event.Unregister(listener: this);
}
public void OnEventRised()
{
response.Invoke();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment