title: For Each statement with a constructor list?
body: <p>I am writing a pathfinding script in Unity, and I have been trying to figure out IEnumerables, and I feel I am not wording my internet searches correct, because it is not at all what I want.</p>
  
  <p>I have 3 scripts, 1 find nodes and it adds to the OpenNodes list which is it's own script with constructor. I have An IEnumerable and it is still saying it can't access, or it needs to be static if just public. So my codes as follows:</p>
  
  <pre><code>public class OpenNodes: IEnumerator, IEnumerable {
  public static Vector3 node;
  public static int g;
  
  public static IEnumerator GetEnumerator()
  {
      return (IEnumerator)this;
  }
  
  public OpenNodes(Vector3 newNode, int newGscore)
  {
      node = newNode;
      g = newGscore;
  
  }
  </code></pre>
  
  <p>so what I am trying to do in a different "FinderScript" is along these lines:</p>
  
  <pre><code>foreach(Vector3 node in OpenNodes)
  </code></pre>
  
  <p>I have been trying my hardest to figure it out, but I have never worked in constructor lists like this. This is new to me, so any help, would be SO greatly appreciated.. Thanks</p>
  
  <p>EDIT:
  This for each needs to take node in as a vector3 as it is using .x,.y, and .z values for comparison and changes.. </p>