Associate
Hi all,
The title might look a bit confusing so I'll post the relevant code :
I get : error CS0747: Inconsistent `object initializer' member declaration
I can get around it by changing the line that gives the error to
Then I have to mess around making a temporary list, just wondered if there was another way.
Cheers
The title might look a bit confusing so I'll post the relevant code :
Code:
public class Taxiways
{
public string Name;
public Vector3 EndPosition;
public List<float> ControlPointInterpolation = new List<float>();
}
// IN ANOTHER CLASS
public List <Taxiways> TaxiwaysList = new List<Taxiways>();
void InitialiseNewTaxiClass (CurvySpline NewSpline)
{
Vector3 endpos = NewSpline.LastVisibleControlPoint.transform.position;
List <float> Templist = new List<float> ();
Templist.Add (NewSpline.Length);
TaxiwaysList.Add (new Taxiways {
Name = NewSpline.name,
EndPosition = endpos,
ControlPointInterpolation.add(NewSpline.Length) // This line gives an ERROR
});
}
I get : error CS0747: Inconsistent `object initializer' member declaration
I can get around it by changing the line that gives the error to
Code:
ControlPointInterpolation = Templist.ToList()
Then I have to mess around making a temporary list, just wondered if there was another way.
Cheers