title: How to make global preprocessor definitions in a single place without having lots of warnings?
body: <p>I want a way to have "global preprocessor definitions" such that I can change a single value before compilation to add or remove functionality of my program. Currently I have a "global script" (called God.cs) with consts such as:</p>
  
  <pre><code>public const bool PRINT_RUN_VALUES = true;
  public const bool DEBUG_MOVEMENT = false;
  public const bool DOUBLE_SPEED = false;
  </code></pre>
  
  <p>With all relevant scripts using these values, for example:</p>
  
  <p>in script 1:</p>
  
  <pre><code>if (God.PRINT_RUN_VALUES) {
     float averageDist = /* calculate values */
     print("Script1: averageDist = " + averageDist);
  }
  </code></pre>
  
  <p>in script 2:</p>
  
  <pre><code>if (God.PRINT_RUN_VALUES) {
     print("Script2: radius = " + radius);
     print("Script2: time = " + time);
  }
  </code></pre>
  
  <p>The problem with this method is that I get tons of </p>
  
  <blockquote>
    <p>CS0162: Unreachable code detected</p>
  </blockquote>
  
  <p>warnings. I can turn off these warnings using:</p>
  
  <pre><code>#pragma warning disable 0162
  #pragma warning disable 0429
  </code></pre>
  
  <p>But I don't want to do that because these warnings can be useful in cases that don't involve these values from God.cs. An alternative might be to use classical preprocessor definitions such as:</p>
  
  <pre><code>#define PRINT_RUN_VALUES
  ...
  #if (PRINT_RUN_VALUES)
     float averageDist = /* calculate values */
     print("Script1: averageDist = " + averageDist);
  #endif
  </code></pre>
  
  <p>However as far as I know that would require me to add '#define PRINT_RUN_VALUES' at the start of each .cs file, which would become a nightmare when I want to quickly turn off or on these global statements. I want all of these global definitions is a single place so that I can quickly turn them off and on.</p>
  
  <p>How can I define some preprocessor thing such that it isn't included in each script? I know that there are proprocessor definitions that meet this criteria, such as definitions to check what operating system is compiling the software. Or is there another way around this?</p>