title: UI button listener AddListener not working in a loop
body: <p>I've got problem with UI listener. I try to assign click listener to the method in for loop for UI, but every time I've got last option selected.</p>
  
  <pre><code>public Button[] options;
  
  void Start () 
  {
      for(int i = 0; i &lt; options.Length; i++)
      {
          options[i].onClick.AddListener(()=&gt; {OptionPressed(i);});
      }
  }
  
  private void OptionPressed(int i)
  {
      print (i);
  }
  </code></pre>
  
  <p>It's always print 3. My question is why? and also why 3 while there is only 3 buttons, so it should be 2?</p>