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.
Assets\Scripts\Pattern.cs(284,17): error CS0103: The name 'EditorUtility' does not exist in the current context
Now, this is the line of code the error was referencing to:
EditorUtility.DisplayDialog("Great!", "You got the pattern right!", "Next Level!");
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:
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UnityEditor;
can anybody help me? Thank you in advance.
EDIT: doing this code:
#if UNITY_EDITOR
EditorUtility.DisplayDialog("Meh", "You got the pattern wrong ):", "Try Again!");
#endif
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?