C#C
C#15mo ago
SamPerson

Named function magically turns into anonymous method for no clear reason, cannot be used as Action

I am storing a list of delegates, which are added via calls to DefineFunction(string name, Delegate actualFn).
I have a method with signature public void DrawSprite(string sprite, float x, float y, float w, float h, float rot, float grayscale01 = 0).

But when I call DefineFunction to add this method to the list, for some reason, DefineFunction takes it in not as a System.Action or System.Func derivative like every other call, but as an <>f__AnonymousDelegate0 type, which cannot later be converted to a System.Action for invocation.



DrawSprite is the only method for which this happens.
I have absolutely no clue why this is happening. It's exactly the same as everything else. It very much is a named function. Does anyone have ideas for things I could try to get to the bottom of this?
image.png
image.png
image.png
Was this page helpful?