General
Working on a mod for a game using the Unity Engine.
The problem
I'm trying to attach to the activeSceneChanged event with this code:
SceneManager.activeSceneChanged += OnSceneChanged;
This results in the error:
CS0229 Ambiguity between 'SceneManager.activeSceneChanged' and 'SceneManager.activeSceneChanged'
After checking what's going on here, it seems that the activeSceneChanged
member is both user generated and [CompilerGenerated]:
What I've tried myself
I honestly have no idea at all how I'd fix an issue like this. I've never encountered it before. Asked a few other devs I know, but they never seen it either. Decompiled the Unity DLL file with ILSpy, only to see that CompilerGenerated code isn't in there (kind of makes sense since it's generated by the compiler I assume).
I'd really like some help on how to approach this issue and solve it.
Edit
To help speed things up, here's a Github link to the mod: https://github.com/skarab42/ValheimTwitch
The error pops up at line 93 in Plugin.cs