I’m having to convert the Spline pathing script over at the Unify wiki to use ArrayLists to make it work with Unity iPhone, and I’ve come across a spot of C# code I have no idea what to do with: the “=>” operator. I managed to find a single passing reference to this online, but since Google won’t let you search using symbols, I can’t seem to dig up any info on this operator at all. Even the MSDN docs are silent! It is not listed on any lists of operators. But I know it exists because, as I said, I found a passing reference on a blog to it as a little-known operator in C#, but the blog entry didn’t go into any more detail.
Hopefully someone can help shed some light on this mystery. Thanks!
Are you sure it’s => and not >=? Because the former is used for lambda expressions, and those are only available in C# 3.0 (Unity only uses 2.0 as far as I know), while the latter is just plain old ‘greater than or equal’.
Aha! That’s it! Thanks! Yep, that’s definitely what the code in question is doing. As I said, I’m using it for iPhone, so I haven’t tested it in regular Unity, but I’d imagine it was working or else they wouldn’t have posted it to the Unify wiki… or so I would hope.
Funny thing is, if you google “C# operators” (without the quotes), you’ll get a link right to MSDN’s C# operator list, which DOESN’T INCLUDE “=>”. Yet the link you sent me has a link to a list of C# operators that DOES include it! Go figure.
Thanks again! Without this info, I simply couldn’t figure out what the heck that code was supposed to do. I’d never seen anything like it before.