# Unity build trying to include Editor Scripts

I'm having a peculiar problem. I'm creating a 2D Unity game using Fungus for cutscenes and the Unity Test Tools for unit testing. The game runs fine in the editor, but when I try and build an executable, I get compilation errors such as "the type or namespace Editor could not be found". All of these errors are coming from scripts in the "Editor" directory of Fungus and "Editor" directories of Fungus dependencies.

Here is what I think the problem is: I've used assembly definitions so that my tests can reference my scripts and so that my scripts can reference Fungus. I think that these assembly definitions are causing Fungus Editor scripts to be compiled into the build.

In summary, here is the directory hierarchy

Assets
|---> Fungus
|       |----> Fungus.asmdef
|---> Scripts
|       |----> Main.asmdef
|---> Tests
|       |----> Tests.asmdef


And the assembly definition dependency graph looks like this:

Tests--->Main---->Fungus


Is anyone an expert on Unity compilation or run into a similar problem that could help me out?