When I try to build my Unity project, it is including the scripts in the Editor folder in the build and flagging a bunch of errors. See the attached image. These script files in the Editor folder are from the Anima2D add-on. The documentation says that anything inside a folder named “Editor” will not be included in the build, so why is my Unity trying to include them? My Editor folder is not in another special folder, it is in the root Assets folder. Very frustrating! Please Help. I am using Unity 2018.2.15f1.,When I try to build my Unity project, it is including the scripts inside my Editor folder and causing many build errors. These script files are from the Anima2D add-on. See screenshot. Scripts in the Editor folder should not be included in the build, so I don’t have any idea why Unity is trying to include them in the build. Help please!! I am using Unity 2018.2.15f1.
This is caused by the use of assembly definitions.
You can “fix” this by creating an assembly definition inside each Editor folder. Then mark it to only be included on the “Editor” platform (and check “Test Assemblies” to allow it to access UnityFramework)
Or you can go to all scripts in all Editor folders and add
#if UNITY_EDITOR at the top and
#endif at the bottom of the file.