Witam, mam mały problem z List<>.
Mianowicie, napisałem sobie kawałek kodu
...
calss P
{
private List<XYZ> vertexBuffer_1 = new List<XYZ>();
struct XYZ
{
public float x, y, z;
}
...
public void c()
{
XYZ n = new XYZ()
n.x = 10.0f;
n.y = 11.0f;
n.z = 10.0f;
vertexBuffer_1.Add( n );
}
}
...
i teraz kiedy chcę zmodyfikować wartość w tablicy vertexBuffer_1
vertexBuffer_1[0].x = 20.0f;
wyskakuje mi błąd kompilatora:
Error 1 Cannot modify the return value of 'System.Collections.Generic.List<A.Program.XYZ>.this[int]'
because it is not a variable
Nie wiem jak rozwiązać ten problem, z góry dziękuję wszystkim za pomoc.