Rewriting javascript to C# ....


i have to rewrite an unityscript in c# and im new to c#. Sure you can help me by this:

My javascript code looks like this:

 for(var mat : MeshRenderer in matComp){
if( == "xyz"){
    		mat.renderer.sharedMaterial.color = colors[counter];

My attempt was this, but i get an error "expecting ","...

for(MeshRenderer mat in matComp){...}

Would be great to know, if theres an short overview or comparision between javascript and c#, isnt it?

Thanks a lot, yosh

You should try foreach instead of for

Regarding the secondary question, "is there an overview..." - FYI, I did put up a list for C# at:

Syntax Differences in C#/JS