title: Avoid Unity error check for undefined #if code
body: <p>I'm working on a Unity (v2019.1.11) project where I have the following case of a class that is being included via a <code>git submodule</code> from another project where the namespace (<code>CustomNameSpace</code>) exists:</p>
  
  <pre class="lang-cs prettyprint-override"><code>#if FLAG
  using CustomNameSpace;
  
  public class Foo
  {
  
  }
  #endif
  </code></pre>
  
  <p>In my project at hand <code>CustomNameSpace</code> does not exist. Therefore I thought that unless I define <code>FLAG</code> in Unity's player settings, the file containing this code would be treated as if it was empty. However, even though <code>FLAG</code> is undefined, Unity is throwing an error for the missing namespace.</p>
  
  <p>I would like to know how to correctly being able to avoid code files to be compiled or even checked by Unity.</p>
  
  <p><strong>EDIT:</strong> <br>
  I already have checked that: <br>
  - <code>FLAG</code> is not defined in the Unity player settings <br>
  - <code>FLAG</code> is not defined in any code file in the solution <br>
  - <code>FLAG</code> is not defined in <code>Assets\csc.rsp</code> as described <a href="https://docs.unity3d.com/Manual/PlatformDependentCompilation.html" rel="nofollow noreferrer">here</a></p>