title: Get all containing flags
body: <p>I have a variable containing some flags and wounder how I'm able to check which flags that are set.</p>
  
  <p>My flags.</p>
  
  <pre><code>[Flags]
      public enum Button{ 
          //Can't have more than 30 flags
          //If an enum is added or deleted need to change for loop in method AddButton
  
          // Exit flags
          Exit = 1 &lt;&lt; 0, 
          Cancel = 1 &lt;&lt; 1, 
          Abort = 1 &lt;&lt; 2,
          Close = 1 &lt;&lt; 3,
  
          //Proced flags
          Accept = 1 &lt;&lt; 4, 
          Ok = 1 &lt;&lt; 5,
          Submit = 1 &lt;&lt; 6,
  
          //Question flags
          No = 1 &lt;&lt; 7,
          Yes = 1 &lt;&lt; 8,
  
          //Save and load
          Save = 1 &lt;&lt; 9,
          SaveAll = 1 &lt;&lt; 10,
          SaveNew = 1 &lt;&lt; 11,
          Open = 1 &lt;&lt; 12,
          Load = 1 &lt;&lt; 12
      }
  </code></pre>
  
  <p>And here are where i check my flags</p>
  
  <pre><code>    for (int i = 1; i &lt;= 12; ++i) {
          if((buttons &amp; 1 &lt;&lt; i) == 1 &lt;&lt; i){
  
          }
      }
  </code></pre>
  
  <p>Apparently I can't use this way to check flags.</p>
  
  <p>To be clear I want to know what flags that are set in buttons.</p>
  
  <p>Update:
  I can't use the Enum.hasFlag() because I making a game in Unity and it uses Mono. Apparently Mono hasn't support for hasFlag yet.</p>