I'm getting some errors in the script how can i fix them ?

float size;
void Awake()
{
Mesh m = new Mesh();
m.name = “Scripted_Plane_New_Mesh”;
m.vertices = [new Vector3(-size, -size, 0.01f), new Vector3(size, -size, 0.01f), new Vector3(size, size, 0.01f), new Vector3(-size, size, 0.01f)];
m.uv = [new Vector2(0, 0), new Vector2(0, 1), new Vector2(1, 1), new Vector2(1, 0)];
m.triangles = [0, 1, 2, 0, 2, 3];
m.RecalculateNormals();
GameObject obj = new GameObject(“New_Plane_Fom_Script”, MeshRenderer, MeshFilter, MeshCollider);
obj.GetComponent(MeshFilter).mesh = m;
}

First i’m getting error in every line that have ‘[’
For example:

m.vertices = [new Vector3(-size, -size, 0.01f), new Vector3(size, -size, 0.01f), new Vector3(size, size, 0.01f), new Vector3(-size, size, 0.01f)];

The error is on the [
Invalid expression term ‘[’

Then i’m getting errors on:

MeshRenderer, MeshFilter, MeshCollider and the last MeshFilter all errors are the same:

‘MeshRenderer’ is a type, which is not valid in the given context

For the bracket (‘[’) part, instead of brackets you need to use curly brackets like this:

someArray = { firstValue, secondValue, thirdValue };

For second error, you need to use typeof() method like this:

GameObject obj = new GameObject("New_Plane_Fom_Script", typeof(MeshRenderer), typeof(MeshFilter), typeof(MeshCollider));