C# Code is New to Me and i Have a parsing error

using UnityEngine;
using System.Collections;

public class MeshCombineUtility {

public struct MeshInstance
{
	public Mesh      mesh;
	public int       subMeshIndex;            
	public Matrix4x4 transform;
}

public static Mesh Combine (MeshInstance[] combines, bool generateStrips)
{
	int vertexCount = 0;
	int triangleCount = 0;
	int stripCount = 0;
	foreach( MeshInstance combine in combines )
	{
		if (combine.mesh)
		{
			vertexCount += combine.mesh.vertexCount;
			
			if (generateStrips)
			{
	
	Vector3[] vertices = new Vector3[vertexCount] ;
	Vector3[] normals = new Vector3[vertexCount] ;
	Vector4[] tangents = new Vector4[vertexCount] ;
	Vector2[] uv = new Vector2[vertexCount];
	Vector2[] uv1 = new Vector2[vertexCount];
	int[] triangles = new int[triangleCount];
	int[] strip = new int[stripCount];
	
				int offset;
			
	offset=0;
	{
		if (combine.mesh)
		{
			Matrix4x4 invTranspose = combine.transform;
			invTranspose = invTranspose.inverse.transpose;
			CopyTangents(combine.mesh.vertexCount, combine.mesh.tangents, tangents, ref offset, invTranspose);
		}
		
		if (combine.mesh)
			Copy(combine.mesh.vertexCount, combine.mesh.uv2, uv1, ref offset);
	}
	
	int triangleOffset=0;
	int stripOffset=0;
	int vertexOffset=0;
	{
		if (combine.mesh)
		{
			if (generateStrips)
			{
				int[] inputstrip = combine.mesh.GetTriangleStrip(combine.subMeshIndex);
				if (stripOffset != 0)
				{
					if ((stripOffset & 1) == 1)
					{
						strip[stripOffset+0] = strip[stripOffset-1];
						strip[stripOffset+1] = inputstrip[0] + vertexOffset;
						strip[stripOffset+2] = inputstrip[0] + vertexOffset;
						stripOffset+=3;
					}
					else
					{
						strip[stripOffset+0] = strip[stripOffset-1];
						strip[stripOffset+1] = inputstrip[0] + vertexOffset;
						stripOffset+=2;
					}
				}
				
				for (int i=0;i<inputstrip.Length;i++)
				{
					strip[i+stripOffset] = inputstrip *+ vertexOffset;*
  •   			}*
    
  •   			stripOffset += inputstrip.Length;*
    
  •   		}*
    
  •   		else*
    
  •   		{*
    
  •   			int[]  inputtriangles = combine.mesh.GetTriangles(combine.subMeshIndex);*
    
  •   			for (int i=0;i<inputtriangles.Length;i++)*
    
  •   			{*
    

_ triangles[i+triangleOffset] = inputtriangles + vertexOffset;_
* }*
* triangleOffset += inputtriangles.Length;*
* }*

* vertexOffset += combine.mesh.vertexCount;*
* }*
* }*

* Mesh mesh = new Mesh();*
* mesh.name = “Combined Mesh”;*
* mesh.vertices = vertices;*
* mesh.normals = normals;*
* mesh.uv = uv;*
* mesh.uv2 = uv1;*
* mesh.tangents = tangents;*
* if (generateStrips)*
* mesh.SetTriangleStrip(strip, 0);*
* else*
* mesh.triangles = triangles;*

* return mesh;*
* }*
* for (int i=0;i<src.Length;i++)*
_ dst[i+offset] = transform.MultiplyPoint(src*);
offset += vertexcount;
}
{
for (int i=0;i<src.Length;i++)
dst[i+offset] = transform.MultiplyVector(src).normalized;
offset += vertexcount;
}
{
for (int i=0;i<src.Length;i++)
dst[i+offset] = src;
offset += vertexcount;
}
{
for (int i=0;i<src.Length;i++)
{
Vector4 p4 = src;
Vector3 p = new Vector3(p4.x, p4.y, p4.z);
p = transform.MultiplyVector(p).normalized;
dst[i+offset] = new Vector4(p.x, p.y, p.z, p4.w);
}*_

if ((stripOffset & 1) == 1) → if (stripOffset == 1)

You’re having trouble with the use of curly brackets { } it would appear.

For example, you’re closing your ‘if’ statement from line 15 on line 104 in the code above, which is probably not where you want it to be closed. I’d suggest you to read through your code again and verify all statements are closed where you want;

To make this code syntactically correct (but likely not logically) you’ll have to close:

  • the foreach statement at line 8
  • the ‘Combine’ method
  • Your MechCombineUtility class

Do also note that you need to place a statement before a curly brace to include the next code inside the statement’s scope. For example, from line 105:

{
for (int i = 0; i < src.Length; i++)
    dst[i + offset] = transform.MultiplyVector(src*).normalized;*

offset += vertexcount;
}
Needs to be:
for (int i = 0; i < src.Length; i++) {
dst[i + offset] = transform.MultiplyVector(src*).normalized;*
offset += vertexcount;
}
Most of your later statements have this mistake.