title: declare object in c# with x,y paramateres
body: <p>I want to create object "A" which will have x, y parameters.
  and A must be an array. What's best practice of declaring and constructing such object ? for example something like this:</p>
  
  <pre><code>A[0].x=5
  A[0].y=3
  
  A[1].x=6
  A[1].y=4
  </code></pre>
  
  <p><strong>Update</strong>
  I've done this way:</p>
  
  <pre><code>    public class PersonalWaypoints
      {
          public float x { get; set; }
          public float y { get; set; }
      }
  public class MainClass:MonoBehaviour
  {
  then in void Start() {
  PersonalWaypoints[] pw = new PersonalWaypoints[waypoints.Length];
  
  pw[0].x = waypoints[0].transform.position.x ;
  pw[0].y = waypoints[0].transform.position.y ;
  </code></pre>
  
  <p>but then I cannot use pw in Update() { because it doesn't exist in current context.</p>
  
  <p>And to have it in context I cannot move PersonalWaypoints[] pw = new PersonalWaypoints[waypoints.Length]; to class definition because waypoints.Length is unknown while defining class.</p>