- Home /
Support for Func and Action delegate on Iphone micro mscorlib?
Does iOS micro mscorlib support Func<T>
and Action<T>
delegates? This would be very important to know for a possible different implementation of HOTween.
I already checked the manual and the basic delegate functions seem to be supported on all stripping levels but Func<T>
and Action<T>
are not explicitly mentioned.
Unfortunately I don't have a Mac nor an Iphone Pro license so I would be grateful if someone could tell me :)
I don't know specifically, but I would guess that they're supported. $$anonymous$$ost of what's cut out is from System.dll -- you can see some more info on the distinction here.
I have noticed that iOS builds sometimes have trouble using enums in generics (especially when those generics rely on other generics). Not strictly related to your question, but seems worth a mention.
Answer by stfx · Apr 02, 2012 at 10:30 PM
Found the location of the micro mscorlib:
Unity\Editor\Data\Mono\lib\mono\micro\mscorlib.dll
Action<T>
is in that library but Func<T>
is not (its in System.Core). A quick fix for that is to define the generic Func delegate yourself:
public delegate T Func<T>();
The only issue left is that Mono might have troubles building the full AOT for some generic classes (see Limitation: Generic Interface Instantiation). Maybe its even possible to test build your with --aot=full without Unity if you have the code in a separate dll but I didn't get this to work yet.
For more info about iOS limiations see monotouch limitations
Why isn't important stuff like that documented in the manual?
Good to know, that.
I've been frustrated a few times with topics like this. Unity has plenty of beginner-level documentation, but not much past that seems to be readily available.