Type or namespace "Property Drawer" could not be found. On build.

I have script for creating a custom drawer. Everything works fine in the editor and normal play, but when I try to build the project, I get this error and similar ones for UnityEditor derivatives in other scripts.

using UnityEditor;
using UnityEngine;

[CustomPropertyDrawer(typeof(Conditions))]
public class ConditionDrawer : PropertyDrawer
{
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
            //Code for the GUI
    }
}

This is one of the scripts’ methods and declarations. These scripts are put into a folder named “Drawers”.

Put editor code in a folder named Editor. Nothing that uses the UnityEditor namespace will compile for runtime, and scripts within the Editor folders are omitted from runtime compiling.

Yep, that fixed it.