How do you unsubscribe events ie "SomeScript.SomeEvent += SomeMethod" when quitting the game?

I have a bunch of events that I subscribe to on Start or Awake that are active during runtime all the way to quitting the game, they never unsub or get destroyed.

How do I properly unsub from these when the game quits? in OnDestroy? Or some other way?
Thank you

Hi - when the game application quits, all objects including the instance of SomeScript get destroyed immediately, therefore SomeScript.SomeEvent and its delegates (event listeners) are destroyed/removed for you.

If you still want to manually unsubscribe/remove event listeners, OnDestroy works and will occur when that instance of SomeScript is destroyed.

There are 2 options here.

1. OnEnable ↔ OnDisable

void OnEnable ()
{
    EventProvider.someEvent += OnSomeEvent;
}

void OnDisable ()
{
    EventProvider.someEvent -= OnSomeEvent;
}

2. Awake/Start → OnDestroy

void Awake ()
{
    EventProvider.someEvent += OnSomeEvent;
}
void Start ()
{
    EventProvider.someOtherEvent += OnSomeOtherEvent;
}

void OnDestroy ()
{
    EventProvider.someEvent -= OnSomeEvent;
    EventProvider.someOtherEvent -= OnSomeOtherEvent;
}