Project transfer Win to Mac list SystemGeneric.Collections issue

Here is a transcript of an inquiry made on Unity answers
Posted here to increase the chance of solving this CrossPlatform issue, within Unity Itself

--------- A dedicated Crossplatform support Subforum, this place needs -------------

Hello there.

We are a two humans team, 1 of us is on a Windows machine, the other on a Mac both with the last version of Unity.

On windows the code works just fine, android builds work too.

The project was also transferred to a mac, ( by transferring the entire folder, and opening it with unity) press play for testing and

1 istance

ArgumentOutOfRangeException: Argument is out of range. Parameter name: index System.Collections.Generic.List`1[UnityEngine.Vector3].get_Item (Int32 index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633) LevelGeneration.GeneratePath () (at Assets/Scripts/LevelGeneration.cs:111) LevelGeneration.Start () (at Assets/Scripts/LevelGeneration.cs:74)

506 instances --(this is the same instance replicated for each tile the code is attempting to generate)–

ArgumentOutOfRangeException: Argument is out of range. Parameter name: index System.Collections.Generic.List`1[UnityEngine.Vector3].get_Item (Int32 index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633) LevelGeneration.GeneratePath () (at Assets/Scripts/LevelGeneration.cs:103) LevelGeneration.Update () (at Assets/Scripts/LevelGeneration.cs:86)

Could give you a transcript of the code, it is pretty lengthy though

Pretty sure is something about System Collections Generic, which is included in .net framework

https://msdn.microsoft.com/en-us/library/system.collections.generic(v=vs.110).aspx

seems like Xamarin has it on Mac

How can we make it work

Unity Answers link

http://answers.unity3d.com/questions/1147894/project-transfer-win-to-mac-array-and-list-issues.html

Well first of all. Coming from Windows to Mac or vice-versa the script’s Line-Endings differ. You must go into your scripts and change the line endings from what is was on Windows to Mac now. This will stop many errors. MonoDevelop, or even Visual Studio informs you of this.
This is just my two cents, though. I’ve had project I’ve started on Windows and transfered my Project folder to MAC with no problem aside from Unity version differences. However, it’s vital you change the line-endings. And for MAC, I needed to change such to UNIX.

Should be no difference. That’s one benefits of using unity. We have 20 people actively working on our project, mostly Mac a handful of win users. No problems.

Most likely is Os level issues arising from just copying the folder. Try using version control like git or svn instead. It will keep it cleaner.

@ Shykeas : actually monodevelop did indeed point out the line endings,and then proceed in modifying them for macos

@ zombiegorilla : Cool, that would definitely come in handy

Still, pretty sure is cause System.Collections.Generic library is not present on mac,
the code attempt to retrieve .list, which in windows is in a dll

and also, the scenes that do not use that code work just fine

in mac

at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633
(error message transcript)

Hmm, interesting. I’ve never actually used System.Collections.Generic so I’m not too sure on that. But I do find it very strange Unity would keep it’s data elsewhere in the MAC version aside form the Windows version, which is very interesting. Nuisance-like. Maybe in the future I’ll look into that a little more.

But, yes. Like ZombieGorrila said; it shouldn’t be a difference much at all with the Windows and MAC versions of Unity.