The type or namespace name `Editor' could not be found.

I’m creating a mobile android app with Unity 3D. I’ve finished and I get no errors. When I try to build the app, it begins to build, then it stops and I get the error message “Assets/Plugins/Facebook/Editor/FacebookSettingsEditor.cs(11,39): error CS0246: The type or namespace name `Editor’ could not be found. Are you missing a using directive or an assembly reference?”. The error comes from the script FacebookSettingsEditor.cs which is in the “Editor” folder. I have not changed any of the scripts that came with the Facebook Integration AddOn. I have been trying to fix this issue for over a month and I have no idea how to fix it.


I know that this is a dead post, but I had this problem and it wasn’t answered here, so here’s what worked for me:

You need to put the script that derives from Editor in the Assets/Editor folder that you have to make yourself.

to solve this you need to move Editor folder from
Assets/Plugins/Facebook to Assets/Facebook

I had a similar issue with iTween and moving the iTween folder out of the Plugins folder (and into my Scenes folder) fixed it.

Seems like every plugin that i used has the same behaviour. need to place the plugin editor into
Assets/“PluginName”/Editor

I am having this same issue. The problem is that you can not build your game if a script has editor code in it. No point in adding code that only effects the Unity editor in your games builds as they won’t have the unity editor.

Your options are:

  1. use C#'s pre-processor commands sorrounding editor code like this:

#if UNITY_EDITOR Editor Code #endif

  1. place the script in a folder named “Editor” anywhere in your project.

When Unity builds your game, it will ignore these pre-processor commands and these folders.

What I don’t understand is that the script that the Unity Build is complaining about is in an Editor folder, but also needed #if Unity_EDITOR blocks surrounding the whole script.

I also found that using conditional compiling works for me:
#if UNITY_EDITOR

public class MyScriptEditor: Editor {
....
}

#endif 

I hope it helps

Have you checked here? Could be that your editor script is not in an editor folder.

http://unity3d.com/learn/tutorials/modules/intermediate/editor/building-custom-inspector

I fix that problem by creating a folder Editor in Assets/Scripts

Assets/Scripts/Editor/

Custom editor scripts should be there.

yesss, it worked, thank you guys.

How do you put a script from Editor to the Assets/Editor that you have to make yourself?

How do you find it?

How do you make it?

???