title: Unity Build error: The name 'EditorUtility' does not exist in the current context
body: <p>I have got a very simple problem. I have a build error when I am trying to build my game in unity. When I run the game in the editor it works just fine. Here is the error as it is shown in the console. </p>
  
  <pre><code>Assets\Scripts\Pattern.cs(284,17): error CS0103: The name 'EditorUtility' does not exist in the current context
  </code></pre>
  
  <p>Now, this is the line of code the error was referencing to:</p>
  
  <pre><code>EditorUtility.DisplayDialog("Great!", "You got the pattern right!", "Next Level!");
  </code></pre>
  
  <p>Lastly, if you think the error is that I didn't import the right things into the script then you are wrong because I imported this:</p>
  
  <pre><code>using System.Linq;
  using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using System;
  using UnityEditor;
  </code></pre>
  
  <p>can anybody help me? Thank you in advance.</p>
  
  <p>EDIT:
  doing this code:</p>
  
  <pre><code>#if UNITY_EDITOR
              EditorUtility.DisplayDialog("Meh", "You got the pattern wrong ):", "Try Again!");
  #endif
  </code></pre>
  
  <p>doesn't work. In the build version it just doesn't show the message box and it acts as though this line is just a comment. Can somebody help?</p>