Unity 2021.3.24
I am trying to call a method, which starts a coroutine.
When the class I use is a singleton, and I start a coroutine in the called function, I get the error Trying to Invoke method: SongManager.StartSong couldn't be called.
When I remove StartCoroutine or remove the singleton, it does work, but I would like to use the singleton pattern for this class if possible.
Does anyone know why this happens and how to fix it (except removing singleton)?
Code (SingInfo is a scriptable Object, which is referenced in the event):
public void StartSong(SongInfo song)
{
songInfo = song;
timer = 0;
StartCoroutine(PlaySong());
}