what is the equivalent type in C# of the type Function in js?

Function in js might be a little different from delegate in C#.
I want the original function pointer in C#, not through a delegate.

private void originalFunction(){...}

private void createWindow(Function windowFunc...){...}
here I want 2 call it like this
...createWindow(originalFunction)
not
myDelegateType myDelegate = new myDelegateType(originalFunction);
...createWindow(myDelegate)
....I dont want 2 pass a Delegate in the argument list, it forces me to create a variable
it is redundant....

PS:the language is C#

You can declare a delegate and have a method with the delegate as parameter. Then just pass in a method with same signature, there’s no need to create a redundant variable of the delegate.

I think you might be looking for the Func<> class.

you are cool!by the way ,do you know the type of type? I dont wanna pass a parameter as typeof(MyType) ,I want to pass (MyType), I think “typeof” is redundant.

does Func require at least one parameter? what if my function does not have any parameter and return value?

Action. ether the .Net one or there is also one in the unityengine namespace. Sry cant link Im on mobile

I find it. thx!