Sorry to say it that way, but this is one of the worst UnityScript scripts i’ve seen. He’s abusing an untyped ArrayList as a kind of “class” by pushing all different kind of information into one list. If you would translate this 1:1 to C# it would be a casting hell beside that it’s kinda slow. If you want to know how it would look like, just do this:
Create a new Unity project
Copy all UnityScript files you want to “convert” into this project.
Build the project as standalone application
Locate the “Assembly-UnityScript.dll” inside the data folder of the build
Download ILSpy and open the above mentioned DLL with it by dragging it into the window
Make sure you have set the language to C#
Locate the class you’re after and copy the code.
Again i wouldn’t even try to convert this mess to C#. You should use a class for your items and use meaningful names.
Firstly, change var to bool. var is a proper keyword in C#, but it’s not as efficient as just declaring it as the proper type. Secondly, you can’t return a value from a void method. Change the method’s return type to bool.