0

First of all, we're using unity which means Mono and outdated version of c#

Basically, there's a method called Fire which takes action as a callback. Then you want to pass the method as a callback, and it works perfectly for iOS and Android, but fails to compile for windows phone. Sure I can wrap it with lambda, but I'd like to understand why it doesn't work now.

void Fire( System.Action callback )
{}

void Method()
{}


Fire( Method ) // works for android and ios, but not for windows phone
Fire( () => Method() ) // compiles everywhere

Update: error CS1503: Argument 1: cannot convert from 'method group' to 'Action'

Unity 5.3.5p8

0 Answers0