I am using a struct List with 2 variables. I am trying to set the value of a variable in a loop but I get the error:
Cannot modify the return value of 'List<>.this[int]' because it is not a variable
Why am I seeing this error?
[Serializable]
public struct SetData
{
public float Time;
public float Value;
}
public List<SetData> setData;
void Start ()
{
for (int i = 0; i < setData.Count; i++)
{
setData[i].Time= ((float) DateTime.Now.Hour + ((float) DateTime.Now.Minute * 0.01f));
}
}