Topic: Unity Compiling Error - IEnumerable<U> get items function not found … nbq0v1h639

Unity has a difficult time compiling abstract classes that implement IEnumerable<U>.

It's a Unity compiling error.  But it might be worth considering refactoring the IEnumerable access pattern.  I went through, and removed the IEnumerable<U> from the code base, and had explicit references to the items properties in all of the examples.  Unity still didn't compile the IL2CPP iOS code correctly. 

Suggestion: consider refactoring the managers implementing IEnumerable (Not necessary if Unity fixes the bug, but may be good for hardening the code, or to be aware of the issue until Unity addresses the issue).

Request:  Please wrap the entire asset in a namespace.  This will be useful for distributing through the package manager, or pre-compiling in an independent solution (not in C-Sharp-First-Pass).  Examples could all be imported as Samples.

(Mostly posting here to track the Unity Bug report)

Re: Unity Compiling Error - IEnumerable<U> get items function not found


About IEnumerable:
As far as I understood from your post, you refactored and removed all uses of IEnumerable<U>, but Unity still won't compile it correctly, right?
If so, why make these changes to the asset if it still doesn't solve the problem?

About namespaces:
Online Maps was originally developed for Unity 3.x, where there was no way to put scripts in an assembly other than Assembly-CSharp.
User scripts were created in the global namespace by default.
This means that if there is a script with the same name in some namespace and in the global namespace, then the script in the global namespace will have a higher priority, and the user will have compilation errors.
In Unity 3.x there was only one way to solve this problem - is give unique class names (asset name + class name).
In this case, having namespaces is redundant.

The days of Unity 3.x are long gone and now there is a Plugins folder and assembly definition files and there seems to be no reason to use the old rules.
But no, such a reason is the people who use the asset in their projects.
Adding namespaces and/or changing classes will just break existing projects.
Of course, this will benefit future users, but I cannot forget about current users and I will never do it.

Trust me, I hate these legacy things a lot, and I am seriously thinking about releasing a new mapping asset that will maked using the highest modern standards.
And of course, if I ever do this, everyone who already has Online Maps will have a free upgrade to the new asset.

Kind Regards,
Infinity Code Team.

uContext is Editor PowerPack (more than 40 tools) that take your workflow in Unity Editor to a next level, simplifies working with content, adds new features, corrects and improves the editor’s built-in behaviors. Click here to download uContext Basic for free.