[ SOLVED ] Multiple Listeners Problem - Scene Reload

I’m using

private void Start()
    {
        Advertisement.AddListener(this);
        InitializeAdvertisement();
    }

This is fine, first time round, any subsequent scene reload, seems to leave the previous Listener present, and obviously adds a new one to the scene, how can I check for and remove any previous listeners I have added using this method ?

1 Like

So, after some ‘painstaking’ research I added :

    private void OnDisable()
        {
            Advertisement.RemoveListener(this);
        }

Then when I end my game, just before I reload the main scene, I simply deactivate my AdManager GameObject, which calls the OnDisable function and removes the current Listener.

Leaving this here should anyone else be having the same problem.

2 Likes

This worked for me ! Thanks !