Problems with computing X,Y,Z positions of planets at a certain time in Unity3D (C#)
I think E and M are in degrees in your code, but the trig functions in the math library in C# expect an argument in radians.

One way to handle this is to define constants  radians = Pi/180 and degrees = 180/pi then always do Mathf.Sin(M*radians). You will also need to do this for the lines float xx=.

Alternatively, you could work entirely in radians. Convert all angles to radians at the start and only use radians in the code. You would need to convert n, i, w and M to radians and remember that e and v will also be in radians.