title: Can't remove element from list
body: <p>I'm developing a game in Unity, and I want to remove an element from a list. But when I call the method <code>List&lt;T&gt;.Remove(T)</code>, it doesn't remove anything.</p>
  
  <pre><code>private void OnMouseDown()
  {
      Debug.Log("Clicked for mixing");
      foreach (Element element in ElementsControl.elements)
      {
          if (element.composition.Length &gt; 1)
          {
              Debug.Log("FINE. Element is not pure");
              List&lt;Element&gt; a = new List&lt;Element&gt;();
              foreach (Element compElement in element.getRawComposition())
              {
                  a.Add(compElement);
              }
              string allComposition = "";
              foreach (Element dispElement in a)
              {
                  if (allComposition == "")
                      allComposition = dispElement.name;
                  else
                      allComposition += " + " + dispElement.name;
              }
              Debug.Log(element.name + " composition is: " + allComposition);
              string cauldElements = "";
              foreach (Element cauldElem in cauldron.getElements())
              {
                  if (cauldElements == "")
                      cauldElements = cauldElem.name;
                  else
                      cauldElements += " + " + cauldElem.name;
              }
              Debug.Log("Cauldron has: " + cauldElements);
              if (ContainsAllItems(cauldron.getElements(), a))
              {
                  Debug.Log("OK. Mix result is " + element.name + ", used " + a);
                  Debug.Log("Removing " + a.Count + " elements from cauldron");
                  int counter = 0;
                  foreach (Element remElem in a)
                  {
                      cauldron.getElements().Remove(remElem);
                      Debug.Log("Removed " + remElem + " from cauldron");
                      counter++;
                  }
                  Debug.Log("Removed " + counter + " elements from cauldron");
                  Debug.Log("Adding " + element + " to cauldron");
                  cauldron.getElements().Add(element);
                  return;
              }
              else
                  Debug.Log("NO. Mix result not ok");
          }
      }
  }
  </code></pre>
  
  <p>The problem comes in these lines:</p>
  
  <pre><code>foreach (Element remElem in a)
  {
    cauldron.getElements().Remove(remElem);
    Debug.Log("Removed " + remElem + " from cauldron");
    counter++;
  }
  </code></pre>
  
  <p>When I try to delete it, the list stays as it, without deleting anything.</p>